vault/ui/app/lib/memory-storage.ts
Vault Automation 0c6c13dd38
license: update headers to IBM Corp. (#10229) (#10233)
* license: update headers to IBM Corp.
* `make proto`
* update offset because source file changed

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-10-21 15:20:20 -06:00

26 lines
430 B
TypeScript

/**
* Copyright IBM Corp. 2016, 2025
* SPDX-License-Identifier: BUSL-1.1
*/
const cache: { [key: string]: string } = {};
export default {
getItem(key: string) {
const item = cache[key];
return item && JSON.parse(item);
},
setItem(key: string, val: unknown) {
cache[key] = JSON.stringify(val);
},
removeItem(key: string) {
delete cache[key];
},
keys() {
return Object.keys(cache);
},
};