import { SetStorage , GetStorage } from '@/data/protocols/cache' ; export class LocalStorageAdapter implements SetStorage , GetStorage { set ( key , value ) { if ( value ) { localStorage . setItem ( key , JSON . stringify ( value ) ) ; } else { localStorage . removeItem ( key ) ; } } get ( key ) { return JSON . parse ( localStorage . getItem ( key ) ) ; } }