Skip to main content

Module utils

Module utils 

Source
Expand description

Utility functions for source map path resolution, validation, rewriting, and encoding.

Structs§

RewriteOptions
Options for rewriting source map paths and content.

Enums§

DecodedMap
A unified type that can hold any decoded source map variant.

Functions§

find_common_prefix
Find the longest common directory prefix among absolute file paths.
is_sourcemap
Quick check if a JSON string looks like a valid source map.
make_relative_path
Compute the relative path from base to target.
resolve_source_map_path
Resolve a source map reference against a filesystem path.
resolve_source_map_url
Resolve a relative sourceMappingURL against the minified file’s URL.
rewrite_sources
Create a new SourceMap with rewritten source paths.
to_data_url
Convert a source map JSON string to a data: URL.