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

  1. object*-Object

    The object you want to map through

  2. settings{}Object

    An object of settings to configure your mapDeep process:

Example

import { cleanDeep } from '@blackbyte/sugar/object';
cleanDeep({
   hello: 'world',
   something: null
});

Settings

  1. 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

  2. arraytrueBoolean

    Specify if we want to process also arrays or not

  3. clonefalseBoolean

    Specify if you want to clone the object passed before cleaning it

Todo

  • testsnormal