Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
babel-plugin-transform-for-of-as-array
Advanced tools
Transform all for-of loops into the equivalent array for loop
Transform all for-of loops into the equivalent array for loop
In
const array = [1, 2, 3];
for (const elm of array) {
console.log(elm);
}
let item;
for ({ item } of array.map(item => ({ item }))) {
console.log(item);
}
Out
const array = [1, 2, 3];
for (let _i = 0; _i < array.length; _i++) {
const elm = array[_i];
console.log(elm);
}
let item;
for (let _i2 = 0, _array$map = array.map(item => ({ item })); _i2 < _array$map.length; _i2++) {
({ item } = _array$map[_i2]);
console.log(item);
}
$ npm install babel-plugin-transform-for-of-as-array
.babelrc
(Recommended).babelrc
{
"plugins": ["transform-for-of-as-array"]
}
$ babel --plugins transform-for-of-as-array script.js
require("babel-core").transform("code", {
plugins: ["transform-for-of-as-array"]
});
FAQs
Transform all for-of loops into the equivalent array for loop
The npm package babel-plugin-transform-for-of-as-array receives a total of 5,542 weekly downloads. As such, babel-plugin-transform-for-of-as-array popularity was classified as popular.
We found that babel-plugin-transform-for-of-as-array 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.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.