Function asEnum

Parse an attribute as a multi-state value (for examnple: true, false, mixed), defaulting to the first valid option

0.9.0

  • Parameters

    • valid: [string, ...string[]]

      array of valid values

    Returns (value: null | string) => string

    • parser function