shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
cleanDeep
Type:Function
Status:stable
Since:1.0.0
Platform:jsnode
@blackbyte.sugar.shared.object
This function takes an object as input and returns a cleaned version of it. You can pass a cleaner function that has to returns true or false. If returns true, the element will be keeped. If false, it will be removed from the output. The default cleaner function remove all that is either null, "" or undefined.
Params
- object*-Object
The object you want to map through
- settings{}Object
An object of settings to configure your mapDeep process:
Example
import { cleanDeep } from '@blackbyte/sugar/object';
cleanDeep({
hello: 'world',
something: null
});Settings
- cleaner-Function
The cleaner function that take as parameter the actual property value, the current property name and the full dotted path to the current property
- arraytrueBoolean
Specify if we want to process also arrays or not
- clonefalseBoolean
Specify if you want to clone the object passed before cleaning it
Todo
- testsnormal
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space