object/clean
v0.0.1
0.0.1
Collaborators
Gravatar for undefined
0
MIT
PUBLIC
0
1     DEPENDENCIES
BuildPass

Cleans all object’s properties that contains a falsy value

Use object/clean in your project
npm i @bit/bit.utils.object.clean

clean (obj:object) : object

Cleans all object’s properties that contains a falsy value and returns a new object without them.

Example

new cleaned object
 clean({ foo: null, bar: 'foo' }) // => { bar: 'foo' }

Argument

obj: object

object to clean

Returns

object

Test Summary


#clean() should clean property `foo` as its value is falsyPass
#clean() should return an empty object as all properties are falsyPass
#clean() should throw a type error in case a non-object value was passedPass