MCPcopy Create free account
hub / github.com/microsoft/typescript-go / GetPackageNameFromTypesPackageName

Function GetPackageNameFromTypesPackageName

internal/module/util.go:81–87  ·  view source on GitHub ↗
(mangledName string)

Source from the content-addressed store, hash-verified

79}
80
81func GetPackageNameFromTypesPackageName(mangledName string) string {
82 withoutAtTypePrefix := strings.TrimPrefix(mangledName, "@types/")
83 if withoutAtTypePrefix != mangledName {
84 return UnmangleScopedPackageName(withoutAtTypePrefix)
85 }
86 return mangledName
87}
88
89func ComparePatternKeys(a, b string) int {
90 aPatternIndex := strings.Index(a, "*")

Calls 1

Tested by

no test coverage detected