MCPcopy Create free account
hub / github.com/dop251/goja / extractSourceMapLine

Function extractSourceMapLine

parser/statement.go:896–913  ·  view source on GitHub ↗
(str string)

Source from the content-addressed store, hash-verified

894}
895
896func extractSourceMapLine(str string) string {
897 for {
898 p := strings.LastIndexByte(str, '\n')
899 line := str[p+1:]
900 if line != "" && line != "})" {
901 if strings.HasPrefix(line, "//# sourceMappingURL=") {
902 return line
903 }
904 break
905 }
906 if p >= 0 {
907 str = str[:p]
908 } else {
909 break
910 }
911 }
912 return ""
913}
914
915func (self *_parser) parseSourceMap() *sourcemap.Consumer {
916 if self.opts.disableSourceMaps {

Callers 2

parseSourceMapMethod · 0.85
TestExtractSourceMapLineFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestExtractSourceMapLineFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…