iteragain
Advanced tools
Comparing version 0.9.1 to 0.9.2
@@ -10,2 +10,4 @@ "use strict"; | ||
next() { | ||
if (!this.iterators.length) | ||
return { done: true, value: undefined }; | ||
const next = this.iterators[0].next(); | ||
@@ -12,0 +14,0 @@ if (!next.done) |
{ | ||
"name": "iteragain", | ||
"version": "0.9.1", | ||
"version": "0.9.2", | ||
"description": "Javascript ES6 Iterable/Iterator utilities.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -16,4 +16,6 @@ import ExtendedIterator from './ExtendedIterator'; | ||
includes(n: number): boolean; | ||
/** Returns the number at `index` in this range. */ | ||
/** Returns the number at `index` in this range. `index` can be negative to access indices starting from the end. */ | ||
nth(index: number): number; | ||
/** Returns the index that this number is at in this range. */ | ||
index(number: number): number; | ||
/** Returns true if this range is equal to another. */ | ||
@@ -20,0 +22,0 @@ equal(other: Range): boolean; |
@@ -34,3 +34,3 @@ "use strict"; | ||
} | ||
/** Returns the number at `index` in this range. */ | ||
/** Returns the number at `index` in this range. `index` can be negative to access indices starting from the end. */ | ||
nth(index) { | ||
@@ -40,2 +40,6 @@ const num = index >= 0 ? this.start + index * this.step : this.stop + index * this.step; | ||
} | ||
/** Returns the index that this number is at in this range. */ | ||
index(number) { | ||
return (number - this.start) / this.step; | ||
} | ||
/** Returns true if this range is equal to another. */ | ||
@@ -42,0 +46,0 @@ equal(other) { |
43928
54
883