
Research
/Security News
Intercom’s npm Package Compromised in Ongoing Mini Shai-Hulud Worm Attack
Compromised intercom-client@7.0.4 npm package is tied to the ongoing Mini Shai-Hulud worm attack targeting developer and CI/CD secrets.
shallow-clone-shim
Advanced tools
Shallow clones an object while respecting the original property descriptors
Shallow clones an object, including non-enumerable properties, while respecting the original data and accessor descriptors of the properties. This means that for instances getters and setters are copied faithfully. Optionally allows for shimming/overwriting properties by redefining or manipulating existing property descriptors.
npm install shallow-clone-shim --save
const assert = require('assert')
const clone = require('shallow-clone-shim')
const original = Object.defineProperties({}, {
foo: { // non-writable
value: 1
},
bar: { // non-configurable
enumerable: true,
get: function get () {
return 2
}
}
})
assert.strictEqual(original.foo, 1)
assert.strictEqual(original.bar, 2)
const copy = clone({}, original, {
bar (descriptor) {
// descriptor == Object.getOwnPropertyDescriptor(original, 'bar')
const getter = descriptor.get
descriptor.get = function get () {
return getter() + 1
}
return descriptor
}
})
assert.strictEqual(original.foo, 1)
assert.strictEqual(original.bar, 3)
object = clone(object, original[, shim])Shallow copies all own properties of the original into object. Both
enumerable and non-enumerable properties are copied.
The object is also returned.
If the optional shim argument is supplied, it's expected to be an
object containing functions. The names of the shim object propeties is
expected to match the names of properties in the original object. Each
shim function is called with the property descriptor for that particular
property in original. The function is expected to return a valid
property descriptor as expected by Object.defineProperty(). The
returned desciptor will replace the original descriptor in the copied
object.
FAQs
Shallow clones an object while respecting the original property descriptors
The npm package shallow-clone-shim receives a total of 306,598 weekly downloads. As such, shallow-clone-shim popularity was classified as popular.
We found that shallow-clone-shim 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.

Research
/Security News
Compromised intercom-client@7.0.4 npm package is tied to the ongoing Mini Shai-Hulud worm attack targeting developer and CI/CD secrets.

Research
Socket detected a malicious supply chain attack on PyPI package lightning versions 2.6.2 and 2.6.3, which execute credential-stealing malware on import.

Research
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.