hippofish/packages/sw/src/scripts/get-account-from-id.ts
ThatOneCalculator 6b00abf05c
refactor: 🎨 rome
2023-01-12 20:40:33 -08:00

7 lines
269 B
TypeScript

import { get } from "idb-keyval";
export async function getAccountFromId(id: string) {
const accounts = (await get("accounts")) as { token: string; id: string }[];
if (!accounts) console.log("Accounts are not recorded");
return accounts.find((e) => e.id === id);
}