Skip to content

Commit 3eec8ff

Browse files
committed
refactor: use ES5 syntax to iterate Map entries, closes #4
1 parent 86c7024 commit 3eec8ff

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

.eslintrc.yml

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
parserOptions:
2-
ecmaVersion: 6
31
extends: eslint:recommended
42
env:
53
node: true

index.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,10 @@ exports.stringify = function (data, _, options) {
367367
out('{');
368368
var propLvl = lvl + 1;
369369
var first = true;
370-
for (var item of _data.entries()) {
370+
var entries = _data.entries();
371+
var entry = entries.next();
372+
while (!entry.done) {
373+
var item = entry.value;
371374
var key = item[0];
372375
var value = isSet ? true : item[1];
373376
if (validType(value)) {
@@ -382,6 +385,7 @@ exports.stringify = function (data, _, options) {
382385
if (whitespace) out(' ');
383386
_stringify(value, propLvl, propPtr);
384387
}
388+
entry = entries.next();
385389
}
386390
indent(lvl);
387391
out('}');

spec/.eslintrc.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
parserOptions:
2+
ecmaVersion: 6
13
rules:
24
no-console: 0
35
quotes: 0

0 commit comments

Comments
 (0)