isError es-toolkit
Checks if a value is an Error object.
Usage
isError(value)
Use isError when you want to check if a value is an Error object. It can be used as a type guard in TypeScript to narrow the value's type to Error. Particularly useful in try-catch blocks or API response processing.
When used as a type guard in TypeScript, the value's type is narrowed.
Parameters
valueunknownrequired
The value to check if it's an Error object.
Returns
Returns true if the value is an Error object, false otherwise.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.