Executes conditional branching based on the provided conditions and returns the appropriate value.

  • Type Parameters

    • A = Promise<Value>

      Type of the condition value.

    • T = Promise<Value>

      Type of the run value.

    • E = false

      Type of the not value.

    Parameters

    • params: {
          condition: A | (() => A);
          not?: E | (() => E);
          run: T | (() => T);
      }

      The parameters object.

      • condition: A | (() => A)

        The condition value or a function that returns the condition value.

      • Optionalnot?: E | (() => E)

        The not value or a function that returns the not value. Defaults to false.

      • run: T | (() => T)

        The run value or a function that returns the run value.

    Returns A | T | E

    • The result of executing the condition and returning the appropriate value.