import { BaseStorage } from './base' ; export class MemoryStorage extends BaseStorage { private values : Record < string , string > = { } ; get ( key ) { const k = this . key ( key ) ; if ( k in this . values ) { return this . values [ k ] ! ; } return null ; } set ( key , value ) { this . values [ this . key ( key ) ] = value ; return value ; } delete ( key ) { const k = this . key ( key ) ; const value = this . get ( key ) ; if ( k in this . values ) { delete this . values [ k ] ; } return value ; } private key ( name ) { return `${ this . prefix }${ name }` ; } }