object-inject

0.0.2 • Public • Published

object-inject

Inject a new object into an existing one at a certain position.

Example

var objectInject = require('object-inject');
 
var original = {
  created: new Date(),
  modified: new Date(),
  name: 'Test!',
  status: 'active'
};
 
var injectThis = {
  info: {
    created_by: 'me',
    modified_by: 'you'
  }
};
 
var newObject = objectInject(original, injectThis, 'name', 'before');

/object-inject/

    Package Sidebar

    Install

    npm i object-inject

    Weekly Downloads

    2

    Version

    0.0.2

    License

    MIT

    Last publish

    Collaborators

    • dustinwtf