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

Function getJSExtensionForFile

internal/modulespecifiers/util.go:174–180  ·  view source on GitHub ↗
(fileName string, options *core.CompilerOptions)

Source from the content-addressed store, hash-verified

172}
173
174func getJSExtensionForFile(fileName string, options *core.CompilerOptions) string {
175 result := module.TryGetJSExtensionForFile(fileName, options)
176 if len(result) == 0 {
177 panic(fmt.Sprintf("Extension %s is unsupported:: FileName:: %s", extensionFromPath(fileName), fileName))
178 }
179 return result
180}
181
182/**
183 * Gets the extension from a path.

Callers 2

processEndingFunction · 0.85

Calls 4

TryGetJSExtensionForFileFunction · 0.92
lenFunction · 0.85
panicFunction · 0.85
extensionFromPathFunction · 0.85

Tested by

no test coverage detected