@adviser/cement - v0.0.0
    Preparing search index...

    Type Alias ResultOnce<R>

    ResultOnce: R extends Promise<unknown> ? Promise<Awaited<R>> : R

    Type helper that awaits Promise types and passes through non-Promise types. This ensures that if a function returns a Promise, the once method also returns Promise, and if the function returns T (non-Promise), once returns T directly.

    Uses the built-in Awaited utility type to properly handle nested Promises and thenable objects.

    Type Parameters

    • R

      The type to process

    type A = ResultOnce<Promise<number>>; // Promise<number>
    type B = ResultOnce<string>; // string
    type C = ResultOnce<number>; // number
    type D = ResultOnce<Promise<Promise<number>>>; // Promise<number>