Object utility
$ npm install asobj --save
'use strict'
const { clone } = require('asobj')
{
let obj = clone({
foo: 'bar',
baz: 'quz'
}, {
without: 'baz'
})
console.log(obj) // -> { foo: 'bar' }
}
Available functions
Signature | Description |
---|---|
.assign() -> Object |
Assign object |
.cleanup(values, options, options.delNull, options.delEmptyString) -> Object |
Delete undefined properties. |
.clone(src, options, options.without) -> Object |
Clone a object |
.deepEqual(obj1, obj2) -> boolean |
Compare object deeply |
.dig(src, keys) -> * |
Dig object props |
.keyFor(, ) -> string |
Get key for value |
.retrieve(obj, name) -> * |
Retrieve attribute value from object |
.shallowEqual(obj1, obj2) -> boolean |
Performs equality by iterating through keys on an object and returning false |
This software is released under the MIT License.