Skip to content

Commit ad1d903

Browse files
authored
Depth argument of flat is not applied #16 (#17)
1 parent 012150b commit ad1d903

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ export const Iterator = {
204204
* @return {Iterator}
205205
*/
206206
flat(depth = 1) {
207-
return Iterator.new(this.rawFlat(null, depth));
207+
return Iterator.new(this.rawFlat(depth));
208208
},
209209

210210
/**
@@ -239,7 +239,7 @@ export const Iterator = {
239239

240240
const innerIter = Iterator.new(item);
241241

242-
for (const inner of innerIter.rawFlat(null, depth - 1)) {
242+
for (const inner of innerIter.rawFlat(depth - 1)) {
243243
yield inner;
244244
}
245245
}

0 commit comments

Comments
 (0)