UNPKG

@unilogin/sdk

Version:

SDK is a JS library, that communicates with relayer. SDK allows managing contract, by creating basic contract-calling messages.

27 lines 946 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var sanitizers_1 = require("@restless/sanitizers"); var StorageEntry = /** @class */ (function () { function StorageEntry(key, sanitizer, storageService) { this.key = key; this.sanitizer = sanitizer; this.storageService = storageService; } StorageEntry.prototype.get = function () { var json = this.storageService.get(this.key); if (!json) { return null; } var parsed = JSON.parse(json); return sanitizers_1.cast(parsed, this.sanitizer); }; StorageEntry.prototype.set = function (value) { this.storageService.set(this.key, JSON.stringify(value)); }; StorageEntry.prototype.remove = function () { this.storageService.remove(this.key); }; return StorageEntry; }()); exports.StorageEntry = StorageEntry; //# sourceMappingURL=StorageEntry.js.map