MCPcopy Create free account
hub / github.com/microsoft/SandDance / getStorage

Function getStorage

docs/app/js/sanddance-app.js:58395–58405  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

58393var _defineProperty = require("@babel/runtime/helpers/esm/defineProperty");
58394var _definePropertyDefault = parcelHelpers.interopDefault(_defineProperty);
58395function getStorage(type) {
58396 try {
58397 const storage = window[type];
58398 const x = "__storage_test__";
58399 storage.setItem(x, x);
58400 storage.removeItem(x);
58401 return storage;
58402 } catch (e) {
58403 return null;
58404 }
58405}
58406class LocalStorage {
58407 constructor(id){
58408 let defaultSettings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

Callers 1

constructorMethod · 0.70

Calls 1

removeItemMethod · 0.80

Tested by

no test coverage detected