Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xotic750/is-error-x
Detect whether a value is an error object.
https://github.com/xotic750/is-error-x
browser ecmascript error nodejs
Last synced: 2 months ago
JSON representation
Detect whether a value is an error object.
- Host: GitHub
- URL: https://github.com/xotic750/is-error-x
- Owner: Xotic750
- License: mit
- Created: 2015-12-12T12:37:06.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-07-04T13:07:56.000Z (over 1 year ago)
- Last Synced: 2024-11-07T13:55:23.426Z (3 months ago)
- Topics: browser, ecmascript, error, nodejs
- Language: JavaScript
- Homepage:
- Size: 3.59 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## is-error-x
Detect whether a value is an error.
### `module.exports(value)` ⇒
boolean
⏏Determine whether or not a given `value` is an `Error` type.
**Kind**: Exported function
**Returns**:boolean
- Returns `true` if `value` is an `Error` type,
else `false`.| Param | Type | Description |
| ----- | --------------- | ------------------------ |
| value |\*
| The object to be tested. |**Example**
```js
import isError from 'is-error-x';console.log(isError()); // false
console.log(isError(Number.MIN_VALUE)); // false
console.log(isError('abc')); // false
console.log(isError(new Error())); //true
```