import { resolve } from '../utils/resolve' ; import type { StorageEngine } from './StorageEngine' ; let cache = { } ; export const memory = { getItem ( key ) { return resolve ( ( ) => ( cache [ key ] === void 0 ? null : cache [ key ] ! ) ) ; } , setItem ( key , value ) { return resolve ( ( ) => { cache [ key ] = value ; } ) ; } , removeItem ( key ) { return resolve ( ( ) => { cache [ key ] = void 0 ; } ) ; } , clear ( ) { return resolve ( ( ) => { cache = { } ; } ) ; } , } ;