Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
babel-plugin-transform-remove-polyfill
Advanced tools
[![CI](https://github.com/shoonia/babel-plugin-transform-remove-polyfill/actions/workflows/ci.yml/badge.svg)](https://github.com/shoonia/babel-plugin-transform-remove-polyfill/actions/workflows/ci.yml)
npm i babel-plugin-transform-remove-polyfill -D
# or
yarn add babel-plugin-transform-remove-polyfill -D
Before:
var __assign = Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
}
After:
var __assign = Object.assign;
With a configuration file babel.config.json
{
"plugins": ["babel-plugin-transform-remove-polyfill"]
}
transform
Set to true
to enable all transformers
{
"plugins": [
[
"babel-plugin-transform-remove-polyfill",
{
"transform": true
}
]
]
}
or customization transform features
"unsafe:Array.from"
boolean
, defaults to false
.
{
"plugins": [
[
"babel-plugin-transform-remove-polyfill",
{
"transform": {
"unsafe:Array.from": true
}
}
]
]
}
Example:
- Array.prototype.slice.call(arguments)
+ Array.from(arguments)
⚠️ Warning: Unsafe transformation
// Object with a length property
const arrayLike = { length: 2 }
/**
* Return empty array with length == 2
*
* [empty × 2]
* length: 2
*/
console.log(Array.prototype.slice.call(arrayLike));
/**
* Return array with undefined values and length == 2
*
* [undefined, undefined]
* 0: undefined
* 1: undefined
* length: 2
*/
console.log(Array.from(arrayLike));
"optimize:Object.assign"
boolean
, defaults to false
.
{
"plugins": [
[
"babel-plugin-transform-remove-polyfill",
{
"transform": {
"optimize:Object.assign": true
}
}
]
]
}
Example:
- Object.assign(Object.assign({}, e), o);
+ Object.assign({}, e, o);
FAQs
[![CI](https://github.com/shoonia/babel-plugin-transform-remove-polyfill/actions/workflows/ci.yml/badge.svg)](https://github.com/shoonia/babel-plugin-transform-remove-polyfill/actions/workflows/ci.yml)
The npm package babel-plugin-transform-remove-polyfill receives a total of 38 weekly downloads. As such, babel-plugin-transform-remove-polyfill popularity was classified as not popular.
We found that babel-plugin-transform-remove-polyfill demonstrated a healthy version release cadence and project activity because the last version was released less than 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.