@eivifj/dot
Version:
Get and set object properties with dot notation
33 lines (22 loc) • 470 B
Markdown
Get and set object properties with dot notation
$ npm install @eivifj/dot
```js
dot.set(obj, 'cool.aid', 'rocks');
assert(obj.cool.aid === 'rocks');
```
```js
var value = dot.get(obj, 'cool.aid');
assert(value === 'rocks');
```
```js
var value = dot.delete(obj, 'cool.aid');
assert(!obj.cool.hasOwnProperty('aid'));
```
MIT