UnrecognizedValidator
Hierarchy
PatternValidator
↳ UnrecognizedValidator
Implements
- PatternValidator
- PatternValidator
Index
Constructors
Properties
Methods
Constructors
constructor
+ new UnrecognizedValidator(isValid?
: boolean): UnrecognizedValidator
Creates an instance of UnrecognizedValidator. Creates an instance of UnrecognizedValidator.
Parameters:
Name | Type | Description |
---|---|---|
isValid? | boolean | Default behavior for unrecognized arguments. |
Returns: UnrecognizedValidator
Properties
Static
describer
▪ describer: Describer
Inherited from PatternValidator.describer
Overrides void
Methods
canValidate
▸ canValidate(expectation
: Expectation): boolean
Evaluates if validator can handle provided expectation.
Parameters:
Name | Type | Description |
---|---|---|
expectation | Expectation | Evaluated explicit Pattern instance or implicit expectation. |
Returns: boolean
Returns true
if pattern is instance of Unrecognized
, else false
.
describe
▸ describe(value
: any): string
Inherited from PatternValidator.describe
Overrides void
Parameters:
Name | Type |
---|---|
value | any |
Returns: string
getDefaultBehavior
▸ getDefaultBehavior(): boolean
Returns default behavior(result) that is returned upon validating unrecognized value.
Returns: boolean
Returns true
if default behavior is set to that behavior, else false
.
validate
▸ validate(value
: any, unrecognized
: Unrecognized): boolean
Validates if value matches pattern expectation(undefined).
throws
{UnknownError}
Thrown as default behavior of unrecognized arguments.
Parameters:
Name | Type | Description |
---|---|---|
value | any | Value that is validated against expectation. |
unrecognized | Unrecognized | Explicit pattern as Unrecognized instance. |
Returns: boolean
Returns the default behavior for validation of unrecognized arguments.
Static
getDescriber
▸ getDescriber(): Describer
Inherited from PatternValidator.getDescriber
Overrides void
Returns: Describer
Static
setDescriber
▸ setDescriber(describer
: Describer): void
Inherited from PatternValidator.setDescriber
Overrides void
Parameters:
Name | Type |
---|---|
describer | Describer |
Returns: void