* Verifies that a correctly formatted sourcemap URL is present in v0.js.map. * * @param {!Object} sourcemapJson * @param {string} map The map filepath to check
(sourcemapJson, map)
| 49 | * @param {string} map The map filepath to check |
| 50 | */ |
| 51 | function checkSourcemapUrl(sourcemapJson, map) { |
| 52 | log('Inspecting', cyan('sourceRoot'), 'in', cyan(map) + '...'); |
| 53 | if (!sourcemapJson.sourceRoot) { |
| 54 | log(red('ERROR:'), 'Could not find', cyan('sourceRoot')); |
| 55 | throw new Error('Could not find sourcemap URL'); |
| 56 | } |
| 57 | if (!sourcemapJson.sourceRoot.match(sourcemapUrlMatcher)) { |
| 58 | log(red('ERROR:'), cyan(sourcemapJson.sourceRoot), 'is badly formatted'); |
| 59 | throw new Error('Badly formatted sourcemap URL'); |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | /** |
| 64 | * Verifies all the paths in the sources field are as expected. |
no test coverage detected