Skip to content

Wolfchamane/amjs-utils-object

Repository files navigation

@amjs/utils 0.1.0

Statements Branches Functions Lines

Set of tools as dotProp, etc.

Installation

$ npm i @amjs/utils-object

Usage

dotProp

const { dotProp } = require('@amjs/utils-object');

const context = {
    key : {
        value : 'value'
    }
};

// Interface: dotProp(ref = {}, prop = '', value = '')
// Use two arguments in order to return a value
console.log(dotProp(context, 'key.value')); // 'value'
// Use additional 3rd argument to assign new value
dotProp(context, 'key.value', 'foo');
console.log(dotProp(context, 'key.value')); // 'foo'

About

Set of tools as dotProp, etc. for Objects

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors