Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

Awesome Lists containing this project

README

        


Travis status


Dependency status


devDependency status


npm version


jsDelivr hits


bettercodehub score


Coverage Status

## 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
```