Type alias RefinePredicate<Value, RefinedValue, Param>

RefinePredicate<Value, RefinedValue, Param>: ((value, param, options) => value is RefinedValue)

Type Parameters

  • Value = any

    The value to refine.

  • RefinedValue extends Value = Value

    The refined value.

  • Param = any

    The additional param that was associated with the operation.

Type declaration

    • (value, param, options): value is RefinedValue
    • A narrowing predicate that refines the value type.

      If a ValidationError is thrown, its issues are captured and incorporated into a parsing result. Throw if refinement cannot be performed, and you want to abort the operation.

      Parameters

      • value: Value

        The value to refine.

      • param: Param

        The additional param that was associated with the operation.

      • options: ApplyOptions

        Parsing options.

      Returns value is RefinedValue

      true if value matches the predicate, or false otherwise.