MCPcopy Index your code
hub / github.com/nodejs/node / sourcesToAbsolute

Function sourcesToAbsolute

lib/internal/source_map/source_map_cache.js:325–337  ·  view source on GitHub ↗
(baseURL, data)

Source from the content-addressed store, hash-verified

323// src in a html document).
324// If the sources are absolute paths, the sources are converted to absolute file URLs.
325function sourcesToAbsolute(baseURL, data) {
326 data.sources = data.sources.map((source) => {
327 source = (data.sourceRoot || '') + source;
328 if (isAbsolute(source)) {
329 return pathToFileURL(source).href;
330 }
331 return new URL(source, baseURL).href;
332 });
333 // The sources array is now resolved to absolute URLs, sourceRoot should
334 // be updated to noop.
335 data.sourceRoot = '';
336 return data;
337}
338
339// WARNING: The `sourceMapCacheToObject` runs during shutdown. In particular,
340// it also runs when Workers are terminated, making it important that it does

Callers 2

sourceMapFromFileFunction · 0.85
sourceMapFromDataUrlFunction · 0.85

Calls 3

isAbsoluteFunction · 0.85
mapMethod · 0.65
pathToFileURLFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…