@chickenjdk/byteutils
    Preparing search index...

    Function maybePromiseThen

    • A function to help with processing values that may or may not be promises

      Type Parameters

      • maybePromise extends unknown

        The value that may or may not be a promise

      • returnType

      Parameters

      Returns maybePromise extends PromiseLike<unknown> ? Promise<returnType> : returnType

      Whet the callback returns, if the input is a promise, it will return a promise that resolves to the value returned by the callback. If the input is not a promise, it will return the value returned by the callback directly.