
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
delegate-properties
Advanced tools
Deep-clone properties from one object to another and make them non-enumerable, or make existing properties on an object non-enumerable.
Deep-clone properties from one object to another and make them non-enumerable, or make existing properties on an object non-enumerable.
Install with npm:
$ npm install --save delegate-properties
var delegate = require('delegate-properties');
delegate(receiver, provider, clone);
Params
receiver: (Object) The object receiving propertiesprovider: (Object) The object providing propertiesCopy properties and make them non-enumerable
var provider = {
upper: function(val) {
return val.toUpperCase();
},
lower: function(val) {
return val.toLowerCase();
}
};
var receiver = {};
// an existing properties in the `receiver`
// object would be overwritten
delegate(receiver, provider);
receiver.upper('foo');
receiver.lower('BAR');
console.log(receiver.upper('foo')); // 'FOO'
console.log(receiver.lower('BAR')); // 'bar'
// copied properties are non-enumerable
console.log(receiver); // {}
console.log(Object.keys(receiver)); // []
var obj = {
upper: function(val) {
return val.toUpperCase();
},
lower: function(val) {
return val.toLowerCase();
}
};
delegate(obj);
console.log(obj) // {}
obj.upper('foo') // 'FOO'
obj.lower('BAR') // 'bar'
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
(This document was generated by verb-generate-readme (a verb generator), please don't edit the readme directly. Any changes to the readme must be made in .verb.md.)
To generate the readme and API documentation with verb:
$ npm install -g verb verb-generate-readme && verb
Install dev dependencies:
$ npm install -d && npm test
Jon Schlinkert
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb-generate-readme, v0.1.30, on August 13, 2016.
FAQs
Deep-clone properties from one object to another and make them non-enumerable, or make existing properties on an object non-enumerable.
The npm package delegate-properties receives a total of 363 weekly downloads. As such, delegate-properties popularity was classified as not popular.
We found that delegate-properties demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.