File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
packages/trace-mapping/src Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ import type {
3737 EachMapping ,
3838 Bias ,
3939 XInput ,
40+ SectionedSourceMap ,
4041} from './types' ;
4142import type { Source } from './by-source' ;
4243import type { MemoState } from './binary-search' ;
@@ -124,9 +125,13 @@ export class TraceMap implements SourceMap {
124125 if ( typeof mappings === 'string' ) {
125126 this . _encoded = mappings ;
126127 this . _decoded = undefined ;
127- } else {
128+ } else if ( Array . isArray ( mappings ) ) {
128129 this . _encoded = undefined ;
129130 this . _decoded = maybeSort ( mappings , isString ) ;
131+ } else if ( ( parsed as unknown as SectionedSourceMap ) . sections ) {
132+ throw new Error ( `TraceMap passed sectioned source map, please use AnyMap export instead` ) ;
133+ } else {
134+ throw new Error ( `invalid source map: ${ JSON . stringify ( parsed ) } ` ) ;
130135 }
131136
132137 this . _decodedMemo = memoizedState ( ) ;
You can’t perform that action at this time.
0 commit comments