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 Oxide Extractor calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  9c772429_5486_9990_999c_bcc7710fe7ae["toRawSourceMap()"]
  b481c171_0dab_e8e5_e9d7_4ad779fa96da["source-map.test.ts"]
  9c772429_5486_9990_999c_bcc7710fe7ae -->|defined in| b481c171_0dab_e8e5_e9d7_4ad779fa96da
  efd01c94_d25c_cc34_c144_f7242c307fca["run()"]
  efd01c94_d25c_cc34_c144_f7242c307fca -->|calls| 9c772429_5486_9990_999c_bcc7710fe7ae
  2820372c_b982_9e06_fc23_f8f4ac308d00["get()"]
  9c772429_5486_9990_999c_bcc7710fe7ae -->|calls| 2820372c_b982_9e06_fc23_f8f4ac308d00
  style 9c772429_5486_9990_999c_bcc7710fe7ae 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