fix(marshal)!: assertPure wrong but unused
MODIFY
packages/marshal/src/typeGuards.js
packages/marshal/src/typeGuards.js
// @ts-check
-import { isObject } from './helpers/passStyle-helpers.js';
import { passStyleOf } from './passStyleOf.js';
/** @typedef {import('./types.js').Passable} Passable */
@@ -99,26 +98,6 @@ const assertRemotable = (
};
harden(assertRemotable);
-const assertPure = (pureData, optNameOfData = 'Allegedly pure data') => {
- const passStyle = passStyleOf(pureData);
- switch (passStyle) {
- case 'copyArray':
- case 'copyRecord':
- case 'tagged': {
- return true;
- }
- default: {
- if (!isObject(pureData)) {
- return true;
- }
- assert.fail(
- X`${q(optNameOfData)} ${pureData} must be pure, not a ${q(passStyle)}`,
- );
- }
- }
-};
-harden(assertPure);
-
export {
assertRecord,
assertCopyArray,
@@ -126,5 +105,4 @@ export {
isRemotable,
isRecord,
isCopyArray,
- assertPure,
};

fix(marshal)!: assertPure wrong but unused (#1242)