y-strip
v1.0.0
Published
remove falsy value from object
Downloads
1
Readme
y-strip
Intro
Remove falsy value from object.
Usage
import SO from 'y-strip'
const so = new SO()
const obj = {
a: 1,
b: '',
c: false,
d: null,
e: undefined,
f: 0
}
const result = so.strip(obj)
console.log(result) // { a: 1 }
const sso = new SO(true)
const resultS = sso.stript(obj)
console.log(resultS) // { a: 1, b: '', d: null, e: undefined, f: 0}
Option
const so = new SO(strict)
- [strict=false] whether only strip value that ===
false
.