Function resolveDocuments

Resolves the documents from an async generator and returns them as a flattened array.

  • Type Parameters

    • T extends unknown

    Parameters

    • iterator: AsyncGenerator<T | T[], void, unknown>

      The async generator to resolve documents from.

    Returns Promise<T[]>

    • A promise that resolves to the flattened array of documents.