8889841cREADME.md000066600000011414150434534160006035 0ustar00# @jridgewell/gen-mapping > Generate source maps `gen-mapping` allows you to generate a source map during transpilation or minification. With a source map, you're able to trace the original location in the source file, either in Chrome's DevTools or using a library like [`@jridgewell/trace-mapping`][trace-mapping]. You may already be familiar with the [`source-map`][source-map] package's `SourceMapGenerator`. This provides the same `addMapping` and `setSourceContent` API. ## Installation ```sh npm install @jridgewell/gen-mapping ``` ## Usage ```typescript import { GenMapping, addMapping, setSourceContent, encodedMap } from '@jridgewell/gen-mapping'; const map = new GenMapping({ file: 'output.js', sourceRoot: 'https://example.com/', }); setSourceContent(map, 'input.js', `function foo() {}`); addMapping(map, { // Lines start at line 1, columns at column 0. generated: { line: 1, column: 0 }, source: 'input.js', original: { line: 1, column: 0 }, }); addMapping(map, { generated: { line: 1, column: 9 }, source: 'input.js', original: { line: 1, column: 9 }, name: 'foo', }); assert.deepEqual(encodedMap(map), { version: 3, file: 'output.js', names: ['foo'], sourceRoot: 'https://example.com/', sources: ['input.js'], sourcesContent: ['function foo() {}'], mappings: 'AAAA,SAASA', }); ``` ## Benchmarks ``` node v18.0.0 amp.js.map gen-mapping: addSegment x 462 ops/sec ±1.53% (91 runs sampled) gen-mapping: addMapping x 471 ops/sec ±0.77% (93 runs sampled) source-map-js: addMapping x 178 ops/sec ±1.14% (84 runs sampled) source-map-0.6.1: addMapping x 178 ops/sec ±1.21% (84 runs sampled) source-map-0.8.0: addMapping x 177 ops/sec ±1.21% (83 runs sampled) Fastest is gen-mapping: addMapping,gen-mapping: addSegment gen-mapping: decoded output x 157,499,812 ops/sec ±0.25% (100 runs sampled) gen-mapping: encoded output x 625 ops/sec ±1.95% (88 runs sampled) source-map-js: encoded output x 162 ops/sec ±0.37% (84 runs sampled) source-map-0.6.1: encoded output x 161 ops/sec ±0.51% (84 runs sampled) source-map-0.8.0: encoded output x 191 ops/sec ±0.12% (90 runs sampled) Fastest is gen-mapping: decoded output *** babel.min.js.map gen-mapping: addSegment x 35.38 ops/sec ±4.48% (48 runs sampled) gen-mapping: addMapping x 29.93 ops/sec ±5.03% (55 runs sampled) source-map-js: addMapping x 22.19 ops/sec ±3.39% (41 runs sampled) source-map-0.6.1: addMapping x 22.57 ops/sec ±2.90% (41 runs sampled) source-map-0.8.0: addMapping x 22.73 ops/sec ±2.84% (41 runs sampled) Fastest is gen-mapping: addSegment gen-mapping: decoded output x 157,767,591 ops/sec ±0.10% (99 runs sampled) gen-mapping: encoded output x 97.06 ops/sec ±1.69% (73 runs sampled) source-map-js: encoded output x 17.51 ops/sec ±2.27% (37 runs sampled) source-map-0.6.1: encoded output x 17.40 ops/sec ±4.61% (35 runs sampled) source-map-0.8.0: encoded output x 17.83 ops/sec ±4.85% (36 runs sampled) Fastest is gen-mapping: decoded output *** preact.js.map gen-mapping: addSegment x 13,516 ops/sec ±0.27% (98 runs sampled) gen-mapping: addMapping x 12,117 ops/sec ±0.25% (97 runs sampled) source-map-js: addMapping x 4,285 ops/sec ±1.53% (98 runs sampled) source-map-0.6.1: addMapping x 4,482 ops/sec ±0.20% (100 runs sampled) source-map-0.8.0: addMapping x 4,482 ops/sec ±0.28% (99 runs sampled) Fastest is gen-mapping: addSegment gen-mapping: decoded output x 157,769,691 ops/sec ±0.06% (92 runs sampled) gen-mapping: encoded output x 18,610 ops/sec ±1.03% (93 runs sampled) source-map-js: encoded output x 5,397 ops/sec ±0.38% (97 runs sampled) source-map-0.6.1: encoded output x 5,422 ops/sec ±0.16% (100 runs sampled) source-map-0.8.0: encoded output x 5,595 ops/sec ±0.11% (100 runs sampled) Fastest is gen-mapping: decoded output *** react.js.map gen-mapping: addSegment x 5,058 ops/sec ±0.27% (100 runs sampled) gen-mapping: addMapping x 4,352 ops/sec ±0.13% (97 runs sampled) source-map-js: addMapping x 1,569 ops/sec ±0.19% (99 runs sampled) source-map-0.6.1: addMapping x 1,550 ops/sec ±0.31% (97 runs sampled) source-map-0.8.0: addMapping x 1,560 ops/sec ±0.18% (99 runs sampled) Fastest is gen-mapping: addSegment gen-mapping: decoded output x 157,479,701 ops/sec ±0.14% (99 runs sampled) gen-mapping: encoded output x 6,392 ops/sec ±1.03% (94 runs sampled) source-map-js: encoded output x 2,213 ops/sec ±0.36% (99 runs sampled) source-map-0.6.1: encoded output x 2,238 ops/sec ±0.23% (100 runs sampled) source-map-0.8.0: encoded output x 2,304 ops/sec ±0.20% (100 runs sampled) Fastest is gen-mapping: decoded output ``` [source-map]: https://www.npmjs.com/package/source-map [trace-mapping]: https://github.com/jridgewell/trace-mapping dist/gen-mapping.umd.js000066600000015541150434534160011052 0ustar00(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@jridgewell/set-array'), require('@jridgewell/sourcemap-codec')) : typeof define === 'function' && define.amd ? define(['exports', '@jridgewell/set-array', '@jridgewell/sourcemap-codec'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.genMapping = {}, global.setArray, global.sourcemapCodec)); })(this, (function (exports, setArray, sourcemapCodec) { 'use strict'; /** * A low-level API to associate a generated position with an original source position. Line and * column here are 0-based, unlike `addMapping`. */ exports.addSegment = void 0; /** * A high-level API to associate a generated position with an original source position. Line is * 1-based, but column is 0-based, due to legacy behavior in `source-map` library. */ exports.addMapping = void 0; /** * Adds/removes the content of the source file to the source map. */ exports.setSourceContent = void 0; /** * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects * a sourcemap, or to JSON.stringify. */ exports.decodedMap = void 0; /** * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects * a sourcemap, or to JSON.stringify. */ exports.encodedMap = void 0; /** * Returns an array of high-level mapping objects for every recorded segment, which could then be * passed to the `source-map` library. */ exports.allMappings = void 0; /** * Provides the state to generate a sourcemap. */ class GenMapping { constructor({ file, sourceRoot } = {}) { this._names = new setArray.SetArray(); this._sources = new setArray.SetArray(); this._sourcesContent = []; this._mappings = []; this.file = file; this.sourceRoot = sourceRoot; } } (() => { exports.addSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name) => { const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map; const line = getLine(mappings, genLine); if (source == null) { const seg = [genColumn]; const index = getColumnIndex(line, genColumn, seg); return insert(line, index, seg); } const sourcesIndex = setArray.put(sources, source); const seg = name ? [genColumn, sourcesIndex, sourceLine, sourceColumn, setArray.put(names, name)] : [genColumn, sourcesIndex, sourceLine, sourceColumn]; const index = getColumnIndex(line, genColumn, seg); if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = null; insert(line, index, seg); }; exports.addMapping = (map, mapping) => { const { generated, source, original, name } = mapping; return exports.addSegment(map, generated.line - 1, generated.column, source, original == null ? undefined : original.line - 1, original === null || original === void 0 ? void 0 : original.column, name); }; exports.setSourceContent = (map, source, content) => { const { _sources: sources, _sourcesContent: sourcesContent } = map; sourcesContent[setArray.put(sources, source)] = content; }; exports.decodedMap = (map) => { const { file, sourceRoot, _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map; return { version: 3, file, names: names.array, sourceRoot: sourceRoot || undefined, sources: sources.array, sourcesContent, mappings, }; }; exports.encodedMap = (map) => { const decoded = exports.decodedMap(map); return Object.assign(Object.assign({}, decoded), { mappings: sourcemapCodec.encode(decoded.mappings) }); }; exports.allMappings = (map) => { const out = []; const { _mappings: mappings, _sources: sources, _names: names } = map; for (let i = 0; i < mappings.length; i++) { const line = mappings[i]; for (let j = 0; j < line.length; j++) { const seg = line[j]; const generated = { line: i + 1, column: seg[0] }; let source = undefined; let original = undefined; let name = undefined; if (seg.length !== 1) { source = sources.array[seg[1]]; original = { line: seg[2] + 1, column: seg[3] }; if (seg.length === 5) name = names.array[seg[4]]; } out.push({ generated, source, original, name }); } } return out; }; })(); function getLine(mappings, index) { for (let i = mappings.length; i <= index; i++) { mappings[i] = []; } return mappings[index]; } function getColumnIndex(line, column, seg) { let index = line.length; for (let i = index - 1; i >= 0; i--, index--) { const current = line[i]; const col = current[0]; if (col > column) continue; if (col < column) break; const cmp = compare(current, seg); if (cmp === 0) return index; if (cmp < 0) break; } return index; } function compare(a, b) { let cmp = compareNum(a.length, b.length); if (cmp !== 0) return cmp; // We've already checked genColumn if (a.length === 1) return 0; cmp = compareNum(a[1], b[1]); if (cmp !== 0) return cmp; cmp = compareNum(a[2], b[2]); if (cmp !== 0) return cmp; cmp = compareNum(a[3], b[3]); if (cmp !== 0) return cmp; if (a.length === 4) return 0; return compareNum(a[4], b[4]); } function compareNum(a, b) { return a - b; } function insert(array, index, value) { if (index === -1) return; for (let i = array.length; i > index; i--) { array[i] = array[i - 1]; } array[index] = value; } exports.GenMapping = GenMapping; Object.defineProperty(exports, '__esModule', { value: true }); })); //# sourceMappingURL=gen-mapping.umd.js.map dist/gen-mapping.umd.js.map000066600000032740150434534160011626 0ustar00{"version":3,"file":"gen-mapping.umd.js","sources":["../../src/gen-mapping.ts"],"sourcesContent":["import { SetArray, put } from '@jridgewell/set-array';\nimport { encode } from '@jridgewell/sourcemap-codec';\n\nimport type { SourceMapSegment } from './sourcemap-segment';\nimport type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types';\n\nexport type { DecodedSourceMap, EncodedSourceMap, Mapping };\n\nexport type Options = {\n file?: string | null;\n sourceRoot?: string | null;\n};\n\n/**\n * A low-level API to associate a generated position with an original source position. Line and\n * column here are 0-based, unlike `addMapping`.\n */\nexport let addSegment: {\n (\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source?: null,\n sourceLine?: null,\n sourceColumn?: null,\n name?: null,\n ): void;\n (\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source: string,\n sourceLine: number,\n sourceColumn: number,\n name?: null,\n ): void;\n (\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source: string,\n sourceLine: number,\n sourceColumn: number,\n name: string,\n ): void;\n};\n\n/**\n * A high-level API to associate a generated position with an original source position. Line is\n * 1-based, but column is 0-based, due to legacy behavior in `source-map` library.\n */\nexport let addMapping: {\n (\n map: GenMapping,\n mapping: {\n generated: Pos;\n source?: null;\n original?: null;\n name?: null;\n },\n ): void;\n (\n map: GenMapping,\n mapping: {\n generated: Pos;\n source: string;\n original: Pos;\n name?: null;\n },\n ): void;\n (\n map: GenMapping,\n mapping: {\n generated: Pos;\n source: string;\n original: Pos;\n name: string;\n },\n ): void;\n};\n\n/**\n * Adds/removes the content of the source file to the source map.\n */\nexport let setSourceContent: (map: GenMapping, source: string, content: string | null) => void;\n\n/**\n * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let decodedMap: (map: GenMapping) => DecodedSourceMap;\n\n/**\n * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let encodedMap: (map: GenMapping) => EncodedSourceMap;\n\n/**\n * Returns an array of high-level mapping objects for every recorded segment, which could then be\n * passed to the `source-map` library.\n */\nexport let allMappings: (map: GenMapping) => Mapping[];\n\n/**\n * Provides the state to generate a sourcemap.\n */\nexport class GenMapping {\n private _names = new SetArray();\n private _sources = new SetArray();\n private _sourcesContent: (string | null)[] = [];\n private _mappings: SourceMapSegment[][] = [];\n declare file: string | null | undefined;\n declare sourceRoot: string | null | undefined;\n\n constructor({ file, sourceRoot }: Options = {}) {\n this.file = file;\n this.sourceRoot = sourceRoot;\n }\n\n static {\n addSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name) => {\n const {\n _mappings: mappings,\n _sources: sources,\n _sourcesContent: sourcesContent,\n _names: names,\n } = map;\n\n const line = getLine(mappings, genLine);\n if (source == null) {\n const seg: SourceMapSegment = [genColumn];\n const index = getColumnIndex(line, genColumn, seg);\n return insert(line, index, seg);\n }\n\n // Sigh, TypeScript can't figure out sourceLine and sourceColumn aren't nullish if source\n // isn't nullish.\n assert(sourceLine);\n assert(sourceColumn);\n const sourcesIndex = put(sources, source);\n const seg: SourceMapSegment = name\n ? [genColumn, sourcesIndex, sourceLine, sourceColumn, put(names, name)]\n : [genColumn, sourcesIndex, sourceLine, sourceColumn];\n\n const index = getColumnIndex(line, genColumn, seg);\n if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = null;\n insert(line, index, seg);\n };\n\n addMapping = (map, mapping) => {\n const { generated, source, original, name } = mapping;\n return (addSegment as any)(\n map,\n generated.line - 1,\n generated.column,\n source,\n original == null ? undefined : original.line - 1,\n original?.column,\n name,\n );\n };\n\n setSourceContent = (map, source, content) => {\n const { _sources: sources, _sourcesContent: sourcesContent } = map;\n sourcesContent[put(sources, source)] = content;\n };\n\n decodedMap = (map) => {\n const {\n file,\n sourceRoot,\n _mappings: mappings,\n _sources: sources,\n _sourcesContent: sourcesContent,\n _names: names,\n } = map;\n\n return {\n version: 3,\n file,\n names: names.array,\n sourceRoot: sourceRoot || undefined,\n sources: sources.array,\n sourcesContent,\n mappings,\n };\n };\n\n encodedMap = (map) => {\n const decoded = decodedMap(map);\n return {\n ...decoded,\n mappings: encode(decoded.mappings as SourceMapSegment[][]),\n };\n };\n\n allMappings = (map) => {\n const out: Mapping[] = [];\n const { _mappings: mappings, _sources: sources, _names: names } = map;\n\n for (let i = 0; i < mappings.length; i++) {\n const line = mappings[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n\n const generated = { line: i + 1, column: seg[0] };\n let source: string | undefined = undefined;\n let original: Pos | undefined = undefined;\n let name: string | undefined = undefined;\n\n if (seg.length !== 1) {\n source = sources.array[seg[1]];\n original = { line: seg[2] + 1, column: seg[3] };\n\n if (seg.length === 5) name = names.array[seg[4]];\n }\n\n out.push({ generated, source, original, name } as Mapping);\n }\n }\n\n return out;\n };\n }\n}\n\nfunction assert(_val: unknown): asserts _val is T {\n // noop.\n}\n\nfunction getLine(mappings: SourceMapSegment[][], index: number): SourceMapSegment[] {\n for (let i = mappings.length; i <= index; i++) {\n mappings[i] = [];\n }\n return mappings[index];\n}\n\nfunction getColumnIndex(line: SourceMapSegment[], column: number, seg: SourceMapSegment): number {\n let index = line.length;\n for (let i = index - 1; i >= 0; i--, index--) {\n const current = line[i];\n const col = current[0];\n if (col > column) continue;\n if (col < column) break;\n\n const cmp = compare(current, seg);\n if (cmp === 0) return index;\n if (cmp < 0) break;\n }\n return index;\n}\n\nfunction compare(a: SourceMapSegment, b: SourceMapSegment): number {\n let cmp = compareNum(a.length, b.length);\n if (cmp !== 0) return cmp;\n\n // We've already checked genColumn\n if (a.length === 1) return 0;\n\n cmp = compareNum(a[1], b[1]!);\n if (cmp !== 0) return cmp;\n cmp = compareNum(a[2], b[2]!);\n if (cmp !== 0) return cmp;\n cmp = compareNum(a[3], b[3]!);\n if (cmp !== 0) return cmp;\n\n if (a.length === 4) return 0;\n return compareNum(a[4], b[4]!);\n}\n\nfunction compareNum(a: number, b: number): number {\n return a - b;\n}\n\nfunction insert(array: T[], index: number, value: T) {\n if (index === -1) return;\n for (let i = array.length; i > index; i--) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n}\n"],"names":["addSegment","addMapping","setSourceContent","decodedMap","encodedMap","allMappings","SetArray","put","encode"],"mappings":";;;;;;IAaA;;;IAGG;AACQA,gCA4BT;IAEF;;;IAGG;AACQC,gCA4BT;IAEF;;IAEG;AACQC,sCAAoF;IAE/F;;;IAGG;AACQC,gCAAkD;IAE7D;;;IAGG;AACQC,gCAAkD;IAE7D;;;IAGG;AACQC,iCAA4C;IAEvD;;IAEG;UACU,UAAU,CAAA;IAQrB,IAAA,WAAA,CAAY,EAAE,IAAI,EAAE,UAAU,KAAc,EAAE,EAAA;IAPtC,QAAA,IAAA,CAAA,MAAM,GAAG,IAAIC,iBAAQ,EAAE,CAAC;IACxB,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAIA,iBAAQ,EAAE,CAAC;YAC1B,IAAe,CAAA,eAAA,GAAsB,EAAE,CAAC;YACxC,IAAS,CAAA,SAAA,GAAyB,EAAE,CAAC;IAK3C,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACjB,QAAA,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;SAC9B;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K,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,KAAA;IACD,IAAA,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;IACvB;;;;;;;;;;"}dist/gen-mapping.mjs000066600000013116150434534160010437 0ustar00import { SetArray, put } from '@jridgewell/set-array'; import { encode } from '@jridgewell/sourcemap-codec'; /** * A low-level API to associate a generated position with an original source position. Line and * column here are 0-based, unlike `addMapping`. */ let addSegment; /** * A high-level API to associate a generated position with an original source position. Line is * 1-based, but column is 0-based, due to legacy behavior in `source-map` library. */ let addMapping; /** * Adds/removes the content of the source file to the source map. */ let setSourceContent; /** * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects * a sourcemap, or to JSON.stringify. */ let decodedMap; /** * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects * a sourcemap, or to JSON.stringify. */ let encodedMap; /** * Returns an array of high-level mapping objects for every recorded segment, which could then be * passed to the `source-map` library. */ let allMappings; /** * Provides the state to generate a sourcemap. */ class GenMapping { constructor({ file, sourceRoot } = {}) { this._names = new SetArray(); this._sources = new SetArray(); this._sourcesContent = []; this._mappings = []; this.file = file; this.sourceRoot = sourceRoot; } } (() => { addSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name) => { const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map; const line = getLine(mappings, genLine); if (source == null) { const seg = [genColumn]; const index = getColumnIndex(line, genColumn, seg); return insert(line, index, seg); } const sourcesIndex = put(sources, source); const seg = name ? [genColumn, sourcesIndex, sourceLine, sourceColumn, put(names, name)] : [genColumn, sourcesIndex, sourceLine, sourceColumn]; const index = getColumnIndex(line, genColumn, seg); if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = null; insert(line, index, seg); }; addMapping = (map, mapping) => { const { generated, source, original, name } = mapping; return addSegment(map, generated.line - 1, generated.column, source, original == null ? undefined : original.line - 1, original === null || original === void 0 ? void 0 : original.column, name); }; setSourceContent = (map, source, content) => { const { _sources: sources, _sourcesContent: sourcesContent } = map; sourcesContent[put(sources, source)] = content; }; decodedMap = (map) => { const { file, sourceRoot, _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map; return { version: 3, file, names: names.array, sourceRoot: sourceRoot || undefined, sources: sources.array, sourcesContent, mappings, }; }; encodedMap = (map) => { const decoded = decodedMap(map); return Object.assign(Object.assign({}, decoded), { mappings: encode(decoded.mappings) }); }; allMappings = (map) => { const out = []; const { _mappings: mappings, _sources: sources, _names: names } = map; for (let i = 0; i < mappings.length; i++) { const line = mappings[i]; for (let j = 0; j < line.length; j++) { const seg = line[j]; const generated = { line: i + 1, column: seg[0] }; let source = undefined; let original = undefined; let name = undefined; if (seg.length !== 1) { source = sources.array[seg[1]]; original = { line: seg[2] + 1, column: seg[3] }; if (seg.length === 5) name = names.array[seg[4]]; } out.push({ generated, source, original, name }); } } return out; }; })(); function getLine(mappings, index) { for (let i = mappings.length; i <= index; i++) { mappings[i] = []; } return mappings[index]; } function getColumnIndex(line, column, seg) { let index = line.length; for (let i = index - 1; i >= 0; i--, index--) { const current = line[i]; const col = current[0]; if (col > column) continue; if (col < column) break; const cmp = compare(current, seg); if (cmp === 0) return index; if (cmp < 0) break; } return index; } function compare(a, b) { let cmp = compareNum(a.length, b.length); if (cmp !== 0) return cmp; // We've already checked genColumn if (a.length === 1) return 0; cmp = compareNum(a[1], b[1]); if (cmp !== 0) return cmp; cmp = compareNum(a[2], b[2]); if (cmp !== 0) return cmp; cmp = compareNum(a[3], b[3]); if (cmp !== 0) return cmp; if (a.length === 4) return 0; return compareNum(a[4], b[4]); } function compareNum(a, b) { return a - b; } function insert(array, index, value) { if (index === -1) return; for (let i = array.length; i > index; i--) { array[i] = array[i - 1]; } array[index] = value; } export { GenMapping, addMapping, addSegment, allMappings, decodedMap, encodedMap, setSourceContent }; //# sourceMappingURL=gen-mapping.mjs.map dist/types/types.d.ts000066600000001464150434534160010627 0ustar00import type { SourceMapSegment } from './sourcemap-segment'; export interface SourceMapV3 { file?: string | null; names: readonly string[]; sourceRoot?: string; sources: readonly (string | null)[]; sourcesContent?: readonly (string | null)[]; version: 3; } export interface EncodedSourceMap extends SourceMapV3 { mappings: string; } export interface DecodedSourceMap extends SourceMapV3 { mappings: readonly SourceMapSegment[][]; } export interface Pos { line: number; column: number; } export declare type Mapping = { generated: Pos; source: undefined; original: undefined; name: undefined; } | { generated: Pos; source: string; original: Pos; name: string; } | { generated: Pos; source: string; original: Pos; name: undefined; }; dist/types/gen-mapping.d.ts000066600000005057150434534160011667 0ustar00import type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types'; export type { DecodedSourceMap, EncodedSourceMap, Mapping }; export declare type Options = { file?: string | null; sourceRoot?: string | null; }; /** * A low-level API to associate a generated position with an original source position. Line and * column here are 0-based, unlike `addMapping`. */ export declare let addSegment: { (map: GenMapping, genLine: number, genColumn: number, source?: null, sourceLine?: null, sourceColumn?: null, name?: null): void; (map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name?: null): void; (map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name: string): void; }; /** * A high-level API to associate a generated position with an original source position. Line is * 1-based, but column is 0-based, due to legacy behavior in `source-map` library. */ export declare let addMapping: { (map: GenMapping, mapping: { generated: Pos; source?: null; original?: null; name?: null; }): void; (map: GenMapping, mapping: { generated: Pos; source: string; original: Pos; name?: null; }): void; (map: GenMapping, mapping: { generated: Pos; source: string; original: Pos; name: string; }): void; }; /** * Adds/removes the content of the source file to the source map. */ export declare let setSourceContent: (map: GenMapping, source: string, content: string | null) => void; /** * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects * a sourcemap, or to JSON.stringify. */ export declare let decodedMap: (map: GenMapping) => DecodedSourceMap; /** * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects * a sourcemap, or to JSON.stringify. */ export declare let encodedMap: (map: GenMapping) => EncodedSourceMap; /** * Returns an array of high-level mapping objects for every recorded segment, which could then be * passed to the `source-map` library. */ export declare let allMappings: (map: GenMapping) => Mapping[]; /** * Provides the state to generate a sourcemap. */ export declare class GenMapping { private _names; private _sources; private _sourcesContent; private _mappings; file: string | null | undefined; sourceRoot: string | null | undefined; constructor({ file, sourceRoot }?: Options); } dist/types/sourcemap-segment.d.ts000066600000001071150434534160013113 0ustar00declare type GeneratedColumn = number; declare type SourcesIndex = number; declare type SourceLine = number; declare type SourceColumn = number; declare type NamesIndex = number; export declare type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; export declare const COLUMN = 0; export declare const SOURCES_INDEX = 1; export declare const SOURCE_LINE = 2; export declare const SOURCE_COLUMN = 3; export declare const NAMES_INDEX = 4; export {}; dist/gen-mapping.mjs.map000066600000032525150434534160011220 0ustar00{"version":3,"file":"gen-mapping.mjs","sources":["../../src/gen-mapping.ts"],"sourcesContent":["import { SetArray, put } from '@jridgewell/set-array';\nimport { encode } from '@jridgewell/sourcemap-codec';\n\nimport type { SourceMapSegment } from './sourcemap-segment';\nimport type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types';\n\nexport type { DecodedSourceMap, EncodedSourceMap, Mapping };\n\nexport type Options = {\n file?: string | null;\n sourceRoot?: string | null;\n};\n\n/**\n * A low-level API to associate a generated position with an original source position. Line and\n * column here are 0-based, unlike `addMapping`.\n */\nexport let addSegment: {\n (\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source?: null,\n sourceLine?: null,\n sourceColumn?: null,\n name?: null,\n ): void;\n (\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source: string,\n sourceLine: number,\n sourceColumn: number,\n name?: null,\n ): void;\n (\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source: string,\n sourceLine: number,\n sourceColumn: number,\n name: string,\n ): void;\n};\n\n/**\n * A high-level API to associate a generated position with an original source position. Line is\n * 1-based, but column is 0-based, due to legacy behavior in `source-map` library.\n */\nexport let addMapping: {\n (\n map: GenMapping,\n mapping: {\n generated: Pos;\n source?: null;\n original?: null;\n name?: null;\n },\n ): void;\n (\n map: GenMapping,\n mapping: {\n generated: Pos;\n source: string;\n original: Pos;\n name?: null;\n },\n ): void;\n (\n map: GenMapping,\n mapping: {\n generated: Pos;\n source: string;\n original: Pos;\n name: string;\n },\n ): void;\n};\n\n/**\n * Adds/removes the content of the source file to the source map.\n */\nexport let setSourceContent: (map: GenMapping, source: string, content: string | null) => void;\n\n/**\n * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let decodedMap: (map: GenMapping) => DecodedSourceMap;\n\n/**\n * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let encodedMap: (map: GenMapping) => EncodedSourceMap;\n\n/**\n * Returns an array of high-level mapping objects for every recorded segment, which could then be\n * passed to the `source-map` library.\n */\nexport let allMappings: (map: GenMapping) => Mapping[];\n\n/**\n * Provides the state to generate a sourcemap.\n */\nexport class GenMapping {\n private _names = new SetArray();\n private _sources = new SetArray();\n private _sourcesContent: (string | null)[] = [];\n private _mappings: SourceMapSegment[][] = [];\n declare file: string | null | undefined;\n declare sourceRoot: string | null | undefined;\n\n constructor({ file, sourceRoot }: Options = {}) {\n this.file = file;\n this.sourceRoot = sourceRoot;\n }\n\n static {\n addSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name) => {\n const {\n _mappings: mappings,\n _sources: sources,\n _sourcesContent: sourcesContent,\n _names: names,\n } = map;\n\n const line = getLine(mappings, genLine);\n if (source == null) {\n const seg: SourceMapSegment = [genColumn];\n const index = getColumnIndex(line, genColumn, seg);\n return insert(line, index, seg);\n }\n\n // Sigh, TypeScript can't figure out sourceLine and sourceColumn aren't nullish if source\n // isn't nullish.\n assert(sourceLine);\n assert(sourceColumn);\n const sourcesIndex = put(sources, source);\n const seg: SourceMapSegment = name\n ? [genColumn, sourcesIndex, sourceLine, sourceColumn, put(names, name)]\n : [genColumn, sourcesIndex, sourceLine, sourceColumn];\n\n const index = getColumnIndex(line, genColumn, seg);\n if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = null;\n insert(line, index, seg);\n };\n\n addMapping = (map, mapping) => {\n const { generated, source, original, name } = mapping;\n return (addSegment as any)(\n map,\n generated.line - 1,\n generated.column,\n source,\n original == null ? undefined : original.line - 1,\n original?.column,\n name,\n );\n };\n\n setSourceContent = (map, source, content) => {\n const { _sources: sources, _sourcesContent: sourcesContent } = map;\n sourcesContent[put(sources, source)] = content;\n };\n\n decodedMap = (map) => {\n const {\n file,\n sourceRoot,\n _mappings: mappings,\n _sources: sources,\n _sourcesContent: sourcesContent,\n _names: names,\n } = map;\n\n return {\n version: 3,\n file,\n names: names.array,\n sourceRoot: sourceRoot || undefined,\n sources: sources.array,\n sourcesContent,\n mappings,\n };\n };\n\n encodedMap = (map) => {\n const decoded = decodedMap(map);\n return {\n ...decoded,\n mappings: encode(decoded.mappings as SourceMapSegment[][]),\n };\n };\n\n allMappings = (map) => {\n const out: Mapping[] = [];\n const { _mappings: mappings, _sources: sources, _names: names } = map;\n\n for (let i = 0; i < mappings.length; i++) {\n const line = mappings[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n\n const generated = { line: i + 1, column: seg[0] };\n let source: string | undefined = undefined;\n let original: Pos | undefined = undefined;\n let name: string | undefined = undefined;\n\n if (seg.length !== 1) {\n source = sources.array[seg[1]];\n original = { line: seg[2] + 1, column: seg[3] };\n\n if (seg.length === 5) name = names.array[seg[4]];\n }\n\n out.push({ generated, source, original, name } as Mapping);\n }\n }\n\n return out;\n };\n }\n}\n\nfunction assert(_val: unknown): asserts _val is T {\n // noop.\n}\n\nfunction getLine(mappings: SourceMapSegment[][], index: number): SourceMapSegment[] {\n for (let i = mappings.length; i <= index; i++) {\n mappings[i] = [];\n }\n return mappings[index];\n}\n\nfunction getColumnIndex(line: SourceMapSegment[], column: number, seg: SourceMapSegment): number {\n let index = line.length;\n for (let i = index - 1; i >= 0; i--, index--) {\n const current = line[i];\n const col = current[0];\n if (col > column) continue;\n if (col < column) break;\n\n const cmp = compare(current, seg);\n if (cmp === 0) return index;\n if (cmp < 0) break;\n }\n return index;\n}\n\nfunction compare(a: SourceMapSegment, b: SourceMapSegment): number {\n let cmp = compareNum(a.length, b.length);\n if (cmp !== 0) return cmp;\n\n // We've already checked genColumn\n if (a.length === 1) return 0;\n\n cmp = compareNum(a[1], b[1]!);\n if (cmp !== 0) return cmp;\n cmp = compareNum(a[2], b[2]!);\n if (cmp !== 0) return cmp;\n cmp = compareNum(a[3], b[3]!);\n if (cmp !== 0) return cmp;\n\n if (a.length === 4) return 0;\n return compareNum(a[4], b[4]!);\n}\n\nfunction compareNum(a: number, b: number): number {\n return a - b;\n}\n\nfunction insert(array: T[], index: number, value: T) {\n if (index === -1) return;\n for (let i = array.length; i > index; i--) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n}\n"],"names":[],"mappings":";;;AAaA;;;AAGG;AACQ,IAAA,WA4BT;AAEF;;;AAGG;AACQ,IAAA,WA4BT;AAEF;;AAEG;AACQ,IAAA,iBAAoF;AAE/F;;;AAGG;AACQ,IAAA,WAAkD;AAE7D;;;AAGG;AACQ,IAAA,WAAkD;AAE7D;;;AAGG;AACQ,IAAA,YAA4C;AAEvD;;AAEG;MACU,UAAU,CAAA;AAQrB,IAAA,WAAA,CAAY,EAAE,IAAI,EAAE,UAAU,KAAc,EAAE,EAAA;AAPtC,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;AACxB,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC1B,IAAe,CAAA,eAAA,GAAsB,EAAE,CAAC;QACxC,IAAS,CAAA,SAAA,GAAyB,EAAE,CAAC;AAK3C,QAAA,IAAI,CAAC,IAAI,GAAG,IA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CAAC,EAAE,EAAE;QACzC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AACzB,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;AACvB;;;;"}LICENSE000066600000002070150434534160005561 0ustar00Copyright 2022 Justin Ridgewell Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. package.json000066600000004272150434534160007050 0ustar00{ "name": "@jridgewell/gen-mapping", "version": "0.1.1", "description": "Generate source maps", "keywords": [ "source", "map" ], "author": "Justin Ridgewell ", "license": "MIT", "repository": "https://github.com/jridgewell/gen-mapping", "main": "dist/gen-mapping.umd.js", "module": "dist/gen-mapping.mjs", "typings": "dist/types/gen-mapping.d.ts", "exports": { ".": { "browser": "./dist/gen-mapping.umd.js", "require": "./dist/gen-mapping.umd.js", "import": "./dist/gen-mapping.mjs" }, "./package.json": "./package.json" }, "files": [ "dist" ], "engines": { "node": ">=6.0.0" }, "scripts": { "benchmark": "run-s build:rollup benchmark:*", "benchmark:install": "cd benchmark && npm install", "benchmark:only": "node benchmark/index.mjs", "prebuild": "rm -rf dist", "build": "run-s -n build:*", "build:rollup": "rollup -c rollup.config.js", "build:ts": "tsc --project tsconfig.build.json", "lint": "run-s -n lint:*", "lint:prettier": "npm run test:lint:prettier -- --write", "lint:ts": "npm run test:lint:ts -- --fix", "pretest": "run-s build:rollup", "test": "run-s -n test:lint test:coverage", "test:debug": "mocha --inspect-brk", "test:lint": "run-s -n test:lint:*", "test:lint:prettier": "prettier --check '{src,test}/**/*.ts'", "test:lint:ts": "eslint '{src,test}/**/*.ts'", "test:only": "mocha", "test:coverage": "c8 mocha", "test:watch": "run-p 'build:rollup -- --watch' 'test:only -- --watch'", "prepublishOnly": "npm run preversion", "preversion": "run-s test build" }, "devDependencies": { "@rollup/plugin-typescript": "8.3.2", "@types/mocha": "9.1.1", "@types/node": "17.0.29", "@typescript-eslint/eslint-plugin": "5.21.0", "@typescript-eslint/parser": "5.21.0", "benchmark": "2.1.4", "c8": "7.11.2", "eslint": "8.14.0", "eslint-config-prettier": "8.5.0", "mocha": "9.2.2", "npm-run-all": "4.1.5", "prettier": "2.6.2", "rollup": "2.70.2", "typescript": "4.6.3" }, "dependencies": { "@jridgewell/set-array": "^1.0.0", "@jridgewell/sourcemap-codec": "^1.4.10" } }