isError
Validates if the supplied input is an Error object.
Signature
isError(input: any): boolean
Parameters
| Name | Type | Optional | Description |
|---|---|---|---|
input | any | No | Input to validate. |
Return value
Returns true if the input is an Error object.
Example
import { isError } from "@tripetto/builder";
isError(new Error("Test message")); // Returns `true`