REPOSITORY CODING · MEDIUM
Decode signed source-map deltas
Original positions move forward instead of backward when a source map uses negative VLQ deltas. Repair the sign-bit decoder while retaining continuation groups, bounds and malformed-input checks.
Runtime DiagnosticsSource map debugging laboratory
Work through a real codebase.
Choose an environment, investigate the existing implementation and use the tests to check your change. Sign in to open a workspace; execution and Ono usage follow your plan’s allowances.
Task requirements and environments
Angular · 55 minute session
- Decode flat version-3 source maps without external requests. Generated and original line/column indices are zero based. A semicolon advances the generated line; only generated column resets. Source, original line, original column and name deltas carry across lines.
- Decode Base64 VLQ continuation groups with the least-significant sign bit. Segments contain one, four or five fields. One-field segments explicitly start an unmapped region. Reject invalid characters, incomplete groups, oversized values, negative accumulated indices, invalid references and non-increasing generated columns.
- Return every decoded segment in generated order. Lookup uses the greatest generated column not exceeding the query on that same line. Never borrow a preceding line or skip an unmapped segment. Missing mappings return null.
- sourceRoot is prepended to relative source paths with one separator; absolute paths and URI sources are preserved. Names are optional and name-index deltas carry independently. The map and query inputs must remain unchanged.
- The React, Vue and Angular previews execute the same checked-in decoder in their native framework. The JavaScript edition uses the React workbench. Indexed maps are deliberately unsupported; no source file content is loaded.
- Validate optional sourcesContent arity and null/text entries, optional file names, embedded NUL characters and a 2000-generated-line bound. Embedded source text is never executed or fetched; cumulative content is limited to 100000 characters.
JavaScript · 55 minute session
- Decode flat version-3 source maps without external requests. Generated and original line/column indices are zero based. A semicolon advances the generated line; only generated column resets. Source, original line, original column and name deltas carry across lines.
- Decode Base64 VLQ continuation groups with the least-significant sign bit. Segments contain one, four or five fields. One-field segments explicitly start an unmapped region. Reject invalid characters, incomplete groups, oversized values, negative accumulated indices, invalid references and non-increasing generated columns.
- Return every decoded segment in generated order. Lookup uses the greatest generated column not exceeding the query on that same line. Never borrow a preceding line or skip an unmapped segment. Missing mappings return null.
- sourceRoot is prepended to relative source paths with one separator; absolute paths and URI sources are preserved. Names are optional and name-index deltas carry independently. The map and query inputs must remain unchanged.
- The React, Vue and Angular previews execute the same checked-in decoder in their native framework. The JavaScript edition uses the React workbench. Indexed maps are deliberately unsupported; no source file content is loaded.
- Validate optional sourcesContent arity and null/text entries, optional file names, embedded NUL characters and a 2000-generated-line bound. Embedded source text is never executed or fetched; cumulative content is limited to 100000 characters.
React · 55 minute session
- Decode flat version-3 source maps without external requests. Generated and original line/column indices are zero based. A semicolon advances the generated line; only generated column resets. Source, original line, original column and name deltas carry across lines.
- Decode Base64 VLQ continuation groups with the least-significant sign bit. Segments contain one, four or five fields. One-field segments explicitly start an unmapped region. Reject invalid characters, incomplete groups, oversized values, negative accumulated indices, invalid references and non-increasing generated columns.
- Return every decoded segment in generated order. Lookup uses the greatest generated column not exceeding the query on that same line. Never borrow a preceding line or skip an unmapped segment. Missing mappings return null.
- sourceRoot is prepended to relative source paths with one separator; absolute paths and URI sources are preserved. Names are optional and name-index deltas carry independently. The map and query inputs must remain unchanged.
- The React, Vue and Angular previews execute the same checked-in decoder in their native framework. The JavaScript edition uses the React workbench. Indexed maps are deliberately unsupported; no source file content is loaded.
- Validate optional sourcesContent arity and null/text entries, optional file names, embedded NUL characters and a 2000-generated-line bound. Embedded source text is never executed or fetched; cumulative content is limited to 100000 characters.
Vue · 55 minute session
- Decode flat version-3 source maps without external requests. Generated and original line/column indices are zero based. A semicolon advances the generated line; only generated column resets. Source, original line, original column and name deltas carry across lines.
- Decode Base64 VLQ continuation groups with the least-significant sign bit. Segments contain one, four or five fields. One-field segments explicitly start an unmapped region. Reject invalid characters, incomplete groups, oversized values, negative accumulated indices, invalid references and non-increasing generated columns.
- Return every decoded segment in generated order. Lookup uses the greatest generated column not exceeding the query on that same line. Never borrow a preceding line or skip an unmapped segment. Missing mappings return null.
- sourceRoot is prepended to relative source paths with one separator; absolute paths and URI sources are preserved. Names are optional and name-index deltas carry independently. The map and query inputs must remain unchanged.
- The React, Vue and Angular previews execute the same checked-in decoder in their native framework. The JavaScript edition uses the React workbench. Indexed maps are deliberately unsupported; no source file content is loaded.
- Validate optional sourcesContent arity and null/text entries, optional file names, embedded NUL characters and a 2000-generated-line bound. Embedded source text is never executed or fetched; cumulative content is limited to 100000 characters.