Die Testversion bündelt Oberfläche und Server-Logik mit PGlite (Postgres als WebAssembly). POST /api/import/stand spielt einen kompletten Stand mit allen IDs in ein leeres Programm ein; damit ziehen die Daten später auf den Server um. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AmyPfuNc4sCRfaF3oURXZz
16 lines
690 B
TypeScript
16 lines
690 B
TypeScript
// Was src/server/app.ts aus Node braucht, für den Browser nachgebaut.
|
|
export const existsSync = () => false;
|
|
export const fileURLToPath = (u: string) => u;
|
|
export default { join: (...t: string[]) => t.join("/"), dirname: (p: string) => p };
|
|
|
|
export function randomBytes(n: number) {
|
|
const b = crypto.getRandomValues(new Uint8Array(n));
|
|
return { toString: () => btoa(String.fromCharCode(...b)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "") };
|
|
}
|
|
|
|
export function timingSafeEqual(a: Uint8Array, b: Uint8Array): boolean {
|
|
return a.length === b.length && a.every((x, i) => x === b[i]);
|
|
}
|
|
|
|
(globalThis as any).Buffer ??= { from: (s: string) => new TextEncoder().encode(s) };
|