mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-22 15:11:07 +02:00
* adds api service * adds missing copyright headers * Update ui/app/services/api.ts Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com> * removes response cache and comments from api service * removes hide warnings condition from showWarnings middleware in api service * splits out setHeaders test --------- Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>
26 lines
429 B
TypeScript
26 lines
429 B
TypeScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* 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);
|
|
},
|
|
};
|