Packages
A spellchecker for Elixir, made with Bun and cspell
Current section
Files
Jump to
Current section
Files
priv/bun/node_modules/@cspell/cspell-pipe/dist/helpers/toArray.js
import { isAsyncIterable } from './util.js';
export function toArray(i) {
return isAsyncIterable(i) ? toArrayAsync(i) : toArraySync(i);
}
export function toArraySync(iter) {
return [...iter];
}
export async function toArrayAsync(iter) {
const collection = [];
for await (const i of iter) {
collection.push(i);
}
return collection;
}
//# sourceMappingURL=toArray.js.map