Zipline-Android-App/functions/database.ts
2025-02-08 21:36:49 +01:00

25 lines
450 B
TypeScript

import * as SecureStore from "expo-secure-store";
export function set(key: string, value: string): void {
SecureStore.setItem(key, value);
}
export function get(key: string): string | null {
const result = SecureStore.getItem(key);
if (result) {
return result;
}
return null;
}
export async function del(key: string): Promise<boolean> {
try {
await SecureStore.deleteItemAsync(key);
return true;
} catch (e) {
return false;
}
}