check-error
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -6,6 +6,2 @@ function isErrorInstance(obj) { | ||
function isErrorClass(obj) { | ||
return obj === Error || (typeof obj === 'function' && obj.name === 'Error'); | ||
} | ||
function isRegExp(obj) { | ||
@@ -54,3 +50,3 @@ // eslint-disable-next-line prefer-reflect | ||
return thrown.constructor === errorLike.constructor || thrown instanceof errorLike.constructor; | ||
} else if (isErrorClass(Object.getPrototypeOf(errorLike)) || isErrorClass(errorLike)) { | ||
} else if ((typeof errorLike === 'object' || typeof errorLike === 'function') && errorLike.prototype) { | ||
// If `errorLike` is a constructor that inherits from Error, we compare `thrown` to `errorLike` directly | ||
@@ -57,0 +53,0 @@ return thrown.constructor === errorLike || thrown instanceof errorLike; |
{ | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"name": "check-error", | ||
"description": "Error comparison and information related utility for node and the browser", | ||
"keywords": [ | ||
"check-error", | ||
"error", | ||
"chai util" | ||
], | ||
"keywords": ["check-error", "error", "chai util"], | ||
"license": "MIT", | ||
@@ -18,6 +14,3 @@ "author": "Jake Luer <jake@alogicalparadox.com> (http://alogicalparadox.com)", | ||
], | ||
"files": [ | ||
"index.js", | ||
"check-error.js" | ||
], | ||
"files": ["index.js", "check-error.js"], | ||
"type": "module", | ||
@@ -31,7 +24,5 @@ "main": "./index.js", | ||
"scripts": { | ||
"build": "rollup -c rollup.config.js", | ||
"lint": "eslint --ignore-path .gitignore index.js test/", | ||
"prepublish": "npm run build", | ||
"semantic-release": "semantic-release pre && npm publish && semantic-release post", | ||
"pretest": "npm run lint && npm run build", | ||
"pretest": "npm run lint", | ||
"test": "npm run test:node && npm run test:browser", | ||
@@ -47,5 +38,3 @@ "test:browser": "web-test-runner", | ||
"eslintConfig": { | ||
"extends": [ | ||
"strict/es6" | ||
], | ||
"extends": ["strict/es6"], | ||
"env": { | ||
@@ -65,4 +54,2 @@ "es6": true | ||
"devDependencies": { | ||
"@rollup/plugin-commonjs": "^21.0.0", | ||
"@rollup/plugin-node-resolve": "^13.0.5", | ||
"@web/test-runner": "^0.17.0", | ||
@@ -76,3 +63,2 @@ "browserify": "^13.0.0", | ||
"mocha": "^9.1.2", | ||
"rollup": "^2.58.0", | ||
"semantic-release": "^4.3.5", | ||
@@ -79,0 +65,0 @@ "simple-assert": "^2.0.0", |
<h1 align=center> | ||
<a href="http://chaijs.com" title="Chai Documentation"> | ||
<img alt="ChaiJS" src="http://chaijs.com/img/chai-logo.png"/> check-error | ||
<img alt="ChaiJS" src="http://chaijs.com/img/chai-logo.png"> | ||
</a> | ||
<br> | ||
check-error | ||
</h1> | ||
@@ -11,64 +13,2 @@ | ||
<p align=center> | ||
<a href="./LICENSE"> | ||
<img | ||
alt="license:mit" | ||
src="https://img.shields.io/badge/license-mit-green.svg?style=flat-square" | ||
/> | ||
</a> | ||
<a href="https://github.com/chaijs/check-error/releases"> | ||
<img | ||
alt="tag:?" | ||
src="https://img.shields.io/github/tag/chaijs/check-error.svg?style=flat-square" | ||
/> | ||
</a> | ||
![example workflow](https://github.com/chaijs/check-error/actions/workflows/nodejs.yml/badge.svg) | ||
<a href="https://coveralls.io/r/chaijs/check-error"> | ||
<img | ||
alt="coverage:?" | ||
src="https://img.shields.io/coveralls/chaijs/check-error/master.svg?style=flat-square" | ||
/> | ||
</a> | ||
<a href="https://www.npmjs.com/packages/check-error"> | ||
<img | ||
alt="npm:?" | ||
src="https://img.shields.io/npm/v/check-error.svg?style=flat-square" | ||
/> | ||
</a> | ||
<a href="https://www.npmjs.com/packages/check-error"> | ||
<img | ||
alt="dependencies:?" | ||
src="https://img.shields.io/npm/dm/check-error.svg?style=flat-square" | ||
/> | ||
</a> | ||
<a href=""> | ||
<img | ||
alt="devDependencies:?" | ||
src="https://img.shields.io/david/chaijs/check-error.svg?style=flat-square" | ||
/> | ||
</a> | ||
<br/> | ||
<a href="https://saucelabs.com/u/chaijs-check-error"> | ||
<img | ||
alt="Selenium Test Status" | ||
src="https://saucelabs.com/browser-matrix/chaijs-check-error.svg" | ||
/> | ||
</a> | ||
<br> | ||
<a href="https://chai-slack.herokuapp.com/"> | ||
<img | ||
alt="Join the Slack chat" | ||
src="https://img.shields.io/badge/slack-join%20chat-E2206F.svg?style=flat-square" | ||
/> | ||
</a> | ||
<a href="https://gitter.im/chaijs/chai"> | ||
<img | ||
alt="Join the Gitter chat" | ||
src="https://img.shields.io/badge/gitter-join%20chat-D0104D.svg?style=flat-square" | ||
/> | ||
</a> | ||
</p> | ||
## What is Check-Error? | ||
@@ -75,0 +15,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11
11383
119
145