Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@babel/plugin-transform-proto-to-assign
Advanced tools
Babel plugin for turning __proto__ into a shallow property clone
This plugin allows Babel to transform all
__proto__
assignments to a method that will do a shallow copy of all properties.
This means that the following will work:
var foo = { a: 1 };
var bar = { b: 2 };
bar.__proto__ = foo;
bar.a; // 1
bar.b; // 2
however the following will not:
var foo = { a: 1 };
var bar = { b: 2 };
bar.__proto__ = foo;
bar.a; // 1
foo.a = 2;
bar.a; // 1 - should be 2 but remember that nothing is bound and it's a straight copy
This is a case that you have to be aware of if you intend to use this plugin.
In
bar.__proto__ = foo;
Out
var _defaults = ...;
_defaults(bar, foo);
npm install --save-dev @babel/plugin-transform-proto-to-assign
.babelrc
(Recommended).babelrc
{
"plugins": ["@babel/plugin-transform-proto-to-assign"]
}
babel --plugins @babel/plugin-transform-proto-to-assign script.js
require("@babel/core").transform("code", {
plugins: ["@babel/plugin-transform-proto-to-assign"]
});
FAQs
Babel plugin for turning __proto__ into a shallow property clone
The npm package @babel/plugin-transform-proto-to-assign receives a total of 5,789 weekly downloads. As such, @babel/plugin-transform-proto-to-assign popularity was classified as popular.
We found that @babel/plugin-transform-proto-to-assign demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.