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

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

Fix frontend appearance

  • Property mode set to 100644
File size: 1.4 KB
RevLine 
[9af201e]1import buildSourceMapTree from './build-source-map-tree';
2import { traceMappings } from './source-map-tree';
3import SourceMap from './source-map';
4
5import type { SourceMapInput, SourceMapLoader, Options } from './types';
6export type {
7 SourceMapSegment,
8 EncodedSourceMap,
9 EncodedSourceMap as RawSourceMap,
10 DecodedSourceMap,
11 SourceMapInput,
12 SourceMapLoader,
13 LoaderContext,
14 Options,
15} from './types';
16export type { SourceMap };
17
18/**
19 * Traces through all the mappings in the root sourcemap, through the sources
20 * (and their sourcemaps), all the way back to the original source location.
21 *
22 * `loader` will be called every time we encounter a source file. If it returns
23 * a sourcemap, we will recurse into that sourcemap to continue the trace. If
24 * it returns a falsey value, that source file is treated as an original,
25 * unmodified source file.
26 *
27 * Pass `excludeContent` to exclude any self-containing source file content
28 * from the output sourcemap.
29 *
30 * Pass `decodedMappings` to receive a SourceMap with decoded (instead of
31 * VLQ encoded) mappings.
32 */
33export default function remapping(
34 input: SourceMapInput | SourceMapInput[],
35 loader: SourceMapLoader,
36 options?: boolean | Options,
37): SourceMap {
38 const opts =
39 typeof options === 'object' ? options : { excludeContent: !!options, decodedMappings: false };
40 const tree = buildSourceMapTree(input, loader);
41 return new SourceMap(traceMappings(tree), opts);
42}
Note: See TracBrowser for help on using the repository browser.