Skip to content

Commit

Permalink
chore(patterns): define Key using parameterized Passable
Browse files Browse the repository at this point in the history
chore(patterns): define Key using parameterized Passable
  • Loading branch information
dckc authored and turadg committed Jan 10, 2024
1 parent 5b8b349 commit 9aac68e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/patterns/src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export {};

/** @typedef {import('@endo/pass-style').Passable} Passable */
/** @typedef {import('@endo/pass-style').PassStyle} PassStyle */
/** @typedef {import('@endo/pass-style').RemotableObject} RemotableObject */
/**
* @template {string} [Tag=string]
* @template {Passable} [Payload=Passable]
Expand All @@ -21,9 +22,8 @@ export {};
/** @typedef {import('@endo/marshal').RankCompare} RankCompare */
/** @typedef {import('@endo/marshal').RankCover} RankCover */

// FIXME exclude nested Error and Promise
/**
* @typedef {Exclude<Passable, Error | Promise>} Key
* @typedef {import('@endo/pass-style').Passable<RemotableObject, never>} Key
*
* Keys are Passable arbitrarily-nested pass-by-copy containers
* (CopyArray, CopyRecord, CopySet, CopyBag, CopyMap) in which every
Expand Down
1 change: 1 addition & 0 deletions packages/patterns/test/test-patterns.js
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ const runTests = (t, successCase, failCase) => {
t.throws(
() => {
copyMapComparison || Fail`No CopyMap comparison support`;
// @ts-expect-error FIXME Key types
successCase(specimen, M.gt(makeCopyMap([])));
},
{ message: 'No CopyMap comparison support' },
Expand Down

0 comments on commit 9aac68e

Please sign in to comment.