MCPcopy Create free account
hub / github.com/ampproject/amphtml / getSourcemapJson

Function getSourcemapJson

build-system/tasks/check-sourcemaps.js:37–43  ·  view source on GitHub ↗

* Verifies that the sourcemap file exists, and returns its contents. * @param {string} map The map filepath to check * @return {!Object}

(map)

Source from the content-addressed store, hash-verified

35 * @return {!Object}
36 */
37function getSourcemapJson(map) {
38 if (!fs.existsSync(map)) {
39 log(red('ERROR:'), 'Could not find', cyan(map));
40 throw new Error(`Could not find sourcemap file '${map}'`);
41 }
42 return JSON.parse(fs.readFileSync(map, 'utf8'));
43}
44
45/**
46 * Verifies that a correctly formatted sourcemap URL is present in v0.js.map.

Callers 1

checkSourceMapFunction · 0.85

Calls 4

redFunction · 0.85
cyanFunction · 0.85
logFunction · 0.50
parseMethod · 0.45

Tested by

no test coverage detected