Files
Handwerksfreund_Frontend/node_modules/@supabase/auth-js/src/lib/local-storage.ts
T
MarcWieland 8b613ec0bc Init
2026-07-26 23:57:23 +02:00

22 lines
440 B
TypeScript

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]
},
}
}