Skip to content

Commit

Permalink
fix: weaken typing
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Oct 26, 2023
1 parent 81768f2 commit 992248d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/exo/src/exo-tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ export const defendPrototype = (
...(symbolMethodGuards &&
fromEntries(getCopyMapEntries(symbolMethodGuards))),
});
assert(methodGuards !== undefined);
{
const methodGuardNames = ownKeys(methodGuards);
const unimplemented = listDifference(methodGuardNames, methodNames);
Expand Down
9 changes: 6 additions & 3 deletions packages/patterns/src/patterns/patternMatchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -1675,15 +1675,17 @@ const makePatternKit = () => {
),
split: (base, rest = undefined) => {
if (passStyleOf(harden(base)) === 'copyArray') {
// @ts-expect-error We know it should be an array
// TODO at-ts-expect-error works locally but not from @endo/exo
// @ts-ignore We know it should be an array
return M.splitArray(base, rest && [], rest);
} else {
return M.splitRecord(base, rest && {}, rest);
}
},
partial: (base, rest = undefined) => {
if (passStyleOf(harden(base)) === 'copyArray') {
// @ts-expect-error We know it should be an array
// TODO at-ts-expect-error works locally but not from @endo/exo
// @ts-ignore We know it should be an array
return M.splitArray([], base, rest);
} else {
return M.splitRecord({}, base, rest);
Expand Down Expand Up @@ -1928,7 +1930,8 @@ export const getInterfaceMethodKeys = interfaceGuard => {
const { methodGuards, symbolMethodGuards = emptyCopyMap } =
getInterfaceGuardPayload(interfaceGuard);
/** @type {(string | symbol)[]} */
// @ts-expect-error inference is too weak to see this is ok
// TODO at-ts-expect-error works locally but not from @endo/exo
// @ts-ignore inference is too weak to see this is ok
return harden([
...Reflect.ownKeys(methodGuards),
...getCopyMapKeys(symbolMethodGuards),
Expand Down

0 comments on commit 992248d

Please sign in to comment.