JSPM

ngraph.merge

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 209158
  • Score
    100M100P100Q167715F
  • License MIT

Simple merge utility to extend objects without extra dependencies

Package Exports

  • ngraph.merge

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 (ngraph.merge) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ngraph.merge

Simple merge utility to extend objects without extra dependencies. This utility may be useful when you want to quickly provide optional settings

build status

usage

  var merge = require('ngraph.merge');
  var options = { age: 42 };
  merge(options, { name: 'John' });
  console.log(options); // { age: 42, name: 'John'}

  merge(options, { age: 100 });
  console.log(options.age); // 42. Options already has age defined

  merge(options, {age: '100'});
  console.log(options.age); // '100'. Type mismatch. Age is overwritten

For more examples please refer to tests.

why?

I want to control dependencies chain and not pull too many external libraries into ngraph.

install

With npm do:

npm install ngraph.merge

license

MIT