Comparing version 4.0.5 to 4.0.6
{ | ||
"name": "avow", | ||
"version": "4.0.5", | ||
"description": "DEPRECATED: Use @invisible/assert", | ||
"version": "4.0.6", | ||
"description": "Proxy for assert that accepts custom Errors", | ||
"engines": { | ||
"node": ">=6.4.0" | ||
}, | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "ava test", | ||
"test-watch": "ava -w test" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/invisible-tech/assert.git" | ||
"url": "git+https://github.com/invisible-tech/avow.git" | ||
}, | ||
@@ -17,5 +24,12 @@ "keywords": [ | ||
"bugs": { | ||
"url": "https://github.com/invisible-tech/assert/issues" | ||
"url": "https://github.com/invisible-tech/avow/issues" | ||
}, | ||
"homepage": "https://github.com/invisible-tech/assert#readme" | ||
"homepage": "https://github.com/invisible-tech/avow#readme", | ||
"devDependencies": { | ||
"ava": "^0.22.0", | ||
"eslint": "^3.18.0" | ||
}, | ||
"dependencies": { | ||
"parse-function": "^5.0.7" | ||
} | ||
} |
# avow | ||
Proxy for `assert` that throws Custom Errors. | ||
Assertion library to allow one to throw custom errors. | ||
## DEPRECATED: Use [@invisible/assert](https://www.npmjs.com/package/@invisible/assert) | ||
`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. |
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
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
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
117940
6
39
0
51
0
1
2
+ Addedparse-function@^5.0.7
+ Added@babel/helper-string-parser@7.25.9(transitive)
+ Added@babel/helper-validator-identifier@7.25.9(transitive)
+ Added@babel/parser@7.26.3(transitive)
+ Added@babel/types@7.26.3(transitive)
+ Addedarrify@2.0.1(transitive)
+ Addedparse-function@5.6.10(transitive)