Skip to content
This repository has been archived by the owner on Mar 18, 2022. It is now read-only.

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

License

Notifications You must be signed in to change notification settings

DustinHigginbotham/object-inject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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');

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published