getGlob

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

Retreive an object value using a dotted path like “myObject.myProperty.myValue”. It support glob patterns like “something..id” and returns you a new object containing all values with the path that matches the passed glob pattern.

Params

  1. obj*-Object

    The object in which to set the value

  2. glob*-String

    A glob to describe what you want into the object

  3. settings{}Object

    A settings object to configure your glob get process

Return

  1. -Mixed

    The getted value or “undefined” if nothing found…

Example

import { getGlob } from '@blackbyte/sugar/object';
getGlob({
 hello: {
    world: true,
    plop: false
}, 'hello.');

Settings

  1. unflattentrueBoolean

    Specify if you want the result object to be unflattend using the unflatten sugar function

Todo

  • testsnormal