pub fn resolve_source_map_url(
minified_url: &str,
source_map_ref: &str,
) -> Option<String>Expand description
Resolve a relative sourceMappingURL against the minified file’s URL.
- If
source_map_refis already absolute (starts withhttp://,https://, or/), returns it as-is. - If
source_map_refstarts withdata:, returnsNone(inline maps). - Otherwise, replaces the filename portion of
minified_urlwithsource_map_refand handles../traversal.
§Examples
use srcmap_sourcemap::utils::resolve_source_map_url;
let url = resolve_source_map_url("https://example.com/js/app.js", "app.js.map");
assert_eq!(url, Some("https://example.com/js/app.js.map".to_string()));