Skip to main content

decode

Function decode 

Source
pub fn decode(input: &str) -> Result<SourceMapMappings, DecodeError>
Expand description

Decode a VLQ-encoded source map mappings string into structured data.

The mappings string uses ; to separate lines and , to separate segments within a line. Each segment is a sequence of VLQ-encoded values representing column offsets, source indices, and name indices.

Values are relative (delta-encoded) within the mappings string:

  • Generated column resets to 0 for each new line
  • Source index, original line, original column, and name index are cumulative across the entire mappings string

ยงErrors

Returns DecodeError if the input contains invalid base64 characters, truncated VLQ sequences, or values that overflow i64.