Home / Function/ toRawSourceMap() — tailwindcss Function Reference

toRawSourceMap() — tailwindcss Function Reference

Architecture documentation for the toRawSourceMap() function in source-map.test.ts from the tailwindcss codebase.

Function typescript OxideEngine Scanner calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  b8440a35_f3c7_053b_916b_27c5abf3d6e2["toRawSourceMap()"]
  685d98f0_f223_dedf_cfba_bbdb2dc11d1d["source-map.test.ts"]
  b8440a35_f3c7_053b_916b_27c5abf3d6e2 -->|defined in| 685d98f0_f223_dedf_cfba_bbdb2dc11d1d
  2d886dcd_8c34_0eb2_8fc8_a0ee9f8d23eb["run()"]
  2d886dcd_8c34_0eb2_8fc8_a0ee9f8d23eb -->|calls| b8440a35_f3c7_053b_916b_27c5abf3d6e2
  5bcf4886_1230_a8ff_7302_a26cc5a9a525["get()"]
  b8440a35_f3c7_053b_916b_27c5abf3d6e2 -->|calls| 5bcf4886_1230_a8ff_7302_a26cc5a9a525
  style b8440a35_f3c7_053b_916b_27c5abf3d6e2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/tailwindcss/src/source-maps/source-map.test.ts lines 50–81

function toRawSourceMap(map: DecodedSourceMap): string {
  let generator = new SourceMapGenerator()

  let id = 1
  let sourceTable = new DefaultMap<
    DecodedSource | null,
    {
      url: string
      content: string
    }
  >((src) => {
    return {
      url: src?.url ?? `<unknown ${id++}>`,
      content: src?.content ?? '<none>',
    }
  })

  for (let mapping of map.mappings) {
    let original = sourceTable.get(mapping.originalPosition?.source ?? null)

    generator.addMapping({
      generated: mapping.generatedPosition,
      original: mapping.originalPosition,
      source: original.url,
      name: mapping.name ?? undefined,
    })

    generator.setSourceContent(original.url, original.content)
  }

  return generator.toString()
}

Domain

Subdomains

Calls

Called By

Frequently Asked Questions

What does toRawSourceMap() do?
toRawSourceMap() is a function in the tailwindcss codebase, defined in packages/tailwindcss/src/source-maps/source-map.test.ts.
Where is toRawSourceMap() defined?
toRawSourceMap() is defined in packages/tailwindcss/src/source-maps/source-map.test.ts at line 50.
What does toRawSourceMap() call?
toRawSourceMap() calls 1 function(s): get.
What calls toRawSourceMap()?
toRawSourceMap() is called by 1 function(s): run.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free