diff --git a/packages/SwingSet/src/kernel/state/storageHelper.js b/packages/SwingSet/src/kernel/state/storageHelper.js index 835153c785e..86b2b0d4dfa 100644 --- a/packages/SwingSet/src/kernel/state/storageHelper.js +++ b/packages/SwingSet/src/kernel/state/storageHelper.js @@ -26,7 +26,10 @@ export function* enumeratePrefixedKeys(kvStore, prefix, exclusiveEnd) { } } -// NOTE: awkward naming: the thing that returns a stream of keys is named +/** + * @param {KVStore} kvStore + * @param {string} prefix + */ // NOTE: awkward naming: the thing that returns a stream of keys is named // "enumerate..." while the thing that returns a stream of values is named // "get..." function* enumerateNumericPrefixedKeys(kvStore, prefix) { @@ -43,12 +46,20 @@ function* enumerateNumericPrefixedKeys(kvStore, prefix) { } } +/** + * @param {KVStore} kvStore + * @param {string} prefix + */ export function* getPrefixedValues(kvStore, prefix) { for (const key of enumerateNumericPrefixedKeys(kvStore, prefix)) { yield kvStore.get(key) || Fail`enumerate ensures get`; } } +/** + * @param {KVStore} kvStore + * @param {string} prefix + */ export function deletePrefixedKeys(kvStore, prefix) { // this is kind of like a deleteRange() would be, but can be implemented // efficiently without backend DB support because it only looks at numeric