* Extracts the source map url from the content if present. For example * //# sourceMappingURL=file:///path/to/file * * Read more at: https://tc39.es/source-map-spec/#linking-generated-code * @param {string} content - source content * @returns {string | null} source map url or null if not presen
(content)
| 129 | * @returns {string | null} source map url or null if not present |
| 130 | */ |
| 131 | function extractSourceMapURLMagicComment(content) { |
| 132 | let match; |
| 133 | let lastMatch; |
| 134 | // A while loop is used here to get the last occurrence of sourceMappingURL. |
| 135 | // This is needed so that we don't match sourceMappingURL in string literals. |
| 136 | while ((match = RegExpPrototypeExec(kSourceMappingURLMagicComment, content))) { |
| 137 | lastMatch = match; |
| 138 | } |
| 139 | if (lastMatch == null) { |
| 140 | return null; |
| 141 | } |
| 142 | return lastMatch.groups.sourceMappingURL; |
| 143 | } |
| 144 | |
| 145 | /** |
| 146 | * Caches the source map, with the given filename, moduleInstance, sourceURL and sourceMapURL. |
no outgoing calls
no test coverage detected
searching dependent graphs…