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

Function WithSourceMapLoader

parser/parser.go:74–78  ·  view source on GitHub ↗

WithSourceMapLoader is an option to set a custom source map loader. The loader will be given a path or a URL from the sourceMappingURL. If sourceMappingURL is not absolute it is resolved relatively to the name of the file being parsed. Any error returned by the loader will fail the parsing. Note tha

(loader func(path string) ([]byte, error))

Source from the content-addressed store, hash-verified

72// Note that setting this to nil does not disable source map support, there is a default loader which reads
73// from the filesystem. Use WithDisableSourceMaps to disable source map support.
74func WithSourceMapLoader(loader func(path string) ([]byte, error)) Option {
75 return func(opts *options) {
76 opts.sourceMapLoader = loader
77 }
78}
79
80type _parser struct {
81 str string

Callers 1

TestSourceMapOptionsFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestSourceMapOptionsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…