From 2fef729969ad2fdfc9588375267a92b7daf8a441 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Sat, 10 Aug 2024 18:35:15 -0500 Subject: [PATCH] lean towards cuddled typedefs --- .../src/controller/upgradeSwingset.js | 4 +-- .../SwingSet/src/kernel/state/kernelKeeper.js | 4 +-- packages/SwingSet/src/types-external.js | 16 +++++----- packages/SwingSet/src/types-internal.js | 32 +++++++++---------- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/packages/SwingSet/src/controller/upgradeSwingset.js b/packages/SwingSet/src/controller/upgradeSwingset.js index f73e10a9933d..5de665342b7b 100644 --- a/packages/SwingSet/src/controller/upgradeSwingset.js +++ b/packages/SwingSet/src/controller/upgradeSwingset.js @@ -91,8 +91,8 @@ const upgradeVatV0toV1 = (kvStore, defaultReapDirtThreshold, vatID) => { * called during the upgrade, and it is responsible for doing a * `hostStorage.commit()` afterwards. * - * @param { SwingStoreKernelStorage } kernelStorage - * @returns { boolean } true if any changes were made + * @param {SwingStoreKernelStorage} kernelStorage + * @returns {boolean} true if any changes were made */ export const upgradeSwingset = kernelStorage => { const { kvStore } = kernelStorage; diff --git a/packages/SwingSet/src/kernel/state/kernelKeeper.js b/packages/SwingSet/src/kernel/state/kernelKeeper.js index 1ff4e782701c..d1e149c44bee 100644 --- a/packages/SwingSet/src/kernel/state/kernelKeeper.js +++ b/packages/SwingSet/src/kernel/state/kernelKeeper.js @@ -449,14 +449,14 @@ export default function makeKernelKeeper( /** * - * @returns { ReapDirtThreshold } + * @returns {ReapDirtThreshold} */ function getDefaultReapDirtThreshold() { return JSON.parse(getRequired(DEFAULT_REAP_DIRT_THRESHOLD_KEY)); } /** - * @param { ReapDirtThreshold } threshold + * @param {ReapDirtThreshold} threshold */ function setDefaultReapDirtThreshold(threshold) { assert.typeof(threshold, 'object'); diff --git a/packages/SwingSet/src/types-external.js b/packages/SwingSet/src/types-external.js index 4131733fb000..1f1805b2884e 100644 --- a/packages/SwingSet/src/types-external.js +++ b/packages/SwingSet/src/types-external.js @@ -28,14 +28,14 @@ export {}; */ /** - * @typedef { object } KernelOptions - * @property { ManagerType } [defaultManagerType] - * @property { number | 'never' } [defaultReapGCKrefs] - * @property { number | 'never' } [defaultReapInterval] - * @property { boolean } [relaxDurabilityRules] - * @property { number } [snapshotInitial] - * @property { number } [snapshotInterval] - * @property { boolean } [pinBootstrapRoot] + * @typedef {object} KernelOptions + * @property {ManagerType} [defaultManagerType] + * @property {number | 'never'} [defaultReapGCKrefs] + * @property {number | 'never'} [defaultReapInterval] + * @property {boolean} [relaxDurabilityRules] + * @property {number} [snapshotInitial] + * @property {number} [snapshotInterval] + * @property {boolean} [pinBootstrapRoot] */ /** diff --git a/packages/SwingSet/src/types-internal.js b/packages/SwingSet/src/types-internal.js index 6d63425efaae..102262e7db73 100644 --- a/packages/SwingSet/src/types-internal.js +++ b/packages/SwingSet/src/types-internal.js @@ -6,12 +6,12 @@ export {}; * internal type represents the modified form passed to * initializeKernel() and kernelKeeper.createStartingKernelState . * - * @typedef { object } InternalKernelOptions - * @property { ManagerType } [defaultManagerType] - * @property { ReapDirtThreshold } [defaultReapDirtThreshold] - * @property { boolean } [relaxDurabilityRules] - * @property { number } [snapshotInitial] - * @property { number } [snapshotInterval] + * @typedef {object} InternalKernelOptions + * @property {ManagerType} [defaultManagerType] + * @property {ReapDirtThreshold} [defaultReapDirtThreshold] + * @property {boolean} [relaxDurabilityRules] + * @property {number} [snapshotInitial] + * @property {number} [snapshotInterval] * * * The internal data that controls which worker we use (and how we use it) is @@ -55,7 +55,7 @@ export {}; * @property { boolean } enableDisavow * * @typedef ChangeVatOptions - * @property { number } [reapInterval] + * @property {number} [reapInterval] */ /** @@ -73,11 +73,11 @@ export {}; * which overrides the kernel-wide settings in * 'kernel.defaultReapDirtThreshold' * - * @typedef { object } ReapDirtThreshold - * @property { number | 'never' } [deliveries] - * @property { number | 'never' } [gcKrefs] - * @property { number | 'never' } [computrons] - * @property { boolean } [never] + * @typedef {object} ReapDirtThreshold + * @property {number | 'never'} [deliveries] + * @property {number | 'never'} [gcKrefs] + * @property {number | 'never'} [computrons] + * @property {boolean} [never] */ /** @@ -86,10 +86,10 @@ export {}; * start with {} and accumulate dirt as deliveries are made, until a * BOYD clears them. * - * @typedef { object } Dirt - * @property { number } [deliveries] - * @property { number } [gcKrefs] - * @property { number } [computrons] + * @typedef {object} Dirt + * @property {number} [deliveries] + * @property {number} [gcKrefs] + * @property {number} [computrons] */ /**