
Product
Introducing Pull Request Stories to Help Security Teams Track Supply Chain Risks
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
assign-properties
Advanced tools
An Object.assign like utility that preserve descriptors, as in accessors or value, or configurable, or writable, etc.
import assignProperties from 'assign-properties';
const assignProperties = require('assign-properties');
// <script src="https://unpkg.com/assign-properties">
// the issue with assign is that copies are values
const before = Object.assign({}, {get random() { return Math.random() }});
// mixins are broken this way
before.random === before.random; // true
// with assignProperties, everything is fine
const after = assignProperties({}, {get random() { return Math.random() }});
// the getter is passed along instead of being lost in the process
after.random === after.random; // false
const base = {get random() { return Math.random() }};
const spread = {...base};
spread.random === spread.random; // true
So, if you want to bring accessors to the mix, this module is your stop.
FAQs
An Object.assign like utility that preserve descriptors
The npm package assign-properties receives a total of 4 weekly downloads. As such, assign-properties popularity was classified as not popular.
We found that assign-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.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.