Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-transform-for-of-as-array

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-for-of-as-array - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

package.json
{
"name": "babel-plugin-transform-for-of-as-array",
"version": "1.0.1",
"version": "1.0.2",
"description": "Transform all for-of loops into the equivalent array for loop",

@@ -5,0 +5,0 @@ "repository": "jridgewell/babel-plugin-transform-for-of-as-array",

@@ -10,2 +10,3 @@ # babel-plugin-transform-for-of-as-array

```js
const array = [1, 2, 3];
for (const elm of array) {

@@ -16,3 +17,3 @@ console.log(elm);

let item;
for ({ item } of array) {
for ({ item } of array.map(item => ({ item }))) {
console.log(item);

@@ -25,4 +26,6 @@ }

```js
for (let _i = 0, _array = array; _i < _array.length; _i++) {
const elm = _array[_i];
const array = [1, 2, 3];
for (let _i = 0; _i < array.length; _i++) {
const elm = array[_i];
console.log(elm);

@@ -32,4 +35,5 @@ }

let item;
for (let _i2 = 0, _array = array; _i2 < _array.length; _i2++) {
const { item } = _array[_i2];
for (let _i2 = 0, _array$map = array.map(item => ({ item })); _i2 < _array$map.length; _i2++) {
({ item } = _array$map[_i2]);
console.log(item);

@@ -36,0 +40,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc