openpencil/packages/fig/scripts/smoke-dist.ts

18 lines
438 B
TypeScript
Raw Normal View History

2026-06-06 15:38:27 +00:00
export {}
const mod = await import('../dist/index.js')
if (mod.FIG_PACKAGE_STATUS !== 'container-api') {
throw new Error('Expected @open-pencil/fig container API export')
}
const bytes = mod.writeFigContainer({
schemaDeflated: new Uint8Array([1]),
dataRaw: new Uint8Array([2])
})
const document = mod.readFigContainer(bytes)
if (document.dataRaw[0] !== 2) {
throw new Error('Expected @open-pencil/fig container round-trip')
2026-06-06 15:38:27 +00:00
}