Skip to content
mixin for get/set object behavior
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
tests
.gitignore
.jshintrc
.npmignore
LICENSE
README.md
index.js
package.json

README.md

Mutators

Mixin for get/set object mutator behavior

Useage

var extend = require('extend');
var Mutators = require('mutators');

// creates object with get/set functions
var person = extend({}, Mutators);

// set an object attribute
person.set('name', 'bill');

// get an object attribute
log(person.get('name'))

Methods

Methods are defined with the expectation that they will be extended into an instance or prototype of an object. They won't work as static functions.

get(property)

Returns the value of object property.

person.get('name')

set(property, value)

Defines a key-value pair on context object. Multiple key-value pairs can be defined by passing an object.

person.set('name', 'bill');
You can’t perform that action at this time.