0.0.1 • Published 2 years ago

@d3v4pp/dot v0.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

dot

Get and set object properties with dot notation

Installation

$ npm install @d3v4pp/dot

API

dot.set(object, path, value)

dot.set(obj, 'cool.aid', 'rocks');
assert(obj.cool.aid === 'rocks');

dot.get(object, path)

var value = dot.get(obj, 'cool.aid');
assert(value === 'rocks');

dot.delete(object, path)

var value = dot.delete(obj, 'cool.aid');
assert(!obj.cool.hasOwnProperty('aid'));