(index: number, sizeBytes = 1_000_000)
| 12 | } |
| 13 | |
| 14 | export 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 | |
| 30 | export function scriptFor(index: number): string { |
| 31 | return [ |
no outgoing calls
no test coverage detected