UNPKG

sinch-rtc

Version:

RTC JavaScript/Web SDK

22 lines 643 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.KeyValueStorage = void 0; class KeyValueStorage { constructor(storage, prefix) { this.storage = storage; this.prefix = prefix; } get(key) { const value = this.storage.getItem(this.prefix + key); if (value) return JSON.parse(value); } set(key, value) { this.storage.setItem(this.prefix + key, JSON.stringify(value)); } remove(key) { this.storage.removeItem(this.prefix + key); } } exports.KeyValueStorage = KeyValueStorage; //# sourceMappingURL=KeyValueStorage.js.map