🚀 Launch Week Day 3:Introducing Supply Chain Attack Campaigns Tracking.Learn More →
Socket
Book a DemoInstallSign in
Socket

is-error-constructor

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-error-constructor

Check if a value is an error constructor

Source
npmnpm
Version
2.1.0
Version published
Weekly downloads
939
1.84%
Maintainers
1
Weekly downloads
 
Created
Source

is-error-constructor Build Status

Check if a value is an error constructor

Install

$ npm install is-error-constructor

Usage

const isErrorConstructor = require('is-error-constructor');

isErrorConstructor(Error);
//=> true

isErrorConstructor(RangeError);
//=> true

function FakeError() {}
isErrorConstructor(FakeError);
//=> false

class UnicornError extends Error {}
isErrorConstructor(UnicornError);
//=> true

License

MIT © Sindre Sorhus

Keywords

is

FAQs

Package last updated on 05 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts