@eivifj/dot

1.0.3 • Public • Published

dot

Get and set object properties with dot notation

Installation

$ npm install @eivifj/dot

API

dot.set(object, path, value)

dot.set(obj, 'cool.aid', 'rocks');
assert(obj.cool.aid === 'rocks');

dot.get(object, path)

var value = dot.get(obj, 'cool.aid');
assert(value === 'rocks');

dot.delete(object, path)

var value = dot.delete(obj, 'cool.aid');
assert(!obj.cool.hasOwnProperty('aid'));

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    11,789
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    11,789
  • 1.0.2
    3
  • 1.0.1
    0
  • 1.0.0
    1
  • 0.2.0
    1

Package Sidebar

Install

npm i @eivifj/dot

Weekly Downloads

11,794

Version

1.0.3

License

MIT

Unpacked Size

4.54 kB

Total Files

4

Last publish

Collaborators

  • eivifj