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

Function findConfigFile

internal/execute/tsc.go:266–278  ·  view source on GitHub ↗
(searchPath string, fileExists func(string) bool, configName string)

Source from the content-addressed store, hash-verified

264}
265
266func findConfigFile(searchPath string, fileExists func(string) bool, configName string) string {
267 result, ok := tspath.ForEachAncestorDirectory(searchPath, func(ancestor string) (string, bool) {
268 fullConfigName := tspath.CombinePaths(ancestor, configName)
269 if fileExists(fullConfigName) {
270 return fullConfigName, true
271 }
272 return fullConfigName, false
273 })
274 if !ok {
275 return ""
276 }
277 return result
278}
279
280func getTraceFromSys(sys tsc.System, locale locale.Locale, testing tsc.CommandLineTesting) func(msg *diagnostics.Message, args ...any) {
281 return tsc.GetTraceWithWriterFromSys(sys.Writer(), locale, testing)

Callers 1

tscCompilationFunction · 0.85

Calls 3

ForEachAncestorDirectoryFunction · 0.92
CombinePathsFunction · 0.92
fileExistsFunction · 0.85

Tested by

no test coverage detected