Security News
Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
babel-plugin-transform-es2015-object-super
Advanced tools
Readme
Compile ES2015 object super to ES5
In
let obj = {
say () {
return "Hello"
}
}
let obj2 = {
say () {
return super.say() + "World!"
}
}
Out
var _obj;
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
var obj = {
say: function say() {
return "Hello";
}
};
var obj2 = _obj = {
say: function say() {
return _get(_obj.__proto__ || Object.getPrototypeOf(_obj), "say", this).call(this) + "World!";
}
};
npm install --save-dev babel-plugin-transform-es2015-object-super
.babelrc
(Recommended).babelrc
{
"plugins": ["transform-es2015-object-super"]
}
babel --plugins transform-es2015-object-super script.js
require("babel-core").transform("code", {
plugins: ["transform-es2015-object-super"]
});
FAQs
Compile ES2015 object super to ES5
The npm package babel-plugin-transform-es2015-object-super receives a total of 1,044,626 weekly downloads. As such, babel-plugin-transform-es2015-object-super popularity was classified as popular.
We found that babel-plugin-transform-es2015-object-super demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 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
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.