morph-object
v1.1.0
Published
Tiny helper lib for morphing objects.
Downloads
1
Readme
morph-object
Tiny helper lib that morphs objects.
Installation
npm install morph-object
Usage
var assert = require('assert');
var morph = require('morph-object');
assert(
morph({ bucket: 'my-bucket', key: 'my-key' }, { key: 'prefix' }),
{ bucket: 'my-bucket', prefix: 'my-key' }
);
assert(
morph({ bucket: 'my-bucket', key: 'my-key' }, { bucket: 'folder', key: 'prefix' }),
{ folder: 'my-bucket', prefix: 'my-key' }
);
assert(
morph.swapKey({ a: 1 }, 'a', 'b'),
{ b: 1 }
);
License
MIT