object-property-replacer

1.0.0 • Public • Published

object-property-replacer Build Status

A Node.js module to replace the properties of an object by the properties of another object

Installation

Install using npm:

npm install -S object-property-replacer

Usage

Replace the properties of a destination object by the properties of a source object:

const replacer = require('object-property-replacer');
 
const destination = {
  'id': 1,
  'email': 'jdoe@example.com',
  'password': '123456',
};
 
const source = {
  'id': 1,
  'email': 'jdoe@example.com',
  'role': 'user',
};
 
replacer.replace(destination, source);
 
// destination = {'id': 1, 'email': 'jdoe@example.com', 'role': 'user'}

License

object-property-replacer is released under the MIT license.

Package Sidebar

Install

npm i object-property-replacer

Weekly Downloads

5

Version

1.0.0

License

MIT

Last publish

Collaborators

  • xavierdutreilh