2.2.0 • Published 7 months ago

tn-deepobj v2.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

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 () {}
})
2.2.0

7 months ago

2.1.0

1 year ago

2.0.1

2 years ago

2.0.0

2 years ago

1.3.1

3 years ago

1.3.0

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago