clean
v1.0.0arrow_drop_downv1.0.0
v0.0.1
STATUS
Passing
DOWNLOADS
32
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
7 years ago
SIZE
570 B
Cleans all object's properties that contains a falsy value
and returns a new object without them.
Like
Install clean as a package?
Copied
npm i @bit/bit.utils.object.clean
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example modifieddraft
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
and packages in Bit or NPM to the example. any of the 1 million componentstoggle layout
No preview available
chevron_left
chevron_right
clean (
obj:
) : object
object
Cleans all object’s properties that contains a falsy value and returns a new object without them.
Example
Argument
obj:
object
object to clean
Returns
object
Test Summary
#clean() should clean property | Pass |
#clean() should return an empty object as all properties are falsy | Pass |
#clean() should throw a type error in case a non-object value was passed | Pass |