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

Function sourceMapFromFile

lib/internal/source_map/source_map_cache.js:285–294  ·  view source on GitHub ↗

* Read source map from file. * @param {URL} mapURL - file url of the source map * @returns {object} deserialized source map JSON object

(mapURL)

Source from the content-addressed store, hash-verified

283 * @returns {object} deserialized source map JSON object
284 */
285function sourceMapFromFile(mapURL) {
286 try {
287 const content = readFileSync(fileURLToPath(mapURL), 'utf8');
288 const data = JSONParse(content);
289 return sourcesToAbsolute(mapURL, data);
290 } catch (err) {
291 debug(err);
292 return null;
293 }
294}
295
296// data:[<mediatype>][;base64],<data> see:
297// https://tools.ietf.org/html/rfc2397#section-2

Callers 1

dataFromUrlFunction · 0.85

Calls 4

fileURLToPathFunction · 0.85
sourcesToAbsoluteFunction · 0.85
readFileSyncFunction · 0.50
debugFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…