Security News
How Threat Actors are Abusing GitHub’s File Upload Feature to Host Malware
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
shallow-copy
Advanced tools
Readme
make a shallow copy of an object or array
you can copy objects shallowly:
var copy = require('shallow-copy');
var obj = { a: 3, b: 4, c: [5,6] };
var dup = copy(obj);
dup.b *= 111;
dup.c.push(7);
console.log('original: ', obj);
console.log('copy: ', dup);
and you can copy arrays shallowly:
var copy = require('shallow-copy');
var xs = [ 3, 4, 5, { f: 6, g: 7 } ];
var dup = copy(xs);
dup.unshift(1, 2);
dup[5].g += 100;
console.log('original: ', xs);
console.log('copy: ', dup);
var copy = require('shallow-copy')
Return a copy of the enumerable properties of the object obj
without making
copies of nested objects inside of obj
.
If obj
is an array, the result will be an array.
If obj
is an object, the result will be an object.
If obj
is not an object, its value is returned.
With npm do:
npm install shallow-copy
MIT
FAQs
make a shallow copy of an object or array
The npm package shallow-copy receives a total of 1,023,274 weekly downloads. As such, shallow-copy popularity was classified as popular.
We found that shallow-copy 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
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.