(
entries: Record<string, string>,
options: { comment?: string } = {}
)
| 16 | } |
| 17 | |
| 18 | async function buildZip( |
| 19 | entries: Record<string, string>, |
| 20 | options: { comment?: string } = {} |
| 21 | ): Promise<Buffer> { |
| 22 | const zip = new JSZip() |
| 23 | for (const [name, content] of Object.entries(entries)) { |
| 24 | zip.file(name, content) |
| 25 | } |
| 26 | return zip.generateAsync({ |
| 27 | type: 'nodebuffer', |
| 28 | compression: 'DEFLATE', |
| 29 | comment: options.comment, |
| 30 | }) |
| 31 | } |
| 32 | |
| 33 | describe('assertOoxmlArchiveWithinLimits', () => { |
| 34 | it('accepts a well-formed archive within limits', async () => { |