File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed
Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 11import { SetArray , put , remove } from './set-array' ;
2- import { encode } from '@jridgewell/sourcemap-codec' ;
2+ import { encode , encodeRangeMappings } from '@jridgewell/sourcemap-codec' ;
33import { TraceMap , decodedMappings } from '@jridgewell/trace-mapping' ;
44
55import {
@@ -290,6 +290,7 @@ export function toEncodedMap(map: GenMapping): EncodedSourceMap {
290290 const decoded = toDecodedMap ( map ) ;
291291 const encoded = decoded as unknown as EncodedSourceMap ;
292292 encoded . mappings = encode ( decoded . mappings as SourceMapSegment [ ] [ ] ) ;
293+ encoded . rangeMappings = encodeRangeMappings ( ( decoded . rangeMappings || [ ] ) as number [ ] [ ] ) ;
293294 return encoded ;
294295}
295296
Original file line number Diff line number Diff line change @@ -41,12 +41,6 @@ export interface SourceMapV3 {
4141 * An optional array of indices of sources that should be ignored.
4242 */
4343 ignoreList ?: readonly number [ ] ;
44-
45- /**
46- * An optional array of mapping indicies which cover a range of generated
47- * code and source code.
48- */
49- rangeMappings ?: MappingIndex [ ] [ ] ;
5044}
5145
5246/**
@@ -57,6 +51,11 @@ export interface EncodedSourceMap extends SourceMapV3 {
5751 * The mappings for the sourcemap, encoded as a VLQ string.
5852 */
5953 mappings : string ;
54+
55+ /**
56+ * An optional VLQ encoded string for the range mapping indices.
57+ */
58+ rangeMappings ?: string ;
6059}
6160
6261/**
@@ -68,6 +67,12 @@ export interface DecodedSourceMap extends SourceMapV3 {
6867 * The mappings for the sourcemap, decoded into our internal format.
6968 */
7069 mappings : readonly SourceMapSegment [ ] [ ] ;
70+
71+ /**
72+ * An optional array of mapping indicies which cover a range of generated
73+ * code and source code.
74+ */
75+ rangeMappings ?: MappingIndex [ ] [ ] ;
7176}
7277
7378/**
You can’t perform that action at this time.
0 commit comments