Function firstValue

  • Casts a given string value into a TS comprehensible type

    Usually a shorthand for Enum[findFirstKeyWithValue(Enum, 'foo')]

    Type Parameters

    • K

    • V

    Parameters

    • enumerator: Enumerator<K, V>

      The enum.

    • search: any

      The value to be searched within the enum's values.

    • comparator: ((search: V, enumValue: V) => boolean) = ...

      Function used to check the equality between search and the enum values. Default is a strict equality check (a === b).

        • (search: V, enumValue: V): boolean
        • Parameters

          • search: V
          • enumValue: V

          Returns boolean

    Returns V

Generated using TypeDoc