import { BaseStorage } from './base' ; export class LocalStorage extends BaseStorage { get ( key ) { const value = localStorage . getItem ( this . key ( key ) ) ; if ( value !== null ) { return value ; } return null ; } set ( key , value ) { localStorage . setItem ( this . key ( key ) , value ) ; return value ; } delete ( key ) { const k = this . key ( key ) ; const value = this . get ( k ) ; if ( value ) { localStorage . removeItem ( k ) ; } return value ; } private key ( name ) { return `${ this . prefix }${ name }` ; } }