{"version":3,"file":"MemoryStorage.js","sources":["../../src/cache/MemoryStorage.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IWindowStorage } from \"./IWindowStorage\";\n\nexport class MemoryStorage implements IWindowStorage {\n\n private cache: Map;\n\n constructor() {\n this.cache = new Map();\n }\n\n getItem(key: string): T | null {\n return this.cache.get(key) || null;\n }\n\n setItem(key: string, value: T): void {\n this.cache.set(key, value);\n }\n\n removeItem(key: string): void {\n this.cache.delete(key);\n }\n\n getKeys(): string[] {\n const cacheKeys: string[] = [];\n this.cache.forEach((value: T, key: string) => {\n cacheKeys.push(key);\n });\n return cacheKeys;\n }\n\n containsKey(key: string): boolean {\n return this.cache.has(key);\n }\n\n clear() :void {\n this.cache.clear();\n }\n}\n"],"names":[],"mappings":";;AAAA;;;;;IAWI;QACI,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAAa,CAAC;KACrC;IAED,+BAAO,GAAP,UAAQ,GAAW;QACf,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC;KACtC;IAED,+BAAO,GAAP,UAAQ,GAAW,EAAE,KAAQ;QACzB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KAC9B;IAED,kCAAU,GAAV,UAAW,GAAW;QAClB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;KAC1B;IAED,+BAAO,GAAP;QACI,IAAM,SAAS,GAAa,EAAE,CAAC;QAC/B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAC,KAAQ,EAAE,GAAW;YACrC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACvB,CAAC,CAAC;QACH,OAAO,SAAS,CAAC;KACpB;IAED,mCAAW,GAAX,UAAY,GAAW;QACnB,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;KAC9B;IAED,6BAAK,GAAL;QACI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;KACtB;IACL,oBAAC;AAAD,CAAC;;;;"}