(resolutionCache map[tspath.Path]module.ModeAwareCache[T], callback func(resolution T, moduleName string, mode core.ResolutionMode, filePath tspath.Path), file *ast.SourceFile)
| 2082 | } |
| 2083 | |
| 2084 | func forEachResolution[T any](resolutionCache map[tspath.Path]module.ModeAwareCache[T], callback func(resolution T, moduleName string, mode core.ResolutionMode, filePath tspath.Path), file *ast.SourceFile) { |
| 2085 | if file != nil { |
| 2086 | if resolutions, ok := resolutionCache[file.Path()]; ok { |
| 2087 | for key, resolution := range resolutions { |
| 2088 | callback(resolution, key.Name, key.Mode, file.Path()) |
| 2089 | } |
| 2090 | } |
| 2091 | } else { |
| 2092 | for filePath, resolutions := range resolutionCache { |
| 2093 | for key, resolution := range resolutions { |
| 2094 | callback(resolution, key.Name, key.Mode, filePath) |
| 2095 | } |
| 2096 | } |
| 2097 | } |
| 2098 | } |
| 2099 | |
| 2100 | var plainJSErrors = collections.NewSetFromItems( |
| 2101 | // binder errors |
no test coverage detected