babel-plugin-transform-for-of-as-array
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"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 @@ } |
6403
70