tn-deepobj
TypeScript icon, indicating that this package has built-in type declarations

2.2.0 • Public • Published

Bundle Size - 1.28 Kb gzipped

Methods

deepobj.has(obj, ...paths)
deepobj.get(obj, path)
deepobj.set(obj, path, value)
deepobj.setnew(obj, path, value)
deepobj.update(obj, path, value)
deepobj.delete(obj, path)
deepobj.empty(obj, path)
deepobj.push(obj, path, ...items)
deepobj.unshift(obj, path, ...items)
deepobj.pop(obj, path, howmany?)
deepobj.shift(obj, path, howmany?)
deepobj.assign(obj, path, { prop: value }, deep?)
deepobj.remove(obj, path, ...prop)

Setters

  • set() It is strict. Can create or mutate any property.
  • setnew() It can not mutate pre existed property. Can create a new one.
  • update() It can not create new property. Can mutate existed one.

Dynamic setters

  • set()
  • update()
deepobj.set(obj, path, function (preval) {
  return ++preval
})

deepobj.set(obj, path, function () {
  return function () {}
})

Readme

Keywords

none

Package Sidebar

Install

npm i tn-deepobj

Weekly Downloads

12

Version

2.2.0

License

MIT

Unpacked Size

40.3 kB

Total Files

71

Last publish

Collaborators

  • turnova