Decode a kernel bundle's buffers into the standard pre-filtered StoreBundle.
(bundle: KernelStoreBundle)
| 58 | |
| 59 | /** Decode a kernel bundle's buffers into the standard pre-filtered StoreBundle. */ |
| 60 | function decodeKernelBundle(bundle: KernelStoreBundle): StoreBundle { |
| 61 | const asBuf = (u: Uint8Array) => Buffer.from(u.buffer, u.byteOffset, u.byteLength); |
| 62 | const decoded = decodeExtractBuffers( |
| 63 | { |
| 64 | meta: asBuf(bundle.buffers.meta), |
| 65 | nodes: asBuf(bundle.buffers.nodes), |
| 66 | edges: asBuf(bundle.buffers.edges), |
| 67 | refs: asBuf(bundle.buffers.refs), |
| 68 | arena: asBuf(bundle.buffers.arena), |
| 69 | }, |
| 70 | bundle.filePath, |
| 71 | bundle.language |
| 72 | ); |
| 73 | return finalizeStoreBundle(decoded, bundle.filePath, bundle.language, bundle.file); |
| 74 | } |
| 75 | |
| 76 | port.on('message', (msg: InMessage) => { |
| 77 | try { |
no test coverage detected