@chickenjdk/byteutils
    Preparing search index...

    Function maybeAsyncCallArr

    • Call a function that may or may not return a promise for each set of parameters, if any of the calls return a promise, it will return a promise that resolves to an array of the results. If all calls return values directly, it will return an array of the results directly.

      Type Parameters

      • args extends unknown[]
      • ret

      Parameters

      • maybeAsyncFunc: (...args: args) => ret

        A function that may or may not return a promise

      • params: args[]

        The array of parameters to call the function with

      Returns ret extends Promise<unknown> ? Promise<AwaitedUnion<ret<ret>>[]> : ret[]

      The results of the calls, either as an array of values or a promise that resolves to an array of values. See main description.