Validate an object is an instance of the expected type, or is a valid constructor object for the requested type
-
value
any The value for validation -
Type
any The type for instance of comparison -
message
string The message to be displayed if coercion fails -
Throws TypeError If the value is not coercable.
Returns any Instance of provided Type
Validate an array of objects are an instance of the expected type, or are a valid constructor object for the requested type
-
values
Array<any> The array of values for validation -
Type
any The type for instance of comparison -
message
string The message to be displayed if coercion fails -
Throws TypeError If values is not an array
-
Throws TypeError One of the array values is not coercable.
Returns Array<any> Array of instances of provided Type