MCPcopy
hub / github.com/OpenCoworkAI/open-codesign / writeZip

Function writeZip

apps/desktop/src/main/document-preview.test.ts:8–15  ·  view source on GitHub ↗
(filePath: string, entries: Record<string, string>)

Source from the content-addressed store, hash-verified

6import { createWorkspaceDocumentPreview } from './document-preview';
7
8async function writeZip(filePath: string, entries: Record<string, string>): Promise<void> {
9 const zip = new JSZip();
10 for (const [name, content] of Object.entries(entries)) {
11 zip.file(name, content);
12 }
13 const bytes = await zip.generateAsync({ type: 'nodebuffer' });
14 await writeFile(filePath, bytes);
15}
16
17describe('createWorkspaceDocumentPreview', () => {
18 it('extracts a lightweight docx preview without treating the file as UTF-8 text', async () => {

Callers 1

Calls 1

writeFileFunction · 0.85

Tested by

no test coverage detected