mapDeep

Type:Function
Status:stable
Since:1.0.0
Platform:jsnode
@blackbyte.sugar.shared.object

This function is the same as the “map” one. The only difference is that this one goes deep into the object

Params

  1. object*-Object

    The object you want to map through

  2. processor*-Function

    The processor function that take as parameter the actual property value, the current property name and the full dotted path to the current property

  3. settings{}Object

    An object of settings to configure your mapDeep process:

Example

import { mapDeep } from '@blackbyte/sugar/object';
mapDeep({
   hello: 'world'
}, ({object, prop, value, path}) => {
   return '~ ' + value;
});

Settings

  1. classInstancesfalseBoolean

    Specify if you want the objects to be processed the same as other values

  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

  4. privatePropstrueBoolean

    Specify if you want to clean also the private properties that starts with ”_“

Todo

  • testsnormal