botbook/node_modules/@azure/msal-browser/dist/cache/MemoryStorage.mjs

37 lines
823 B
JavaScript
Raw Normal View History

2024-09-04 13:13:15 -03:00
/*! @azure/msal-browser v3.23.0 2024-09-03 */
'use strict';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
class MemoryStorage {
constructor() {
this.cache = new Map();
}
getItem(key) {
return this.cache.get(key) || null;
}
setItem(key, value) {
this.cache.set(key, value);
}
removeItem(key) {
this.cache.delete(key);
}
getKeys() {
const cacheKeys = [];
this.cache.forEach((value, key) => {
cacheKeys.push(key);
});
return cacheKeys;
}
containsKey(key) {
return this.cache.has(key);
}
clear() {
this.cache.clear();
}
}
export { MemoryStorage };
//# sourceMappingURL=MemoryStorage.mjs.map