MCPcopy Create free account
hub / github.com/Rich-Harris/magic-string / _mapProperties

Method _mapProperties

src/Bundle.ts:367–387  ·  view source on GitHub ↗

@internal

(
    options: BundleSourceMapOptions,
    names: string[],
    x_google_ignoreList: number[] | undefined,
  )

Source from the content-addressed store, hash-verified

365
366 /** @internal */
367 _mapProperties(
368 options: BundleSourceMapOptions,
369 names: string[],
370 x_google_ignoreList: number[] | undefined,
371 ): Omit<DecodedSourceMapOrMissingContent, 'mappings' | 'rangeMappings'> {
372 return {
373 file: options.file ? options.file.split(/[/\\]/).pop() : undefined,
374 sources: this.uniqueSources.map((source) => {
375 return options.file ? getRelativePath(options.file, source.filename) : source.filename
376 }),
377 sourcesContent: this.uniqueSources.map((source) => {
378 const includeContent = typeof options.includeContent === 'function'
379 ? options.includeContent(source)
380 : options.includeContent
381
382 return includeContent ? source.content : null
383 }),
384 names,
385 x_google_ignoreList,
386 }
387 }
388
389 getIndentString(): string {
390 const indentStringCounts = {}

Callers 2

generateDecodedMapMethod · 0.95
generateMapMethod · 0.95

Calls 2

getRelativePathFunction · 0.90
splitMethod · 0.45

Tested by

no test coverage detected