Neolithic Prancing Minotaurs
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

compiled-accessors

0.2.0 • Public • Published

compiled-accessors

Build Status Dependency Status devDependency Status

Compiled getter/setter for highest perfs.

Install

Download manually or with package-manager.

npm

npm install --save compiled-accessors

bower

bower install --save compiled-accessors

Example

var CA = require('compiled-accessors');
 
var obj = {
  foo {
    bar: 'Fry'
  }
}
 
// Create a getter for a nested value.
var getFooBar = CA.getter('foo.bar');
 
// Use it.
console.log(getFooBar(obj)); // Fry
 
// Create a setter for the same nested value.
//
// The path can be described as a string or an array.
var setFooBar = CA.setter(['foo', 'bar']);
 
// Use it.
setFooBar(obj, 'Zoidberg');

Contributions

Contributions are very welcomed, either on the documentation or on the code.

You may:

  • report any issue you've encountered;
  • fork and create a pull request.

License

ISC © Julien Fontanet

Install

npm i compiled-accessors

DownloadsWeekly Downloads

1

Version

0.2.0

License

ISC

Last publish

Collaborators

  • avatar
  • avatar