1.1.2 • Published 8 years ago

access-deep v1.1.2

Weekly downloads
7
License
MIT
Repository
github
Last release
8 years ago

access-deep

Safe access to the nested object's properties with ES6 Proxy object

Build Status Coverage Status dependency Status dependency Status devDependency Status

Install

$ npm install access-deep

Usage

var accessDeep = require('access-deep');

var obj = {};
var accessor = accessDeep(obj);

accessor.foo.bar.baz = 'quux'; // nested objects are automatically created
console.log(JSON.stringify(obj)); // {"foo":{"bar":{"baz":"quux"}}}

accessor.foo.list[2] = 12;
console.log(JSON.stringify(obj)); // {"foo":{"bar":{"baz":"quux"},"list":[null,12]}}

console.log(accessor.foo.list[2].$val); // 12

Compatibility

Node.js version 6 and higher

Browser support http://caniuse.com/#feat=proxy

Warning

This is only experiment, use it at your own risk

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago