based-on

v0.0.1
Create new object based on another

based-on

var settings = basedOn({
    key: 'value',
    other: 'value2'
});

settings();
// { key: 'value', other: 'value2' }

settings({ test: 'ing' })
// { key: 'value', other: 'value2', test: 'ing' }

var otherSettings = settings.with({ other: 'true' });

otherSettings();
// { key: 'value', other: 'true' }

otherSettings({ key: 'test' });
// { key: 'test', other: 'true' }

Install

npm:

npm install based-on

Bower:

bower install based-on

Or just download from here

Metadata

  • MIT
  • Whatever
  • Kim Joar Bekkelund
  • released 1/17/2014

Downloads

Maintainers