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-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 7,745 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
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.