Evaluation
Evaluation API allows for evaluating value against expectation as boolean
- without throwing errors.
TypeScript API
Evaluates if provided value is instance of ≤T≥:
is
▸ is≤T≥(value
: any, isStrict
?: boolean): boolean
Evaluates if a value matches an expectation.
Parameters:
Name | Type | Description |
---|---|---|
value | any | Value that needs to evaluated. |
isStrict | boolean | Flag indicating that evaluation should be done in strict mode. |
Returns: boolean
Returns true
if evaluation is successful, else false
.
instanceOf
▸ instanceOf≤T≥(value
: any): boolean
Evaluates if provided value is an instance of a specific type or interface.
Parameters:
Name | Type | Description |
---|---|---|
value | any | Value that needs to evaluated. |
Returns: boolean
Returns true
if evaluation is successful, else false
.
JavaScript API
isInstanceOf
▸ isInstanceOf(value
: any, expectation
: Expectation | Utility, isStrict
?: boolean): boolean
Evaluates if provided value is an instance of a specific type or interface :
Parameters:
Name | Type | Description |
---|---|---|
value | any | Value that needs to evaluated. |
expectation | Expectation | Utility | Expectation as explicit Pattern instance, instance of Utility or implicit expectation against which value will be validated. |
Returns: boolean
Returns true
if evaluation is successful, else false
.