Skip to main content

is_sourcemap

Function is_sourcemap 

Source
pub fn is_sourcemap(json: &str) -> bool
Expand description

Quick check if a JSON string looks like a valid source map.

Performs a lightweight structural check without fully parsing the source map. Returns true if the JSON contains either:

  • version + mappings + at least one of sources, names, sourceRoot, sourcesContent
  • OR a sections field (indexed source map)