QMetaRam / node_modules /@supabase /auth-js /src /lib /local-storage.ts
metarm's picture
Upload folder using huggingface_hub (part 11)
96c8713 verified
Raw History Blame Contribute Delete
440 Bytes
import { SupportedStorage } from './types'
/**
* Returns a localStorage-like object that stores the key-value pairs in
* memory.
*/
export function memoryLocalStorageAdapter(store: { [key: string]: string } = {}): SupportedStorage {
return {
getItem: (key) => {
return store[key] || null
},
setItem: (key, value) => {
store[key] = value
},
removeItem: (key) => {
delete store[key]
},
}
}