UNPKG

@e-group/utils

Version:

eGroup team utils that share across projects.

36 lines (26 loc) 513 B
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; class Cache { constructor() { _defineProperty(this, "cache", void 0); this.cache = new Map(); } get(key) { return this.cache.get(key); } set(key, value) { this.cache.set(key, value); } keys() { return Array.from(this.cache.keys()); } has(key) { return this.cache.has(key); } clear() { this.cache.clear(); } delete(key) { this.cache.delete(key); } } export default Cache;