@startpage/local-storage
Version:
Local storage management for your startpage
17 lines (16 loc) • 440 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseStorageItem = void 0;
const STORAGE = window.localStorage;
const parseStorageItem = (key) => {
const stringValue = STORAGE.getItem(key);
if (stringValue == null)
return null;
try {
return JSON.parse(stringValue);
}
catch {
return null;
}
};
exports.parseStorageItem = parseStorageItem;