is-error

Detect whether a value is an error

MIT 5 个版本
安装
npm install is-error
yarn add is-error
pnpm add is-error
bun add is-error
README

is-error

Detect whether a value is an error

Example

var isError = require("is-error");

console.log(isError(new Error('hi'))) // true
console.log(isError({ message: 'hi' })) // false

Docs

var bool = isError(maybeErr)

is-error := (maybeErr: Any) => Boolean

isError returns a boolean. it will detect whether the argument is an error or not.

Installation

npm install is-error

Tests

npm test

Contributors

  • Raynos

MIT Licensed

版本列表
2.2.2 2019-04-16
2.2.1 2016-10-21
2.2.0 2015-05-16
2.1.0 2015-05-10
2.0.0 2015-03-08