verdaccio-ui/src/utils/storage.ts

13 lines
244 B
TypeScript
Raw Normal View History

2019-02-03 17:23:33 +07:00
import memoryStorage from 'localstorage-memory';
let storage;
try {
localStorage.setItem('__TEST__', '');
localStorage.removeItem('__TEST__');
storage = localStorage;
} catch (err) {
storage = memoryStorage;
}
export default storage;