forked from sombochea/verdaccio-ui
13 lines
253 B
TypeScript
13 lines
253 B
TypeScript
import memoryStorage from 'localstorage-memory';
|
|
|
|
let storage: Storage;
|
|
try {
|
|
localStorage.setItem('__TEST__', '');
|
|
localStorage.removeItem('__TEST__');
|
|
storage = localStorage;
|
|
} catch (err) {
|
|
storage = memoryStorage;
|
|
}
|
|
|
|
export default storage;
|