MCPcopy Create free account
hub / github.com/ChromeDevTools/chrome-devtools-mcp / sourceMapFor

Function sourceMapFor

scripts/profile/source_map_server.ts:14–28  ·  view source on GitHub ↗
(index: number, sizeBytes = 1_000_000)

Source from the content-addressed store, hash-verified

12}
13
14export function sourceMapFor(index: number, sizeBytes = 1_000_000): string {
15 const padding = '// Large source map payload padding line\n'.repeat(
16 Math.ceil(sizeBytes / 42),
17 );
18 return JSON.stringify({
19 version: 3,
20 file: `script-${index}.js`,
21 sources: [`source-${index}.ts`],
22 sourcesContent: [
23 `export function profileFunction${index}(value: number): number {\n console.error(new Error('Profile error from script ${index}'));\n return value + ${index};\n}\n${padding}`,
24 ],
25 names: [],
26 mappings: 'AAAA;AACA;AACA;AACA',
27 });
28}
29
30export function scriptFor(index: number): string {
31 return [

Callers 1

startSourceMapTestServerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected