Skip to content

Commit

Permalink
Ensure bundle is an ArrayBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
mradbourne committed Jun 6, 2024
1 parent ceae79a commit 4b33d86
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import * as VM from 'node:vm';
import * as OS from 'node:os';
import * as FS from 'node:fs';
import { Module } from 'node:module';
import assert from 'node:assert';

const VERSION = 1;
const COMPRESSION = {
Expand All @@ -25,7 +26,9 @@ const HASH = {
const PROTO = 'sea:';

const resolutions: Record<string, Record<string, string>> = JSON.parse(SEA.getAsset('resolv', 'utf8'));
const blobs = extractBlobs(SEA.getRawAsset('bundle'));
const bundle = SEA.getRawAsset('bundle');
assert(typeof bundle === 'object', 'bundle is not an ArrayBuffer');
const blobs = extractBlobs(bundle);

function extractBlobs(data: ArrayBuffer) {
const index: Record<string, ReturnType<typeof blobData>> = {};
Expand Down

0 comments on commit 4b33d86

Please sign in to comment.