1.0.1 • Published 5 years ago
sahmat v1.0.1
sahmat
simple getter and setter for deep objects
Installation
npm i -S sahmat
Usage
const sahmat = require('sahmat')
const obj = {
one: {
two: {
a: 1,
b: [3,4,5]
}
}
}
// GET
sahmat(obj, 'one.two.a')
// 1
sahmat(obj, 'one.two.b.2')
// 5
// SET
sahmat(obj, 'one', {})
sahmat(obj, 'one')
// {}
License
MIT