
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
babel-plugin-transform-builtin-extend
Advanced tools
A plugin for Babel 6 supports extending from builtin types based on static analysis.
This is a Babel 6 plugin to enable extending builtin types like "Error" and "Array" and such, which require special treatment and require static analysis to detect.
In your Babel 6 configuration, for example in a .babelrc
you might have
{
"plugins": [
["babel-plugin-transform-builtin-extend", {
globals: ["Error", "Array"]
}]
]
}
which would enable the plugin and configure it to look for any class extending Error
or Array
globals.
On older browsers that do not support reassigning the prototype of an existing object, you will need to
enable the approximate
mode, which will fall back to the Babel 5 behavior of using simple ES5 inheritance
to approximate extending a class, though your results may vary depending on your goals.
{
"plugins": [
["babel-plugin-transform-builtin-extend", {
globals: ["Error", "Array"],
approximate: true
}]
]
}
This plugin will only reles on assigning __proto__
for static property inheritance from parent constructors.
If you are relying on this, it will not work on IE<=10 and any other browsers that don't support __proto__
.
FAQs
A plugin for Babel 6 supports extending from builtin types based on static analysis.
The npm package babel-plugin-transform-builtin-extend receives a total of 20,380 weekly downloads. As such, babel-plugin-transform-builtin-extend popularity was classified as popular.
We found that babel-plugin-transform-builtin-extend 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
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.