rc-js-util
Version:
A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.
12 lines • 321 B
text/typescript
/**
* @public
* Iterate over an iterator until it's done, discarding the results.
*/
export function iteratorConsumeAll(iterator: IterableIterator<unknown>): void
{
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
while (!iterator.next().done)
{
// no action needed
}
}