Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ErrorPredicate

Hierarchy

  • Predicate<Error>
    • ErrorPredicate

Index

Constructors

constructor

constructor:

Accessors

evalError

  • get evalError(): this

not

  • get not(): this

rangeError

  • get rangeError(): this

referenceError

  • get referenceError(): this

syntaxError

  • get syntaxError(): this

typeError

  • get typeError(): this

uriError

  • get uriError(): this

Methods

Protected addValidator

hasKeys

instanceOf

is

  • Test if the value matches a custom validation function. The validation function should return true if the value passes the function. If the function either returns false or a string, the function fails and the string will be used as error message.

    Parameters

    • validator: (value: Error) => string | boolean

      Validation function.

        • (value: Error): string | boolean
        • Parameters

          • value: Error

          Returns string | boolean

    Returns ErrorPredicate

message

messageIncludes

name

validate

  • Test if the value matches a custom validation function. The validation function should return an object containing a validator and message. If the validator is false, the validation fails and the message will be used as error message. If the message is a function, the function is invoked with the label as argument to let you further customize the error message.

    Parameters

    • customValidator: CustomValidator<Error>

      Custom validation function.

    Returns ErrorPredicate