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

Method toSpecifier

cli/command_add.go:521–527  ·  view source on GitHub ↗
(subModuleIndex int, withVersion bool)

Source from the content-addressed store, hash-verified

519}
520
521func (ui *subModuleSelectUI) toSpecifier(subModuleIndex int, withVersion bool) string {
522 subModule := ui.subModules[subModuleIndex]
523 if subModule == "." {
524 return ui.mainImport.Specifier(withVersion)
525 }
526 return ui.mainImport.Specifier(withVersion) + "/" + subModule
527}
528
529func validateExportPath(exportPath string) bool {
530 return strings.HasPrefix(exportPath, "./") && !strings.HasSuffix(exportPath, ".css") && !strings.HasSuffix(exportPath, ".json") && !strings.ContainsRune(exportPath, '*')

Callers 3

addImportsFunction · 0.95
showMethod · 0.95
renderMethod · 0.95

Calls 1

SpecifierMethod · 0.80

Tested by

no test coverage detected