JSPM

is-typeof-error

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 180
  • Score
    100M100P100Q73017F
  • License MIT

Check that given value is any type of error and instanceof Error

Package Exports

  • is-typeof-error

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (is-typeof-error) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

is-typeof-error npmjs.com The MIT License

Check that given value is any type of error and instanceof Error

code climate standard code style travis build status coverage status dependency status

Install

npm i is-typeof-error --save
npm test

Usage

For more use-cases see the tests

var isError = require('is-typeof-error')
var KindError = require('kind-error')
var PluginError = require('plugin-error')

var CustomClass = function () {}
CustomClass.prototype.foo = function () {}

isError(new TypeError('test')) //=> true
isError(new SyntaxError('test')) //=> true
isError(new SyntaxError('test')) //=> true
isError(new PluginError('test', 'msg')) //=> true
isError(new CustomClass('test')) //=> false
isError(new Object({a: 'b'})) //=> false
isError(new RegExp('test')) //=> false
isError(Object.create({a: 'b'})) //=> false
isError(/regex/) //=> false
isError({a: 'b'}) //=> false

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.

Charlike Make Reagent new message to charlike freenode #charlike

tunnckocore.tk keybase tunnckocore tunnckoCore npm tunnckoCore twitter tunnckoCore github