Skip to main content

Module source_map_cache

Module source_map_cache 

Source
Expand description

The source-map-cache of a V8 coverage dump: its entries, and the rules that turn a source of a map into a file path. The health coverage reader and the runtime-coverage remapper of the CLI both use these rules.

Structs§

SourceMapCacheEntry
One source-map-cache entry of a V8 dump.

Functions§

file_url_to_path
The path of a file:// URL or of an absolute path. None for each other URL and for a relative path.
parse_source_map_cache
Decodes each entry of a source-map-cache object on its own, keyed by script URL. An entry that does not decode is left out, so one bad entry does not remove the other maps. A value that is not an object gives an empty map.
resolve_original_source
The file path of one source of a map. A file:// URL and an absolute path resolve without a base directory. A relative path joins the base directory. A webpack:// or vite:// source resolves to the first existing file in the base directory or one of its ancestors. Each other URL gives None.
source_map_base_dir
The directory that relative and virtual sources resolve from: the directory of the external map when the entry names one, else the directory of the generated script. None when the script is not a local file or the map is remote.