|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
465 bytes
|
| Line | |
|---|
| 1 | /**
|
|---|
| 2 | * Checks if `value` is an Error object.
|
|---|
| 3 | *
|
|---|
| 4 | * @param {unknown} value The value to check.
|
|---|
| 5 | * @returns {value is Error} Returns `true` if `value` is an Error object, `false` otherwise.
|
|---|
| 6 | *
|
|---|
| 7 | * @example
|
|---|
| 8 | * ```typescript
|
|---|
| 9 | * console.log(isError(new Error())); // true
|
|---|
| 10 | * console.log(isError('Error')); // false
|
|---|
| 11 | * console.log(isError({ name: 'Error', message: '' })); // false
|
|---|
| 12 | * ```
|
|---|
| 13 | */
|
|---|
| 14 | declare function isError(value: unknown): value is Error;
|
|---|
| 15 |
|
|---|
| 16 | export { isError };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.