MCPcopy
hub / github.com/alan2207/bulletproof-react / persistDb

Function persistDb

apps/nextjs-app/src/testing/mocks/db.ts:81–86  ·  view source on GitHub ↗
(model: Model)

Source from the content-addressed store, hash-verified

79};
80
81export const persistDb = async (model: Model) => {
82 if (process.env.NODE_ENV === 'test') return;
83 const data = await loadDb();
84 data[model] = db[model].getAll();
85 await storeDb(JSON.stringify(data));
86};
87
88export const initializeDb = async () => {
89 const database = await loadDb();

Callers 4

discussions.tsFile · 0.90
comments.tsFile · 0.90
users.tsFile · 0.90
auth.tsFile · 0.90

Calls 2

loadDbFunction · 0.70
storeDbFunction · 0.70

Tested by

no test coverage detected