Rocky_Mountain_Vending/.pnpm-store/v10/files/e5/dc94acee7ed147aaa16b1ce6a581db08b0357db580856621e7069a9f39b2da4da4bc3ac804741a1cadb0a695a282c5486a7fa9a3b52c03eb068e4bf1eeb1cc
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

46 lines
992 B
Text

/**
* @license
* Copyright 2023 Google Inc.
* SPDX-License-Identifier: Apache-2.0
*/
import type {AwaitableIterable} from '../common/types.js';
/**
* @internal
*/
export class AsyncIterableUtil {
static async *map<T, U>(
iterable: AwaitableIterable<T>,
map: (item: T) => Promise<U>,
): AsyncIterable<U> {
for await (const value of iterable) {
yield await map(value);
}
}
static async *flatMap<T, U>(
iterable: AwaitableIterable<T>,
map: (item: T) => AwaitableIterable<U>,
): AsyncIterable<U> {
for await (const value of iterable) {
yield* map(value);
}
}
static async collect<T>(iterable: AwaitableIterable<T>): Promise<T[]> {
const result = [];
for await (const value of iterable) {
result.push(value);
}
return result;
}
static async first<T>(
iterable: AwaitableIterable<T>,
): Promise<T | undefined> {
for await (const value of iterable) {
return value;
}
return;
}
}