Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Skipped
25 lines
631 B
Plaintext
25 lines
631 B
Plaintext
/**
|
|
* Check if the value is an Error object
|
|
*
|
|
* 校验是否是错误对象
|
|
*
|
|
* @example
|
|
* ```js
|
|
* import { isError } from 'is-what-type';
|
|
*
|
|
* isError(new Error()); // true
|
|
* isError(new TypeError()); // true
|
|
* isError({}); // false
|
|
* isError({ name: 'CustomError' }); // true
|
|
* isError({ name: 'NotAnError' }); // false
|
|
* isError(null); // false
|
|
* isError(undefined); // false
|
|
* isError('string'); // false
|
|
* isError(123); // false
|
|
* ```
|
|
*
|
|
* @param value - The value to check
|
|
* @returns `true` if the value is an Error object, else `false`
|
|
*/
|
|
export declare function isError(value: unknown): value is Error;
|