Comparing version 4.0.3 to 4.0.4
{ | ||
"name": "avow", | ||
"version": "4.0.3", | ||
"description": "Proxy for assert that accepts custom Errors", | ||
"engines": { | ||
"node": ">=6.4.0" | ||
}, | ||
"version": "4.0.4", | ||
"description": "DEPRECATED: Use @invisible/assert", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "ava test", | ||
"test-watch": "ava -w test" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/invisible-tech/avow.git" | ||
"url": "git+https://github.com/invisible-tech/assert.git" | ||
}, | ||
@@ -24,12 +17,5 @@ "keywords": [ | ||
"bugs": { | ||
"url": "https://github.com/invisible-tech/avow/issues" | ||
"url": "https://github.com/invisible-tech/assert/issues" | ||
}, | ||
"homepage": "https://github.com/invisible-tech/avow#readme", | ||
"devDependencies": { | ||
"ava": "^0.22.0", | ||
"eslint": "^3.18.0" | ||
}, | ||
"dependencies": { | ||
"parse-function": "^5.0.7" | ||
} | ||
"homepage": "https://github.com/invisible-tech/assert#readme" | ||
} |
# avow | ||
Assertion library to allow one to throw custom errors. | ||
Proxy for `assert` that throws Custom Errors. | ||
`avow` uses ES2015 Proxies to intercept calls to `assert`. | ||
All methods of `assert` are available, and it is compatible with both | ||
`Node.js`'s standard assertion library and the one on `npm`. | ||
## Motivation | ||
To allow `assert` to throw custom errors. | ||
## Example | ||
### `assert` encapsulates Custom Errors under an AssertionError, which sucks | ||
```js | ||
const assert = require('assert') | ||
assert(false, Error('yohoo') | ||
{ AssertionError: Error: yohoo | ||
at Object.<anonymous> (/tmp/a/index.js:2:1) | ||
name: 'AssertionError', | ||
actual: false, | ||
expected: true, | ||
operator: '==', | ||
message: | ||
Error: yohoo | ||
at Object.<anonymous> (/tmp/a/index.js:2:15) | ||
generatedMessage: false } | ||
``` | ||
_Stack-trace trimmed for readability._ | ||
### `avow` throws Custom Errors properly, which is nice | ||
```js | ||
const avow = require('avow') | ||
avow(false, Error('yohoo')) | ||
Error: yohoo | ||
at Object.<anonymous> (/tmp/a/index.js:2:16) | ||
``` | ||
_Stack-trace trimmed for readability._ | ||
## Installation | ||
Make sure `assert` is installed. | ||
The `npm` library `assert` is not a `dependency` in `package.json` in order to | ||
allow one to use `Node.js`'s standard `assert` library. | ||
## DEPRECATED: Use [@invisible/assert}(https://www.npmjs.com/package/@invisible/assert) |
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
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
0
0
630
3
0
6
- Removedparse-function@^5.0.7
- Removed@babel/helper-string-parser@7.25.9(transitive)
- Removed@babel/helper-validator-identifier@7.25.9(transitive)
- Removed@babel/parser@7.26.2(transitive)
- Removed@babel/types@7.26.0(transitive)
- Removedarrify@2.0.1(transitive)
- Removedparse-function@5.6.10(transitive)