findGenerated(): { line: number; column: number; sourceLine: number; }
| null
The other direction: where in the BUNDLE a place in an original file ended up.
Every other lookup here goes generated → original, because that is what a stack trace needs. A breakpoint needs the reverse — somebody names a line in a file they wrote, and the page only knows the bundle it is running. There is no index for that direction, so this scans; it happens once when a breakpoint is set, not once per frame of every stack.
Lands on the nearest line at or after the one asked for, because plenty of lines have no code on them — a blank line, a comment, a closing brace — and refusing those would mean answering "there is nothing there" to a perfectly reasonable request. The line it settled on comes back with it, so a caller can say where the breakpoint actually went.
import * as SourceMap from './source-map.ts'; const decoder = SourceMap.parse('{"sources":["../a.ts"],"mappings":"AAAA"}', '/proj/tmp'); SourceMap.findGenerated(decoder, '/proj/a.ts', 1); // { line: 0, column: 0, sourceLine: 1 } SourceMap.findGenerated(decoder, '/proj/nowhere.ts', 1); // null — not a file in this bundle