@amjs/utils-object

0.1.0 • Public • Published

@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'

Readme

Keywords

Package Sidebar

Install

npm i @amjs/utils-object

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

23.5 kB

Total Files

13

Last publish

Collaborators

  • amjs