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

Function TryGetExtensionFromPath

internal/tspath/extension.go:56–63  ·  view source on GitHub ↗
(p string)

Source from the content-addressed store, hash-verified

54}
55
56func TryGetExtensionFromPath(p string) string {
57 for _, ext := range extensionsToRemove {
58 if FileExtensionIs(p, ext) {
59 return ext
60 }
61 }
62 return ""
63}
64
65func RemoveExtension(path string, extension string) string {
66 return path[:len(path)-len(extension)]

Callers 11

tryFileMethod · 0.92
TryGetJSExtensionForFileFunction · 0.92
getFileExtensionFunction · 0.92
extensionFromPathFunction · 0.92
resolveExternalModuleMethod · 0.92
allParsableFilesFunction · 0.92
FuzzParserFunction · 0.92

Calls 1

FileExtensionIsFunction · 0.85

Tested by 2

allParsableFilesFunction · 0.74
FuzzParserFunction · 0.74