export class InMemoryStorage implements Storage { readonly length : number ; [ key ] : { } ; [ index ] : string ; constructor ( private store = new Map < string , string > ( ) ) { } clear ( ) { throw new Error ( 'InMemoryStorage.clear not implemented' ) ; } getItem ( key ) { return this . store . get ( key ) || null ; } key ( index ) { throw new Error ( 'InMemoryStorage.key not implemented' ) ; } removeItem ( key ) { this . store . delete ( key ) ; } setItem ( key , data ) { this . store . set ( key , data ) ; } }