Remove iteratorToArray
This commit is contained in:
parent
73a8e77d32
commit
bc2fbefb5c
3 changed files with 3 additions and 18 deletions
|
@ -45,17 +45,3 @@ export function arrayDiff<T>(a: T[], b: T[]): { added: T[], removed: T[] } {
|
|||
removed: a.filter(i => !b.includes(i)),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts an iterator to an array. Not recommended to be called with infinite
|
||||
* generator types.
|
||||
* @param i The iterator to convert.
|
||||
* @returns The array from the iterator.
|
||||
*/
|
||||
export function iteratorToArray<T>(i: Iterable<T>): T[] {
|
||||
const a: T[] = [];
|
||||
for (const e of i) {
|
||||
a.push(e);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue