Skip to content

a-x-/dfltv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dfltv

default value wrapper

if value is not defined or it matches with a pattern then it subtitutes with default value else passes as is

using

import Dflt from 'dflt'
const dflt = Dflt('oh fuck', 'oh god')
//                 ^ pattern  ^ default
const bazquxval = fetchBazQux(/*...*/)
foobar(dflt(bazquxval)) // if bazquxval equals 'oh fuck' or not bazquxval: 'oh god' else bazquxval
// ...

Releases

No releases published

Packages

No packages published