MCPcopy
hub / github.com/esm-dev/esm.sh / getCjsModuleLexerDownloadURL

Function getCjsModuleLexerDownloadURL

server/cjs_module_lexer.go:248–271  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

246}
247
248func getCjsModuleLexerDownloadURL() (string, error) {
249 var arch string
250 var os string
251
252 switch runtime.GOARCH {
253 case "arm64":
254 arch = "aarch64"
255 case "amd64", "386":
256 arch = "x86_64"
257 default:
258 return "", errors.New("unsupported architecture: " + runtime.GOARCH)
259 }
260
261 switch runtime.GOOS {
262 case "darwin":
263 os = "apple-darwin"
264 case "linux":
265 os = "unknown-linux-gnu"
266 default:
267 return "", errors.New("unsupported os: " + runtime.GOOS)
268 }
269
270 return fmt.Sprintf("https://github.com/esm-dev/cjs-module-lexer/releases/download/v%s/cjs-module-lexer-%s-%s.gz", cjsModuleLexerVersion, arch, os), nil
271}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected