diff --git a/packages/daemon/src/daemon.js b/packages/daemon/src/daemon.js index 1d0013e6fd..7c03636556 100644 --- a/packages/daemon/src/daemon.js +++ b/packages/daemon/src/daemon.js @@ -384,7 +384,8 @@ const makeEndoBootstrap = ( formulaIdentifier, terminator, ) => { - const { type: formulaType, number: formulaNumber } = parseFormulaIdentifier(formulaIdentifier); + const { type: formulaType, number: formulaNumber } = + parseFormulaIdentifier(formulaIdentifier); if (formulaIdentifier === 'pet-store') { const external = petStorePowers.makeOwnPetStore( 'pet-store', diff --git a/packages/daemon/src/formula-identifier.js b/packages/daemon/src/formula-identifier.js index 706b04bf94..4baaef6410 100644 --- a/packages/daemon/src/formula-identifier.js +++ b/packages/daemon/src/formula-identifier.js @@ -26,4 +26,4 @@ export const parseFormulaIdentifier = formulaIdentifier => { const type = formulaIdentifier.slice(0, delimiterIndex); const number = formulaIdentifier.slice(delimiterIndex + 1); return { type, number }; -} +}; diff --git a/packages/daemon/src/guest.js b/packages/daemon/src/guest.js index c4bb93e970..3ec17b4804 100644 --- a/packages/daemon/src/guest.js +++ b/packages/daemon/src/guest.js @@ -69,7 +69,13 @@ export const makeGuestMaker = ({ terminator, }); - const { has, list, follow: followNames, listEntries, followEntries } = petStore; + const { + has, + list, + follow: followNames, + listEntries, + followEntries, + } = petStore; /** @type {import('@endo/eventual-send').ERef} */ const guest = Far('EndoGuest', { diff --git a/packages/daemon/src/host.js b/packages/daemon/src/host.js index dec3a9847d..0b72dfbf1a 100644 --- a/packages/daemon/src/host.js +++ b/packages/daemon/src/host.js @@ -417,7 +417,13 @@ export const makeHostMaker = ({ return value; }; - const { has, list, follow: followNames, listEntries, followEntries } = petStore; + const { + has, + list, + follow: followNames, + listEntries, + followEntries, + } = petStore; /** @type {import('./types.js').EndoHost} */ const host = Far('EndoHost', { diff --git a/packages/daemon/src/pet-store.js b/packages/daemon/src/pet-store.js index 8e60a9f608..69caea4860 100644 --- a/packages/daemon/src/pet-store.js +++ b/packages/daemon/src/pet-store.js @@ -106,7 +106,10 @@ export const makePetStoreMaker = (filePowers, locator) => { const petNameText = `${formulaIdentifier}\n`; await filePowers.writeFileText(petNamePath, petNameText); const formularIdentifierPair = parseFormulaIdentifier(formulaIdentifier); - changesTopic.publisher.next({ add: petName, value: formularIdentifierPair }); + changesTopic.publisher.next({ + add: petName, + value: formularIdentifierPair, + }); }; /** @@ -116,9 +119,7 @@ export const makePetStoreMaker = (filePowers, locator) => { const formulaIdentifierPairForPetname = petName => { const formulaIdentifier = petNames.get(petName); if (formulaIdentifier === undefined) { - throw new Error( - `Formula does not exist for pet name ${q(petName)}`, - ); + throw new Error(`Formula does not exist for pet name ${q(petName)}`); } const { type, number } = parseFormulaIdentifier(formulaIdentifier); return { @@ -135,7 +136,8 @@ export const makePetStoreMaker = (filePowers, locator) => { (async function* currentAndSubsequentNames() { const changes = changesTopic.subscribe(); for (const name of [...petNames.keys()].sort()) { - const formularIdentifierPair = formulaIdentifierPairForPetname(name); + const formularIdentifierPair = + formulaIdentifierPairForPetname(name); yield { add: name, value: formularIdentifierPair, @@ -147,13 +149,12 @@ export const makePetStoreMaker = (filePowers, locator) => { // Returns in Object.fromEntries format. /** @returns {Array<[string, import('./types.js').FormulaIdentifierPair]>} */ - const listEntries = () => harden( - [...petNames.keys()] - .sort() - .map(name => { - return [name, formulaIdentifierPairForPetname(name)] + const listEntries = () => + harden( + [...petNames.keys()].sort().map(name => { + return [name, formulaIdentifierPairForPetname(name)]; }), - ); + ); // Provided as an alias for follow, with naming symmetry to listEntries. const followEntries = follow; diff --git a/packages/daemon/src/types.d.ts b/packages/daemon/src/types.d.ts index b170d6ebb1..cee7a25781 100644 --- a/packages/daemon/src/types.d.ts +++ b/packages/daemon/src/types.d.ts @@ -165,7 +165,11 @@ export interface PetStore { list(): Array; follow(): Promise>>; listEntries(): Array<[string, FormulaIdentifierPair]>; - followEntries(): Promise>>; + followEntries(): Promise< + FarRef< + String<{ add: string; value: FormulaIdentifierPair } | { remove: string }> + > + >; write(petName: string, formulaIdentifier: string): Promise; remove(petName: string); rename(fromPetName: string, toPetName: string);