source: frontend/node_modules/@jridgewell/remapping/src/source-map.ts

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 1.3 KB
Line 
1import { toDecodedMap, toEncodedMap } from '@jridgewell/gen-mapping';
2
3import type { GenMapping } from '@jridgewell/gen-mapping';
4import type { DecodedSourceMap, EncodedSourceMap, Options } from './types';
5
6/**
7 * A SourceMap v3 compatible sourcemap, which only includes fields that were
8 * provided to it.
9 */
10export default class SourceMap {
11 declare file?: string | null;
12 declare mappings: EncodedSourceMap['mappings'] | DecodedSourceMap['mappings'];
13 declare sourceRoot?: string;
14 declare names: string[];
15 declare sources: (string | null)[];
16 declare sourcesContent?: (string | null)[];
17 declare version: 3;
18 declare ignoreList: number[] | undefined;
19
20 constructor(map: GenMapping, options: Options) {
21 const out = options.decodedMappings ? toDecodedMap(map) : toEncodedMap(map);
22 this.version = out.version; // SourceMap spec says this should be first.
23 this.file = out.file;
24 this.mappings = out.mappings as SourceMap['mappings'];
25 this.names = out.names as SourceMap['names'];
26 this.ignoreList = out.ignoreList as SourceMap['ignoreList'];
27 this.sourceRoot = out.sourceRoot;
28
29 this.sources = out.sources as SourceMap['sources'];
30 if (!options.excludeContent) {
31 this.sourcesContent = out.sourcesContent as SourceMap['sourcesContent'];
32 }
33 }
34
35 toString(): string {
36 return JSON.stringify(this);
37 }
38}
Note: See TracBrowser for help on using the repository browser.