(bundleName)
| 43 | } |
| 44 | |
| 45 | function getBundleSource(bundleName) { |
| 46 | const cached = bundleSourceCache.get(bundleName) |
| 47 | if (cached) return cached |
| 48 | const fileName = SANDBOX_BUNDLE_FILES[bundleName] |
| 49 | if (!fileName) { |
| 50 | throw new Error(`Unknown sandbox bundle: ${bundleName}`) |
| 51 | } |
| 52 | const bundlePath = path.join(SANDBOX_BUNDLE_DIR, fileName) |
| 53 | if (!fs.existsSync(bundlePath)) { |
| 54 | throw new Error( |
| 55 | `Sandbox bundle not found at ${bundlePath}. Run \`bun run build:sandbox-bundles\`.` |
| 56 | ) |
| 57 | } |
| 58 | const source = fs.readFileSync(bundlePath, 'utf-8') |
| 59 | bundleSourceCache.set(bundleName, { source, fileName }) |
| 60 | return bundleSourceCache.get(bundleName) |
| 61 | } |
| 62 | |
| 63 | function stringifyLogValue(value) { |
| 64 | if (typeof value !== 'object' || value === null) { |
no test coverage detected