1.0.1 • Published 8 years ago

extend-exclude v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
8 years ago

extend-exclude (node-extend with some salt)

Build Status

  • Deep copy from multiple sources to destination object
  • Allow passing array of properties not to be copied to the destination object

Installation

npm install @adibiton/extend-exclude

API

extend(dest, [exclude], [src])

dest Type: object The object to be extended

exclude

Type: Array of strings A black list of properties not to be included in the extended object (value can be null) - the properties are only on the root level

src Type: object / Array of objects The source object(s) to be copied

Install

npm install extend-exclude

Example

const extend = require('extend-exclude');

let x = {name: {first: 'Franz', last: 'Schubert'}, profession: 'composer'}; 
let y = {age: '55'};  

extend(y, ['profession'], x);  

console.log(y); //{ age: '55', name: { first: 'Franz', last: 'Schubert' } }
1.0.1

8 years ago

1.0.0

8 years ago