You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
Remove iteratorToArray
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user