Hex Core JS
    Preparing search index...

    Function requiredScalarValidator

    • Returns a validator function to validate that a radio option has been selected if required.

      Note: empty strings and null count as missing a value (invalid if required), all other values are valid.

      Parameters

      • OptionalisRequired: boolean

        Indicates if the value is required.

      • OptionalerrorMessage: string

        A custom error message to display if the value is invalid.

      Returns (
          value: string | number | boolean | null,
      ) => ValidationResult.Success | ValidationResult.Failure