@agoric/marshal
Advanced tools
Comparing version 0.5.1-dev-bda9206.0 to 0.5.1-dev-bf29060.0
@@ -41,2 +41,2 @@ export { mapIterable, filterIterable } from './src/helpers/iter-helpers.js'; | ||
isCopyArray, | ||
} from './src/assertPassStyleOf.js'; | ||
} from './src/typeGuards.js'; |
{ | ||
"name": "@agoric/marshal", | ||
"version": "0.5.1-dev-bda9206.0+bda9206", | ||
"version": "0.5.1-dev-bf29060.0+bf29060", | ||
"description": "marshal", | ||
@@ -15,4 +15,2 @@ "type": "module", | ||
"test:xs": "exit 0", | ||
"pretty-fix": "prettier --write '**/*.js'", | ||
"pretty-check": "prettier --check '**/*.js'", | ||
"lint-fix": "yarn lint:eslint --fix && yarn lint:types", | ||
@@ -38,10 +36,9 @@ "lint-check": "yarn lint", | ||
"dependencies": { | ||
"@agoric/assert": "0.3.16-dev-bda9206.0+bda9206", | ||
"@agoric/eventual-send": "0.14.1-dev-bda9206.0+bda9206", | ||
"@agoric/eventual-send": "0.14.1-dev-bf29060.0+bf29060", | ||
"@agoric/nat": "^4.1.0", | ||
"@agoric/promise-kit": "0.2.30-dev-bda9206.0+bda9206" | ||
"@agoric/promise-kit": "0.2.30-dev-bf29060.0+bf29060" | ||
}, | ||
"devDependencies": { | ||
"@agoric/lockdown": "0.1.2-dev-bda9206.0+bda9206", | ||
"@endo/ses-ava": "^0.2.8", | ||
"@agoric/lockdown": "0.1.2-dev-bf29060.0+bf29060", | ||
"@endo/ses-ava": "^0.2.13", | ||
"ava": "^3.12.1", | ||
@@ -60,6 +57,2 @@ "c8": "^7.7.2" | ||
}, | ||
"prettier": { | ||
"trailingComma": "all", | ||
"singleQuote": true | ||
}, | ||
"publishConfig": { | ||
@@ -74,3 +67,3 @@ "access": "public" | ||
}, | ||
"gitHead": "bda920694c7ab573822415653335e258b9c21281" | ||
"gitHead": "bf290606171e44f2de4e2a358c16372f2af96471" | ||
} |
// @ts-check | ||
// eslint-disable-next-line spaced-comment | ||
/// <reference types="ses"/> | ||
@@ -5,0 +4,0 @@ |
/* eslint-disable no-use-before-define */ | ||
// @ts-check | ||
// eslint-disable-next-line spaced-comment | ||
/// <reference types="ses"/> | ||
import { assert, details as X } from '@agoric/assert'; | ||
import { E } from '@agoric/eventual-send'; | ||
@@ -17,2 +15,3 @@ import { isObject } from './helpers/passStyle-helpers.js'; | ||
const { ownKeys } = Reflect; | ||
const { details: X } = assert; | ||
@@ -19,0 +18,0 @@ const makeConverter = (mirrorConverter = undefined) => { |
// @ts-check | ||
// eslint-disable-next-line spaced-comment | ||
/// <reference types="ses"/> | ||
@@ -8,3 +7,2 @@ | ||
import './internal-types.js'; | ||
import '@agoric/assert/exported.js'; | ||
import { assertChecker, checkNormalProperty } from './passStyle-helpers.js'; | ||
@@ -11,0 +9,0 @@ |
// @ts-check | ||
// eslint-disable-next-line spaced-comment | ||
/// <reference types="ses"/> | ||
@@ -14,3 +13,2 @@ | ||
import './internal-types.js'; | ||
import '@agoric/assert/exported.js'; | ||
@@ -17,0 +15,0 @@ const { details: X } = assert; |
// @ts-check | ||
// eslint-disable-next-line spaced-comment | ||
/// <reference types="ses"/> | ||
@@ -8,3 +7,2 @@ | ||
import './internal-types.js'; | ||
import '@agoric/assert/exported.js'; | ||
import { assertChecker } from './passStyle-helpers.js'; | ||
@@ -58,3 +56,3 @@ | ||
const proto = getPrototypeOf(candidate); | ||
const { name } = candidate; | ||
const { name } = proto; | ||
const EC = getErrorConstructor(name); | ||
@@ -69,2 +67,3 @@ if (!EC || EC.prototype !== proto) { | ||
const { | ||
// Must allow `cause`, `errors` | ||
message: mDesc, | ||
@@ -71,0 +70,0 @@ // Allow but ignore only extraneous own `stack` property. |
// @ts-check | ||
// eslint-disable-next-line spaced-comment | ||
/// <reference path="../extra-types.d.ts" /> | ||
@@ -5,0 +4,0 @@ |
// @ts-check | ||
// eslint-disable-next-line spaced-comment | ||
/// <reference types="ses"/> | ||
@@ -8,3 +7,2 @@ | ||
import './internal-types.js'; | ||
import '@agoric/assert/exported.js'; | ||
@@ -11,0 +9,0 @@ const { details: X, quote: q } = assert; |
// @ts-check | ||
// eslint-disable-next-line spaced-comment | ||
/// <reference types="ses"/> | ||
@@ -8,3 +7,2 @@ | ||
import './internal-types.js'; | ||
import '@agoric/assert/exported.js'; | ||
import { | ||
@@ -11,0 +9,0 @@ assertChecker, |
// @ts-check | ||
// eslint-disable-next-line spaced-comment | ||
/// <reference types="ses"/> | ||
@@ -15,3 +14,2 @@ | ||
import './internal-types.js'; | ||
import '@agoric/assert/exported.js'; | ||
@@ -18,0 +16,0 @@ const { details: X } = assert; |
// @ts-check | ||
// eslint-disable-next-line spaced-comment | ||
/// <reference types="ses"/> | ||
import { assert, details as X, q } from '@agoric/assert'; | ||
import { assertChecker, PASS_STYLE } from './helpers/passStyle-helpers.js'; | ||
@@ -15,2 +13,4 @@ import { | ||
const { quote: q, details: X } = assert; | ||
const { prototype: functionPrototype } = Function; | ||
@@ -17,0 +17,0 @@ const { |
// @ts-check | ||
// eslint-disable-next-line spaced-comment | ||
/// <reference types="ses"/> | ||
import { assert, details as X } from '@agoric/assert'; | ||
import { PASS_STYLE } from './helpers/passStyle-helpers.js'; | ||
@@ -11,2 +9,3 @@ import { assertPassable } from './passStyleOf.js'; | ||
const { create, prototype: objectPrototype } = Object; | ||
const { details: X } = assert; | ||
@@ -13,0 +12,0 @@ export const makeTagged = (tag, payload) => { |
// @ts-check | ||
// eslint-disable-next-line spaced-comment | ||
/// <reference types="ses"/> | ||
import { Nat } from '@agoric/nat'; | ||
import { assert, details as X, q } from '@agoric/assert'; | ||
import { QCLASS } from './marshal.js'; | ||
@@ -18,2 +16,3 @@ | ||
const { stringify: quote } = JSON; | ||
const { quote: q, details: X } = assert; | ||
@@ -20,0 +19,0 @@ /** |
// @ts-check | ||
/// <reference types="ses"/> | ||
import { assert, details as X } from '@agoric/assert'; | ||
import { makeMarshal } from './marshal.js'; | ||
@@ -8,2 +8,4 @@ | ||
const { details: X } = assert; | ||
/** @type {ConvertValToSlot<any>} */ | ||
@@ -10,0 +12,0 @@ const doNotConvertValToSlot = val => |
// @ts-check | ||
// eslint-disable-next-line spaced-comment | ||
/// <reference types="ses"/> | ||
import { Nat } from '@agoric/nat'; | ||
import { assert, details as X, q } from '@agoric/assert'; | ||
import { passStyleOf } from './passStyleOf.js'; | ||
@@ -24,2 +22,3 @@ | ||
const { getOwnPropertyDescriptors, defineProperties, is, fromEntries } = Object; | ||
const { details: X, quote: q } = assert; | ||
@@ -82,2 +81,3 @@ /** | ||
if (slotMap.has(val)) { | ||
// TODO assert that it's the same iface as before | ||
slotIndex = slotMap.get(val); | ||
@@ -94,2 +94,3 @@ assert.typeof(slotIndex, 'number'); | ||
// TODO explore removing this special case | ||
if (iface === undefined) { | ||
@@ -129,2 +130,4 @@ return harden({ | ||
marshalSaveError(err); | ||
// Must encode `cause`, `errors`. | ||
// nested non-passable errors must be ok from here. | ||
return harden({ | ||
@@ -286,2 +289,4 @@ [QCLASS]: 'error', | ||
} | ||
// TODO SECURITY HAZARD: must enfoce that remotable vs promise | ||
// is according to the encoded string. | ||
const slot = slots[Number(Nat(index))]; | ||
@@ -387,2 +392,3 @@ const val = convertSlotToVal(slot, iface); | ||
case 'error': { | ||
// Must decode `cause` and `errors` properties | ||
const { name, message, errorId } = rawTree; | ||
@@ -405,2 +411,6 @@ assert.typeof( | ||
: `Remote${EC.name}(${errorId})`; | ||
// Due to a defect in the SES type definition, the next line is | ||
// fails a type check. | ||
// Pending https://github.com/endojs/endo/issues/977 | ||
// @ts-ignore-next-line | ||
const error = assert.error(`${message}`, EC, { errorName }); | ||
@@ -407,0 +417,0 @@ return error; |
// @ts-check | ||
// eslint-disable-next-line spaced-comment | ||
/// <reference types="ses"/> | ||
@@ -5,0 +4,0 @@ |
// @ts-check | ||
import { assert, details as X, q } from '@agoric/assert'; | ||
import { getTag } from './helpers/passStyle-helpers.js'; | ||
@@ -9,2 +8,3 @@ import { makeTagged } from './makeTagged.js'; | ||
const { is } = Object; | ||
const { details: X, quote: q } = assert; | ||
@@ -11,0 +11,0 @@ /** |
// @ts-nocheck TODO Fix the recursive types to it checks. Will this | ||
// require a .d.ts file? I don't know. | ||
// eslint-disable-next-line spaced-comment | ||
/// <reference path="extra-types.d.ts" /> | ||
@@ -6,0 +5,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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
3
134674
2880