@remotex-labs/xmap 2.0.3 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/providers/mapping.provider.ts"],
4
- "sourceRoot": "https://github.com/remotex-lab/xmap/tree/2.0.3/",
5
- "sourcesContent": ["/**\n * Import will remove at compile time\n */\n\nimport type { MapType, FrameType, SegmentInterface, SegmentOffsetInterface } from './interfaces/mapping.interface.js';\n\n/**\n * Imports\n */\n\nimport { Bias } from './interfaces/mapping.interface.js';\nimport { decodeVLQ, encodeArrayVLQ } from '../components/base64.component.js';\n\n/**\n * The `MappingProvider` class provides methods to encode and decode mappings\n * from a source map or mapping string to an internal structured representation.\n */\n\nexport class MappingProvider {\n /**\n * The internal mapping representation, where each index represents a frame of segments.\n */\n\n private mapping: MapType = [];\n\n /**\n * Constructor to initialize the `MappingProvider` with a mapping.\n * Can be initialized with either a mapping string or a structured mapping array.\n *\n * @param mapping - The mapping data, either as a string or structured array.\n * @param namesOffset - Optional offset for the names index.\n * @param sourceOffset - Optional offset for the sources index.\n *\n * @example\n * ```ts\n * const provider = new MappingProvider(\";;;AAiBO,SAAS,OAAO;AACnB,UAAQ,IAAI,MAAM;AACtB;;;ACjBA,QAAQ,IAAI,GAAG;AACf,KAAK;\", 0, 0);\n * const provider2 = new MappingProvider([\n * null,\n * [\n * {\n * line: 1,\n * column: 1,\n * nameIndex: null,\n * sourceIndex: 0,\n * generatedLine: 2,\n * generatedColumn: 1\n * }\n * ],\n * null\n * ], 0, 0);\n * ```\n */\n\n constructor(mapping: string, namesOffset?: number, sourceOffset?: number);\n constructor(mapping: MapType, namesOffset?: number, sourceOffset?: number);\n constructor(mapping: MappingProvider, namesOffset?: number, sourceOffset?: number);\n constructor(mapping: MappingProvider| MapType | string, namesOffset = 0, sourcesOffset = 0) {\n mapping = mapping instanceof MappingProvider ? mapping.mapping : mapping;\n if (Array.isArray(mapping)) {\n this.decodeMappingArray(mapping, namesOffset, sourcesOffset);\n } else {\n this.decodeMappingString(mapping, namesOffset, sourcesOffset);\n }\n }\n\n /**\n * Encodes the internal mapping array back into a mapping string.\n *\n * @returns {string} - The encoded mapping string.\n * @example\n * ```ts\n * const encoded = provider.encode();\n * console.log(encoded); // Outputs encoded mapping string\n * ```\n */\n\n encode(): string {\n return this.encodeMappings(this.mapping);\n }\n\n /**\n * Decodes a mapping from either a string or structured array into the internal mapping.\n *\n * @param mapping - The mapping data to decode.\n * @param namesOffset - Offset for the names index.\n * @param sourcesOffset - Offset for the sources index.\n * @example\n * ```ts\n * provider.decode(\";;;AAiBO,SAAS,OAAO;AACnB,UAAQ,IAAI,MAAM;AACtB;;;ACjBA,QAAQ,IAAI,GAAG;AACf,KAAK;\", 0, 0);\n * provider.decode([\n * null,\n * [\n * {\n * line: 1,\n * column: 1,\n * nameIndex: null,\n * sourceIndex: 0,\n * generatedLine: 2,\n * generatedColumn: 1\n * }\n * ],\n * null\n * ], 0, 0);\n * ```\n */\n\n decode(mapping: MappingProvider| MapType | string, namesOffset = 0, sourcesOffset = 0): void {\n mapping = mapping instanceof MappingProvider ? mapping.mapping : mapping;\n if (Array.isArray(mapping)) {\n this.decodeMappingArray(mapping, namesOffset, sourcesOffset);\n } else {\n this.decodeMappingString(mapping, namesOffset, sourcesOffset);\n }\n }\n\n /**\n * Retrieves a segment based on the provided generated line and column,\n * applying the specified bias when the exact match is not found.\n *\n * This method performs a binary search on the segments of the specified\n * generated line to efficiently locate the segment corresponding to\n * the provided generated column. If an exact match is not found,\n * the method returns the closest segment based on the specified bias:\n * - `Bias.BOUND`: No preference for column matching (returns the closest segment).\n * - `Bias.LOWER_BOUND`: Prefers the closest mapping with a lower column value.\n * - `Bias.UPPER_BOUND`: Prefers the closest mapping with a higher column value.\n *\n * @param generatedLine - The line number of the generated code (1-based index).\n * @param generatedColumn - The column number of the generated code (0-based index).\n * @param bias - The bias to use when the line matches, can be one of:\n * - `Bias.BOUND` (default): No preference for column matching.\n * - `Bias.LOWER_BOUND`: Prefer the closest mapping with a lower column value.\n * - `Bias.UPPER_BOUND`: Prefer the closest mapping with a higher column value.\n * @returns The matching segment if found;\n * returns null if no segments exist for the specified generated line\n * or if the generated line is out of bounds.\n *\n * @throws { Error } - Throws an error if the generated line is invalid\n * (out of bounds).\n *\n * @example\n * ```ts\n * const segment = sourceMap.getSegment(5, 10, Bias.UPPER_BOUND);\n * if (segment) {\n * console.log(`Found segment: line ${segment.line}, column ${segment.column}`);\n * } else {\n * console.log('No matching segment found.');\n * }\n * ```\n */\n\n getSegment(generatedLine: number, generatedColumn: number, bias: Bias = Bias.BOUND): SegmentInterface | null {\n const segments = this.mapping[generatedLine - 1];\n if (!segments || segments.length === 0)\n return null;\n\n let low = 0;\n let high = segments.length - 1;\n let closestSegment: SegmentInterface | null = null;\n while (low <= high) {\n const mid = Math.floor((low + high) / 2);\n const segment = segments[mid];\n\n if (segment.generatedColumn < generatedColumn) {\n low = mid + 1;\n closestSegment = bias === Bias.LOWER_BOUND ? segment : closestSegment;\n } else if (segment.generatedColumn > generatedColumn) {\n high = mid - 1;\n closestSegment = bias === Bias.UPPER_BOUND ? segment : closestSegment;\n } else {\n return segment;\n }\n }\n\n return closestSegment;\n }\n\n /**\n * Retrieves the original segment based on the provided line, column, and source index.\n *\n * This method searches for the original segment that corresponds to the specified\n * line, column, and source index. It uses binary search to find the closest segment\n * based on the provided bias.\n *\n * @param line - The line number of the original code (1-based index).\n * @param column - The column number of the original code (0-based index).\n * @param sourceIndex - The index of the source file in the source map.\n * @param bias - The bias to apply when multiple segments match; defaults to `Bias.BOUND`.\n * @returns {SegmentInterface | null} - The matching original segment if found;\n * returns null if no segments exist for the specified line and source index.\n *\n * @example\n * ```ts\n * const originalSegment = sourceMap.getOriginalSegment(3, 5, 0, Bias.LOWER_BOUND);\n * if (originalSegment) {\n * console.log(`Found original segment: line ${originalSegment.line}, column ${originalSegment.column}`);\n * } else {\n * console.log('No matching original segment found.');\n * }\n * ```\n */\n\n getOriginalSegment(line: number, column: number, sourceIndex: number, bias: Bias = Bias.BOUND): SegmentInterface | null {\n let closestSegment: SegmentInterface | null = null;\n for (const segments of this.mapping) {\n if (!segments)\n continue;\n\n let low = 0;\n let high = segments.length - 1;\n while (low <= high) {\n const mid = Math.floor((low + high) / 2);\n const midSegment = segments[mid];\n\n if (midSegment.sourceIndex < sourceIndex || midSegment.line < line) {\n low = mid + 1;\n } else if (midSegment.sourceIndex > sourceIndex || midSegment.line > line) {\n high = mid - 1;\n } else if (midSegment.column < column) {\n low = mid + 1;\n closestSegment = bias === Bias.LOWER_BOUND ? midSegment : closestSegment;\n } else if (midSegment.column > column) {\n high = mid - 1;\n closestSegment = bias === Bias.UPPER_BOUND ? midSegment : closestSegment;\n } else {\n return midSegment;\n }\n }\n }\n\n return closestSegment;\n }\n\n /**\n * Initializes the segment offsets used to track the current decoding position.\n *\n * @param namesOffset - The offset for the names index.\n * @param sourceIndex - The offset for the source index.\n * @returns { SegmentOffsetInterface } - The initialized segment offset.\n */\n\n private initPositionOffsets(namesOffset: number = 0, sourceIndex: number = 0): SegmentOffsetInterface {\n return {\n line: 0,\n column: 0,\n nameIndex: namesOffset,\n sourceIndex: sourceIndex,\n generatedLine: 0,\n generatedColumn: 0\n };\n }\n\n /**\n * Validates the format of an encoded mapping string.\n *\n * @param encodedSourceMap - The encoded source map string to validate.\n * @returns Returns `true` if the format is valid, otherwise `false`.\n */\n\n private validateMappingString(encodedSourceMap: string): boolean {\n // /^(;+)?([a-z0-9+/]{1,10}(,|;+)?)+$/\n return /^[a-zA-Z0-9+/,;]+$/.test(encodedSourceMap);\n }\n\n /**\n * Validates the properties of a segment to ensure they conform to expected types.\n *\n * This method checks that the segment's properties are finite numbers and that\n * the nameIndex, if provided, is either a finite number or null.\n * An error is thrown if any of the properties do not meet the specified criteria.\n *\n * @param segment - The segment object to validate, which must conform to the\n * SegmentInterface structure, including:\n * - line: number (finite)\n * - column: number (finite)\n * - nameIndex: number | null (if not null, must be finite)\n * - sourceIndex: number (finite)\n * - generatedLine: number (finite)\n * - generatedColumn: number (finite)\n *\n * @throws {Error} - Throws an error if any property of the segment is invalid.\n * The error message will specify which property is invalid\n * and the value that was received.\n */\n\n private validateSegment(segment: SegmentInterface): void {\n if (!Number.isFinite(segment.line)) {\n throw new Error(`Invalid segment: line must be a finite number, received ${segment.line}`);\n }\n if (!Number.isFinite(segment.column)) {\n throw new Error(`Invalid segment: column must be a finite number, received ${segment.column}`);\n }\n if (segment.nameIndex !== null && !Number.isFinite(segment.nameIndex)) {\n throw new Error(`Invalid segment: nameIndex must be a number or null, received ${segment.nameIndex}`);\n }\n if (!Number.isFinite(segment.sourceIndex)) {\n throw new Error(`Invalid segment: sourceIndex must be a finite number, received ${segment.sourceIndex}`);\n }\n if (!Number.isFinite(segment.generatedLine)) {\n throw new Error(`Invalid segment: generatedLine must be a finite number, received ${segment.generatedLine}`);\n }\n if (!Number.isFinite(segment.generatedColumn)) {\n throw new Error(`Invalid segment: generatedColumn must be a finite number, received ${segment.generatedColumn}`);\n }\n }\n\n /**\n * Encodes a segment into a VLQ-encoded string based on the segment offsets.\n *\n * @param segmentOffset - The current segment offset.\n * @param segmentObject - The segment to encode.\n * @returns The encoded segment string.\n */\n\n private encodeSegment(segmentOffset: SegmentOffsetInterface, segmentObject: SegmentInterface): string {\n const { line, column, generatedColumn, nameIndex, sourceIndex } = segmentObject;\n const adjustedLine = line - 1;\n const adjustedColumn = column - 1;\n const adjustedGeneratedColumn = generatedColumn - 1;\n\n const segment: Array<number> = [\n adjustedGeneratedColumn - segmentOffset.generatedColumn, // generatedColumn difference\n sourceIndex !== segmentOffset.sourceIndex ? sourceIndex - segmentOffset.sourceIndex : 0, // sourceIndex difference\n adjustedLine - segmentOffset.line, // line difference\n adjustedColumn - segmentOffset.column // column difference\n ];\n\n if (nameIndex !== null && nameIndex !== undefined) {\n segment[4] = nameIndex - segmentOffset.nameIndex; // nameIndex difference\n segmentOffset.nameIndex = nameIndex;\n }\n\n segmentOffset.line = adjustedLine;\n segmentOffset.column = adjustedColumn;\n segmentOffset.generatedColumn = adjustedGeneratedColumn;\n segmentOffset.sourceIndex = sourceIndex;\n\n return encodeArrayVLQ(segment);\n }\n\n /**\n * Encodes the entire mapping array into a VLQ-encoded mapping string.\n *\n * @param map - The mapping array to encode.\n * @returns The encoded mapping string.\n */\n\n private encodeMappings(map: MapType): string {\n const positionOffset = this.initPositionOffsets();\n\n return map.map(frame => {\n if (!frame)\n return '';\n\n positionOffset.generatedColumn = 0;\n const segments = frame.map(segment => this.encodeSegment(positionOffset, segment));\n\n return segments.join(',');\n }).join(';');\n }\n\n /**\n * Decodes a VLQ-encoded segment into a segment object based on the current offset.\n *\n * @param segmentOffset - The current segment offset.\n * @param decodedSegment - The decoded VLQ segment values.\n * @returns The decoded segment object.\n */\n\n private decodedSegment(segmentOffset: SegmentOffsetInterface, decodedSegment: Array<number>): SegmentInterface {\n const [ generatedColumn, sourceIndex, sourceLine, sourceColumn, nameIndex ] = decodedSegment;\n segmentOffset.line += sourceLine;\n segmentOffset.column += sourceColumn;\n segmentOffset.nameIndex += nameIndex ?? 0;\n segmentOffset.sourceIndex += sourceIndex;\n segmentOffset.generatedColumn += generatedColumn;\n\n return {\n line: segmentOffset.line + 1,\n column: segmentOffset.column + 1,\n nameIndex: nameIndex !== undefined ? segmentOffset.nameIndex : null,\n sourceIndex: segmentOffset.sourceIndex,\n generatedLine: segmentOffset.generatedLine + 1,\n generatedColumn: segmentOffset.generatedColumn + 1\n };\n }\n\n /**\n * Decodes a VLQ-encoded mapping string into the internal mapping representation.\n *\n * @param encodedMap - The VLQ-encoded mapping string.\n * @param namesOffset - Offset for the names index.\n * @param sourceOffset - Offset for the sources index.\n * @throws { Error } - Throws an error if the mapping string is invalid.\n */\n\n private decodeMappingString(encodedMap: string, namesOffset: number, sourceOffset: number): void {\n if (!this.validateMappingString(encodedMap))\n throw new Error('Invalid Mappings string format: the provided string does not conform to expected VLQ format.');\n\n const frames = encodedMap.split(';');\n const linesOffset = this.mapping.length;\n const positionOffset = this.initPositionOffsets(namesOffset, sourceOffset);\n try {\n frames.forEach((frame, index) => {\n if (!frame) {\n this.mapping.push(null);\n\n return;\n }\n\n positionOffset.generatedColumn = 0;\n positionOffset.generatedLine = linesOffset + index;\n const segmentsArray: Array<SegmentInterface> = frame.split(',')\n .map(segment => this.decodedSegment(positionOffset, decodeVLQ(segment)));\n\n this.mapping.push(segmentsArray);\n });\n } catch (error) {\n throw new Error(`Error decoding mappings at frame index ${frames.length}: ${(<Error>error).message}`);\n }\n }\n\n /**\n * Decodes a mapping array into the internal mapping representation, adjusting for offsets.\n *\n * This method processes each frame in the provided structured mapping array,\n * validating each segment within the frame and adjusting the indices based on the\n * specified offsets for names and sources. If a frame is invalid or not an array,\n * an error will be thrown.\n *\n * @param encodedMap - The structured mapping array, which should be an array of frames,\n * where each frame is an array of segments. Each segment must conform\n * to the SegmentInterface.\n * @param namesOffset - Offset for the names index, which will be added to each segment's nameIndex.\n * @param sourceOffset - Offset for the sources index, which will be added to each segment's sourceIndex.\n * @throws { Error } - Throws an error if:\n * - The mapping array is invalid (not an array).\n * - Any frame is not an array.\n * - Any segment does not conform to the SegmentInterface.\n */\n\n private decodeMappingArray(encodedMap: MapType, namesOffset: number, sourceOffset: number): void {\n const linesOffset = this.mapping.length;\n if (!Array.isArray(encodedMap))\n throw new Error('Invalid encoded map: expected an array of frames.');\n\n try {\n encodedMap.forEach((frame, index) => {\n if (!frame) {\n this.mapping.push(frame);\n\n return;\n }\n\n if (!Array.isArray(frame))\n throw new Error(`Invalid Mappings array format at frame index ${index}: expected an array, received ${typeof frame}.`);\n\n const segments: FrameType = frame.map(segment => {\n this.validateSegment(segment);\n\n return {\n ...segment,\n nameIndex: (typeof segment.nameIndex === 'number') ? segment.nameIndex + namesOffset : null,\n sourceIndex: segment.sourceIndex + sourceOffset,\n generatedLine: segment.generatedLine + linesOffset\n };\n });\n\n this.mapping.push(segments);\n });\n } catch (error: unknown) {\n const errorMessage = (error instanceof Error) ? error.message : 'Unknown error';\n throw new Error(`Error decoding mappings: ${errorMessage}`);\n }\n }\n}\n"],
6
- "mappings": "AAUA,OAAS,QAAAA,MAAY,oCACrB,OAAS,aAAAC,EAAW,kBAAAC,MAAsB,oCAOnC,MAAMC,CAAgB,CAKjB,QAAmB,CAAC,EAiC5B,YAAYC,EAA4CC,EAAc,EAAGC,EAAgB,EAAG,CACxFF,EAAUA,aAAmBD,EAAkBC,EAAQ,QAAUA,EAC7D,MAAM,QAAQA,CAAO,EACrB,KAAK,mBAAmBA,EAASC,EAAaC,CAAa,EAE3D,KAAK,oBAAoBF,EAASC,EAAaC,CAAa,CAEpE,CAaA,QAAiB,CACb,OAAO,KAAK,eAAe,KAAK,OAAO,CAC3C,CA4BA,OAAOF,EAA4CC,EAAc,EAAGC,EAAgB,EAAS,CACzFF,EAAUA,aAAmBD,EAAkBC,EAAQ,QAAUA,EAC7D,MAAM,QAAQA,CAAO,EACrB,KAAK,mBAAmBA,EAASC,EAAaC,CAAa,EAE3D,KAAK,oBAAoBF,EAASC,EAAaC,CAAa,CAEpE,CAsCA,WAAWC,EAAuBC,EAAyBC,EAAaT,EAAK,MAAgC,CACzG,MAAMU,EAAW,KAAK,QAAQH,EAAgB,CAAC,EAC/C,GAAI,CAACG,GAAYA,EAAS,SAAW,EACjC,OAAO,KAEX,IAAIC,EAAM,EACNC,EAAOF,EAAS,OAAS,EACzBG,EAA0C,KAC9C,KAAOF,GAAOC,GAAM,CAChB,MAAME,EAAM,KAAK,OAAOH,EAAMC,GAAQ,CAAC,EACjCG,EAAUL,EAASI,CAAG,EAE5B,GAAIC,EAAQ,gBAAkBP,EAC1BG,EAAMG,EAAM,EACZD,EAAiBJ,IAAST,EAAK,YAAce,EAAUF,UAChDE,EAAQ,gBAAkBP,EACjCI,EAAOE,EAAM,EACbD,EAAiBJ,IAAST,EAAK,YAAce,EAAUF,MAEvD,QAAOE,CAEf,CAE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,IAAId,IAClC,KAAK,gBAAgBA,CAAO,EAErB,CACH,GAAGA,EACH,UAAY,OAAOA,EAAQ,WAAc,SAAYA,EAAQ,UAAYV,EAAc,KACvF,YAAaU,EAAQ,YAAcmB,EACnC,cAAenB,EAAQ,cAAgBqB,CAC3C,EACH,EAED,KAAK,QAAQ,KAAK1B,CAAQ,CAC9B,CAAC,CACL,OAAS6B,EAAgB,CACrB,MAAMC,EAAgBD,aAAiB,MAASA,EAAM,QAAU,gBAChE,MAAM,IAAI,MAAM,4BAA4BC,CAAY,EAAE,CAC9D,CACJ,CACJ",
7
- "names": ["Bias", "decodeVLQ", "encodeArrayVLQ", "MappingProvider", "mapping", "namesOffset", "sourcesOffset", "generatedLine", "generatedColumn", "bias", "segments", "low", "high", "closestSegment", "mid", "segment", "line", "column", "sourceIndex", "midSegment", "encodedSourceMap", "segmentOffset", "segmentObject", "nameIndex", "adjustedLine", "adjustedColumn", "adjustedGeneratedColumn", "map", "positionOffset", "frame", "decodedSegment", "sourceLine", "sourceColumn", "encodedMap", "sourceOffset", "frames", "linesOffset", "index", "segmentsArray", "error", "errorMessage"]
8
- }
@@ -1,4 +0,0 @@
1
- import{MappingProvider as m}from"../providers/mapping.provider.js";import{Bias as c}from"../providers/interfaces/mapping.interface.js";class l{file;mappings;sourceRoot;names;sources;sourcesContent;constructor(e,n=null){typeof e=="string"&&(e=JSON.parse(e)),e=e,this.validateSourceMap(e),this.file=e.file??n,this.names=[...e.names??[]],this.sources=[...e.sources??[]],this.sourceRoot=e.sourceRoot??null,this.sourcesContent=e.sourcesContent?[...e.sourcesContent]:[],this.mappings=new m(e.mappings)}getMapObject(){const e={version:3,names:this.names,sources:this.sources,mappings:this.mappings.encode(),sourcesContent:this.sourcesContent};return this.file&&(e.file=this.file),this.sourceRoot&&(e.sourceRoot=this.sourceRoot),e}concat(...e){if(e.length<1)throw new Error("At least one map must be provided for concatenation.");for(const n of e)this.mappings.decode(n.mappings,this.names.length,this.sources.length),this.names.push(...n.names),this.sources.push(...n.sources),this.sourcesContent.push(...n.sourcesContent??[])}concatNewMap(...e){if(e.length<1)throw new Error("At least one map must be provided for concatenation.");const n=new l(this);for(const t of e)n.mappings.decode(t.mappings,n.names.length,n.sources.length),n.names.push(...t.names),n.sources.push(...t.sources),n.sourcesContent.push(...t.sourcesContent??[]);return n}getPositionByOriginal(e,n,t,r=c.BOUND){let o=t;if(typeof t=="string"&&(o=this.sources.findIndex(i=>i.includes(t))),o<0)return null;const s=this.mappings.getOriginalSegment(e,n,o,r);return s?{name:this.names[s.nameIndex??-1]??null,line:s.line,column:s.column,source:this.sources[s.sourceIndex],sourceRoot:this.sourceRoot,sourceIndex:s.sourceIndex,generatedLine:s.generatedLine,generatedColumn:s.generatedColumn}:null}getPosition(e,n,t=c.BOUND){const r=this.mappings.getSegment(e,n,t);return r?{name:this.names[r.nameIndex??-1]??null,line:r.line,column:r.column,source:this.sources[r.sourceIndex],sourceRoot:this.sourceRoot,sourceIndex:r.sourceIndex,generatedLine:r.generatedLine,generatedColumn:r.generatedColumn}:null}getPositionWithContent(e,n,t=c.BOUND){const r=this.getPosition(e,n,t);return r?{...r,sourcesContent:this.sourcesContent[r.sourceIndex]}:null}getPositionWithCode(e,n,t=c.BOUND,r){const o=this.getPosition(e,n,t);if(!o||!this.sourcesContent[o.sourceIndex])return null;const s=Object.assign({linesAfter:4,linesBefore:3},r),i=this.sourcesContent[o.sourceIndex].split(`
2
- `),a=Math.min((o.line??1)+s.linesAfter,i.length),u=Math.max((o.line??1)-s.linesBefore,0),p=i.slice(u,Math.min(a+1,i.length)).join(`
3
- `);return{...o,code:p,endLine:a,startLine:u}}toString(){return JSON.stringify(this.getMapObject())}validateSourceMap(e){if(!["sources","mappings","names"].every(t=>t in e))throw new Error("Missing required keys in SourceMap.")}}export{l as SourceService};
4
- //# sourceMappingURL=source.service.js.map
@@ -1,8 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/services/source.service.ts"],
4
- "sourceRoot": "https://github.com/remotex-lab/xmap/tree/2.0.3/",
5
- "sourcesContent": ["/**\n * Import will remove at compile time\n */\n\nimport type {\n PositionInterface,\n SourceMapInterface,\n SourceOptionsInterface,\n PositionWithCodeInterface,\n PositionWithContentInterface\n} from './/interfaces/source.interface';\n\n/**\n * Imports\n */\n\nimport { MappingProvider } from '../providers/mapping.provider.js';\nimport { Bias } from '../providers/interfaces/mapping.interface.js';\n\n/**\n * A service for validating and processing source maps.\n * This class allows parsing and manipulation of source maps, providing functionality such as\n * retrieving position mappings between original and generated code, concatenating source maps,\n * and getting code snippets based on mappings.\n *\n * @example\n * ```ts\n * const sourceMapJSON = '{\"version\": 3, \"file\": \"bundle.js\", \"sources\": [\"foo.ts\"], \"names\": [], \"mappings\": \"AAAA\"}';\n * const sourceService = new SourceService(sourceMapJSON);\n *\n * console.log(sourceService.file); // Outputs: 'bundle.js'\n * ```\n */\n\nexport class SourceService {\n /**\n * The name of the generated file (bundle) that this source map applies to.\n *\n * @example\n * ```ts\n * console.log(sourceService.file); // 'bundle.js'\n * ```\n */\n\n readonly file: string | null;\n\n /**\n * A MappingProvider instance of base64 VLQ-encoded mappings.\n */\n\n readonly mappings: MappingProvider;\n\n /**\n * The root URL for the sources, if present in the source map.\n */\n\n readonly sourceRoot: string | null;\n\n /**\n * A list of symbol names used by the \u201Cmappings\u201D entry.\n */\n\n readonly names: Array<string>;\n\n /**\n * An array of source file paths.\n */\n\n readonly sources: Array<string>;\n\n /**\n * An array of source files contents.\n */\n\n readonly sourcesContent: Array<string>;\n\n /**\n * Creates a new instance of the `SourceService` class.\n *\n * This constructor initializes the class using either a `SourceMapInterface` object,\n * a JSON string representing the source map, or an existing `SourceService` instance.\n * It validates the source map and populates its properties such as `file`, `sources`, and `mappings`.\n *\n * @param source - Can be one of the following:\n * - An object conforming to the `SourceMapInterface`.\n * - A JSON string representing the source map.\n * - A `SourceService` instance to copy the properties.\n * @param file - (Optional) A string representing the file name of the generated bundle.\n * Defaults to `null`. It will overwrite any existing `file` property in the source map.\n * @throws {Error} - If the source map does not contain required properties or has an invalid format.\n *\n * @example\n * ```ts\n * const sourceMapJSON = '{\"version\": 3, \"file\": \"bundle.js\", \"sources\": [\"foo.ts\"], \"names\": [], \"mappings\": \"AAAA\"}';\n * const sourceService = new SourceService(sourceMapJSON);\n * ```\n */\n\n constructor(source: SourceService);\n constructor(source: SourceMapInterface | string, file?: string | null);\n constructor(source: SourceService | SourceMapInterface | string, file: string | null = null) {\n if (typeof source === 'string') {\n source = <SourceMapInterface> JSON.parse(source);\n }\n\n source = <SourceMapInterface> source;\n this.validateSourceMap(source);\n this.file = source.file ?? file;\n this.names = [ ...source.names ?? [] ];\n this.sources = [ ...source.sources ?? [] ];\n this.sourceRoot = source.sourceRoot ?? null;\n this.sourcesContent = source.sourcesContent ? [ ...source.sourcesContent ] : [];;\n this.mappings = new MappingProvider(source.mappings);\n }\n\n /**\n * Converts the current source map data into a plain object format.\n *\n * @returns The source map json object.\n *\n * @example\n * ```ts\n * const mapObject = sourceService.getMapObject();\n * console.log(mapObject.file); // 'bundle.js'\n * ```\n */\n\n getMapObject(): SourceMapInterface {\n const sourceMap: SourceMapInterface = {\n version: 3,\n names: this.names,\n sources: this.sources,\n mappings: this.mappings.encode(),\n sourcesContent: this.sourcesContent\n };\n\n if (this.file)\n sourceMap.file = this.file;\n\n if (this.sourceRoot)\n sourceMap.sourceRoot = this.sourceRoot;\n\n return sourceMap;\n }\n\n /**\n * Concatenates one or more source maps to the current source map.\n *\n * This method merges additional source maps into the current source map,\n * updating the `mappings`, `names`, `sources`, and `sourcesContent` arrays.\n *\n * @param maps - An array of `SourceMapInterface` or `SourceService` instances to be concatenated.\n * @throws { Error } If no source maps are provided for concatenation.\n *\n * @example\n * ```ts\n * sourceService.concat(anotherSourceMap);\n * console.log(sourceService.sources); // Updated source paths\n * ```\n */\n\n concat(...maps: Array<SourceMapInterface | SourceService>): void {\n if (maps.length < 1)\n throw new Error('At least one map must be provided for concatenation.');\n\n for (const map of (maps as Array<SourceMapInterface>)) {\n this.mappings.decode(map.mappings, this.names.length, this.sources.length);\n this.names.push(...map.names);\n this.sources.push(...map.sources);\n this.sourcesContent.push(...map.sourcesContent ?? []);\n }\n }\n\n /**\n * Creates a new instance of `SourceService` with concatenated source maps.\n *\n * @param maps - An array of `SourceMapInterface` or `SourceService` instances to be concatenated.\n * @returns { SourceService } A new `SourceService` instance with the concatenated maps.\n * @throws { Error } If no source maps are provided.\n *\n * @example\n * ```ts\n * const newService = sourceService.concatNewMap(anotherSourceMap);\n * console.log(newService.file); // The file from the new source map\n * ```\n */\n\n concatNewMap(...maps: Array<SourceMapInterface | SourceService>): SourceService {\n if (maps.length < 1)\n throw new Error('At least one map must be provided for concatenation.');\n\n const sourceService = new SourceService(this);\n for (const map of (maps as Array<SourceMapInterface>)) {\n sourceService.mappings.decode(map.mappings, sourceService.names.length, sourceService.sources.length);\n sourceService.names.push(...map.names);\n sourceService.sources.push(...map.sources);\n sourceService.sourcesContent.push(...map.sourcesContent ?? []);\n }\n\n return sourceService;\n }\n\n /**\n * Retrieves the position information based on the original source line and column.\n *\n * @param line - The line number in the generated code.\n * @param column - The column number in the generated code.\n * @param sourceIndex - The index or file path of the original source.\n * @param bias - The bias to use when matching positions (`Bias.LOWER_BOUND`, `Bias.UPPER_BOUND`, or `Bias.BOUND`).\n * @returns { PositionInterface | null } The corresponding position in the original source, or `null` if not found.\n *\n * @example\n * ```ts\n * const position = sourceService.getPositionByOriginal(1, 10, 'foo.ts');\n * console.log(position?.line); // The line number in the original source\n * ```\n */\n\n getPositionByOriginal(line: number, column: number, sourceIndex: number | string, bias: Bias = Bias.BOUND): PositionInterface | null {\n let index = <number> sourceIndex;\n if (typeof sourceIndex === 'string')\n index = this.sources.findIndex(str => str.includes(sourceIndex));\n\n if (index < 0)\n return null;\n\n const segment = this.mappings.getOriginalSegment(line, column, index, bias);\n if (!segment)\n return null;\n\n return {\n name: this.names[segment.nameIndex ?? -1] ?? null,\n line: segment.line,\n column: segment.column,\n source: this.sources[segment.sourceIndex],\n sourceRoot: this.sourceRoot,\n sourceIndex: segment.sourceIndex,\n generatedLine: segment.generatedLine,\n generatedColumn: segment.generatedColumn\n };\n }\n\n /**\n * Retrieves the position in the original source code based on a given line and column\n * in the generated code.\n *\n * @param line - Line number in the generated code.\n * @param column - Column number in the generated code.\n * @param bias - The bias to use for matching positions. Defaults to `Bias.BOUND`.\n * @returns {PositionInterface | null} The position in the original source, or null if not found.\n *\n * @example\n * ```ts\n * const position = sourceService.getPosition(2, 15);\n * console.log(position?.source); // The original source file\n * ```\n */\n\n getPosition(line: number, column: number, bias: Bias = Bias.BOUND): PositionInterface | null {\n const segment = this.mappings.getSegment(line, column, bias);\n if (!segment)\n return null;\n\n return {\n name: this.names[segment.nameIndex ?? -1] ?? null,\n line: segment.line,\n column: segment.column,\n source: this.sources[segment.sourceIndex],\n sourceRoot: this.sourceRoot,\n sourceIndex: segment.sourceIndex,\n generatedLine: segment.generatedLine,\n generatedColumn: segment.generatedColumn\n };\n }\n\n /**\n * Retrieves the position and original source content for a given position in the generated code.\n *\n * @param line - Line number in the generated code.\n * @param column - Column number in the generated code.\n * @param bias - Bias used for position matching.\n * @returns { PositionWithContentInterface | null } The position and its associated content, or `null` if not found.\n *\n * @example\n * ```ts\n * const positionWithContent = sourceService.getPositionWithContent(3, 5);\n * console.log(positionWithContent?.sourcesContent); // The source code content\n * ```\n */\n\n getPositionWithContent(line: number, column: number, bias: Bias = Bias.BOUND): PositionWithContentInterface | null {\n const position = this.getPosition(line, column, bias);\n if (!position)\n return null;\n\n return {\n ...position,\n sourcesContent: this.sourcesContent[position.sourceIndex]\n };\n }\n\n /**\n * Retrieves the position and a code snippet from the original source based on the given\n * generated code position, with additional lines of code around the matching line.\n *\n * @param line - Line number in the generated code.\n * @param column - Column number in the generated code.\n * @param bias - Bias used for position matching.\n * @param options - (Optional) Extra options for the amount of surrounding lines to include.\n * @returns { PositionWithCodeInterface | null } The position and code snippet.\n *\n * @example\n * ```ts\n * const positionWithCode = sourceService.getPositionWithCode(4, 8, Bias.BOUND, { linesBefore: 2, linesAfter: 2 });\n * console.log(positionWithCode?.code); // The code snippet from the original source\n * ```\n */\n\n getPositionWithCode(line: number, column: number, bias: Bias = Bias.BOUND, options?: SourceOptionsInterface): PositionWithCodeInterface | null {\n const position = this.getPosition(line, column, bias);\n if (!position || !this.sourcesContent[position.sourceIndex])\n return null;\n\n const settings = Object.assign({\n linesAfter: 4,\n linesBefore: 3\n }, options);\n\n const code = this.sourcesContent[position.sourceIndex].split('\\n');\n const endLine = Math.min( (position.line ?? 1) + settings.linesAfter, code.length);\n const startLine = Math.max((position.line ?? 1) - settings.linesBefore, 0);\n const relevantCode = code.slice(startLine, Math.min(endLine + 1, code.length)).join('\\n');\n\n return {\n ...position,\n code: relevantCode,\n endLine: endLine,\n startLine: startLine\n };\n }\n\n /**\n * Converts the current source map object to a JSON string.\n *\n * @returns A stringified version of the source map object.\n *\n * @example\n * ```ts\n * console.log(sourceService.toString()); // JSON string of the source map\n * ```\n */\n\n toString(): string {\n return JSON.stringify(this.getMapObject());\n }\n\n /**\n * Validates the provided source map object.\n *\n * This method checks whether all required keys are present in the source map object.\n * It throws an error if any required keys are missing.\n *\n * @private\n * @param input - The source map object to be validated.\n * @throws Error If any required key is missing from the source map.\n *\n * @example\n * ```ts\n * const sourceMap = {\n * version: 3,\n * file: 'example.js',\n * names: ['src', 'maps', 'example', 'function', 'line', 'column'],\n * sources: ['source1.js', 'source2.js'],\n * mappings: 'AAAA,SAASA,CAAC,CAAC,CAAC;AAAA,CAAC,CAAC;AAAC,CAAC',\n * };\n * sourceService['validateSource'](sourceMap); // Throws if invalid\n * ```\n */\n\n private validateSourceMap(input: SourceMapInterface): void {\n const requiredKeys: (keyof SourceMapInterface)[] = [ 'sources', 'mappings', 'names' ];\n if (!requiredKeys.every(key => key in input)) {\n throw new Error('Missing required keys in SourceMap.');\n }\n }\n}\n"],
6
- "mappings": "AAgBA,OAAS,mBAAAA,MAAuB,mCACh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I,EAGE,CACH,GAAGA,EACH,eAAgB,KAAK,eAAeA,EAAS,WAAW,CAC5D,EALW,IAMf,CAmBA,oBAAoBP,EAAcC,EAAgBE,EAAaX,EAAK,MAAOgB,EAAoE,CAC3I,MAAMD,EAAW,KAAK,YAAYP,EAAMC,EAAQE,CAAI,EACpD,GAAI,CAACI,GAAY,CAAC,KAAK,eAAeA,EAAS,WAAW,EACtD,OAAO,KAEX,MAAME,EAAW,OAAO,OAAO,CAC3B,WAAY,EACZ,YAAa,CACjB,EAAGD,CAAO,EAEJE,EAAO,KAAK,eAAeH,EAAS,WAAW,EAAE,MAAM;AAAA,CAAI,EAC3DI,EAAU,KAAK,KAAMJ,EAAS,MAAQ,GAAKE,EAAS,WAAYC,EAAK,MAAM,EAC3EE,EAAY,KAAK,KAAKL,EAAS,MAAQ,GAAKE,EAAS,YAAa,CAAC,EACnEI,EAAeH,EAAK,MAAME,EAAW,KAAK,IAAID,EAAU,EAAGD,EAAK,MAAM,CAAC,EAAE,KAAK;AAAA,CAAI,EAExF,MAAO,CACH,GAAGH,EACH,KAAMM,EACN,QAASF,EACT,UAAWC,CACf,CACJ,CAaA,UAAmB,CACf,OAAO,KAAK,UAAU,KAAK,aAAa,CAAC,CAC7C,CAyBQ,kBAAkBE,EAAiC,CAEvD,GAAI,CAD+C,CAAE,UAAW,WAAY,OAAQ,EAClE,MAAMC,GAAOA,KAAOD,CAAK,EACvC,MAAM,IAAI,MAAM,qCAAqC,CAE7D,CACJ",
7
- "names": ["MappingProvider", "Bias", "SourceService", "source", "file", "sourceMap", "maps", "map", "sourceService", "line", "column", "sourceIndex", "bias", "index", "str", "segment", "position", "options", "settings", "code", "endLine", "startLine", "relevantCode", "input", "key"]
8
- }