ngraph.expose
v1.0.0
Published
Adds getters and setters to subeset of object's properties
Downloads
4,938
Readme
ngraph.expose
Adds getters and setters to subset of object's properties
Example
var target = {};
var source = { age: 42};
exposeProperties(source, target);
target.age(); // returns 42
target.age(24); // sets source.age to 24;
You can also select only subset of properties you want to expose:
var target = {};
var source = { age: 42, name: 'John'};
exposeProperties(source, target, ['name']);
target.name(); // returns 'John'
target.age === undefined; // true
install
With npm do:
npm install ngraph.expose
license
MIT