export default class Stoarge { storage : any ; constructor ( ) { try { this . storage = localStorage ; const testKey = '__inspirecloud_test_js__' ; this . storage . setItem ( testKey , testKey ) ; if ( this . storage . getItem ( testKey ) !== testKey ) { throw new Error ( ) ; } this . storage . removeItem ( testKey ) ; } catch ( error ) { this . storage = require ( 'localstorage-memory' ) ; } } public setItem ( key , value ) { this . storage . setItem ( key , value ) ; } public getItem ( key ) { return this . storage . getItem ( key ) ; } }