JSPM

morph-object

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q25408F
  • License MIT

Tiny helper lib for morphing objects.

Package Exports

  • morph-object

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (morph-object) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

morph-object Build Status

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