@agoric/assert
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -6,2 +6,15 @@ # Change Log | ||
## [0.2.3](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.2.2...@agoric/assert@0.2.3) (2021-03-16) | ||
### Bug Fixes | ||
* make separate 'test:xs' target, remove XS from 'test' target ([b9c1a69](https://github.com/Agoric/agoric-sdk/commit/b9c1a6987093fc8e09e8aba7acd2a1618413bac8)), closes [#2647](https://github.com/Agoric/agoric-sdk/issues/2647) | ||
* properly type assert.typeof(xxx, 'object') ([4958636](https://github.com/Agoric/agoric-sdk/commit/49586365607175fd9f91896a66cf02ad14d93055)) | ||
* upgrade ses to 0.12.3 to avoid console noise ([#2552](https://github.com/Agoric/agoric-sdk/issues/2552)) ([f59f5f5](https://github.com/Agoric/agoric-sdk/commit/f59f5f58d1567bb11710166b1dbc80f25c39a04f)) | ||
## [0.2.2](https://github.com/Agoric/agoric-sdk/compare/@agoric/assert@0.2.1...@agoric/assert@0.2.2) (2021-02-22) | ||
@@ -8,0 +21,0 @@ |
{ | ||
"name": "@agoric/assert", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Assert expression support that protects sensitive data", | ||
@@ -16,2 +16,3 @@ "parsers": { | ||
"test:nyc": "exit 0", | ||
"test:xs": "exit 0", | ||
"lint-fix": "yarn lint --fix", | ||
@@ -21,5 +22,3 @@ "lint-check": "yarn lint", | ||
"lint:eslint": "eslint '**/*.js'", | ||
"lint:types": "tsc -p jsconfig.json", | ||
"lint-fix-jessie": "eslint -c '.eslintrc-jessie.js' --fix '**/*.js'", | ||
"lint-check-jessie": "eslint -c '.eslintrc-jessie.js' '**/*.js'" | ||
"lint:types": "tsc -p jsconfig.json" | ||
}, | ||
@@ -41,3 +40,3 @@ "repository": { | ||
"devDependencies": { | ||
"@agoric/install-ses": "^0.5.2", | ||
"@agoric/install-ses": "^0.5.3", | ||
"ava": "^3.12.1", | ||
@@ -75,5 +74,5 @@ "esm": "^3.2.25", | ||
"dependencies": { | ||
"ses": "^0.12.2" | ||
"ses": "^0.12.3" | ||
}, | ||
"gitHead": "d9b77a4d36fe99c963e86733b90d878231201422" | ||
"gitHead": "5ad5f483f05ba20d903b4423bfb4fa0d2ce75fd7" | ||
} |
@@ -0,1 +1,2 @@ | ||
/* global globalThis */ | ||
// Copyright (C) 2019 Agoric, under Apache License 2.0 | ||
@@ -34,2 +35,3 @@ // @ts-check | ||
'quote', | ||
'makeAssert', | ||
].filter(name => globalAssert[name] === undefined); | ||
@@ -44,3 +46,3 @@ if (missing.length > 0) { | ||
const { details, quote } = globalAssert; | ||
const { details, quote, makeAssert } = globalAssert; | ||
@@ -51,2 +53,4 @@ export { globalAssert as assert, details, quote }; | ||
export { makeAssert }; | ||
/** | ||
@@ -53,0 +57,0 @@ * Prepend the correct indefinite article onto a noun, typically a typeof result |
@@ -1,2 +0,2 @@ | ||
/* eslint-disable jsdoc/require-returns-check,jsdoc/valid-types */ | ||
// @ts-check | ||
// eslint-disable-next-line spaced-comment | ||
@@ -21,2 +21,14 @@ /// <reference types="ses"/> | ||
/** | ||
* @callback AssertMakeError | ||
* | ||
* The `assert.error` method, recording details for the console. | ||
* | ||
* The optional `optDetails` can be a string. | ||
* @param {Details=} optDetails The details of what was asserted | ||
* @param {ErrorConstructor=} ErrorConstructor An optional alternate error | ||
* constructor to use. | ||
* @returns {Error} | ||
*/ | ||
/** | ||
* @callback AssertFail | ||
@@ -82,3 +94,3 @@ * | ||
* @param {Details=} optDetails | ||
* @returns {asserts specimen is object} | ||
* @returns {asserts specimen is Record<any, any> | null} | ||
* | ||
@@ -174,2 +186,3 @@ * @callback AssertTypeofString | ||
* ``` | ||
* | ||
* The normal convention is to locally rename `details` to `X` and import `q` | ||
@@ -195,2 +208,35 @@ * and `assert` unmodified. | ||
/** | ||
* @callback Raise | ||
* | ||
* To make an `assert` which terminates some larger unit of computation | ||
* like a transaction, vat, or process, call `makeAssert` with a `Raise` | ||
* callback, where that callback actually performs that larger termination. | ||
* If possible, the callback should also report its `reason` parameter as | ||
* the alleged reason for the termination. | ||
* | ||
* @param {Error} reason | ||
*/ | ||
/** | ||
* @callback MakeAssert | ||
* | ||
* Makes and returns an `assert` function object that shares the bookkeeping | ||
* state defined by this module with other `assert` function objects made by | ||
* `makeAssert`. This state is per-module-instance and is exposed by the | ||
* `loggedErrorHandler` above. We refer to `assert` as a "function object" | ||
* because it can be called directly as a function, but also has methods that | ||
* can be called. | ||
* | ||
* If `optRaise` is provided, the returned `assert` function object will call | ||
* `optRaise(reason)` before throwing the error. This enables `optRaise` to | ||
* engage in even more violent termination behavior, like terminating the vat, | ||
* that prevents execution from reaching the following throw. However, if | ||
* `optRaise` returns normally, which would be unusual, the throw following | ||
* `optRaise(reason)` would still happen. | ||
* | ||
* @param {Raise=} optRaise | ||
* @returns {Assert} | ||
*/ | ||
/** | ||
* @typedef {(template: TemplateStringsArray | string[], ...args: any) => DetailsToken} DetailsTag | ||
@@ -237,2 +283,3 @@ * | ||
* typeof: AssertTypeof, | ||
* error: AssertMakeError, | ||
* fail: AssertFail, | ||
@@ -243,4 +290,5 @@ * equal: AssertEqual, | ||
* details: DetailsTag, | ||
* quote: AssertQuote | ||
* quote: AssertQuote, | ||
* makeAssert: MakeAssert, | ||
* } } 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
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
20209
328
Updatedses@^0.12.3