(raw)
| 242 | } |
| 243 | |
| 244 | function parseMaybeDataJs(raw) { |
| 245 | const trimmed = raw.trim() |
| 246 | |
| 247 | if (trimmed.startsWith('window.BENCHMARK_DATA')) { |
| 248 | const sandbox = { window: {} } |
| 249 | vm.runInNewContext(trimmed, sandbox, { timeout: 1000 }) |
| 250 | return sandbox.window.BENCHMARK_DATA |
| 251 | } |
| 252 | |
| 253 | return JSON.parse(trimmed) |
| 254 | } |
| 255 | |
| 256 | function resolveManifestChunkKey(manifest, keyOrFile) { |
| 257 | if (manifest[keyOrFile]) { |
no test coverage detected