UNPKG

@variablesoftware/mock-d1

Version:

🎛️🗂️🧠 Mock D1 Database implementation for testing Cloudflare Workers

14 lines (13 loc) 590 B
/** * @file helpers/mockDump.ts * @description Provides the mock-only `dump` method for mockD1Database. * @warning This is a mock/test-only API. Do not use in production. Will emit a warning if called outside test. */ import { D1TableData } from '../types/MockD1Database.js'; /** * Returns a snapshot of the current database state (mock only). * Emits a warning if used outside of test environments. * @param db - The internal Map of tables to rows. * @returns An object mapping table names to their rows. */ export declare function mockDump(db: Map<string, D1TableData>): string;