UNPKG

asyncerator

Version:

Provide supporting types for AsyncIterable/AsyncIterableIterators, promisified stream.pipeline implementation, and Array-like utility operators, sources and sinks.

19 lines (15 loc) 424 B
// sink/to-null.ts /* * Copyright (c) 2021-2024 Check Digit, LLC * * This code is licensed under the MIT license (see LICENSE.txt for details). */ import asyncerator, { type Asyncable } from '../asyncerator'; /** * Drop the results of an asyncable into /dev/null. */ export default async function <T>(iterator: Asyncable<T>): Promise<void> { for await (const _ of asyncerator(iterator)) { // do nothing } }