( compilerOptions *core.CompilerOptions, importingSourceFile *ast.SourceFile, // !!! | FutureSourceFile nodeModulesFileName string, host ModuleSpecifierGenerationHost, preferences UserPreferences, options ModuleSpecifierOptions, )
| 341 | } |
| 342 | |
| 343 | func GetNodeModulesPackageName( |
| 344 | compilerOptions *core.CompilerOptions, |
| 345 | importingSourceFile *ast.SourceFile, // !!! | FutureSourceFile |
| 346 | nodeModulesFileName string, |
| 347 | host ModuleSpecifierGenerationHost, |
| 348 | preferences UserPreferences, |
| 349 | options ModuleSpecifierOptions, |
| 350 | ) string { |
| 351 | info := getInfo(importingSourceFile.FileName(), host) |
| 352 | modulePaths := getAllModulePaths(info, nodeModulesFileName, host, compilerOptions, preferences, options) |
| 353 | for _, modulePath := range modulePaths { |
| 354 | if result := tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, preferences, true /*packageNameOnly*/, options.OverrideImportMode); len(result) > 0 { |
| 355 | return result |
| 356 | } |
| 357 | } |
| 358 | return "" |
| 359 | } |
| 360 | |
| 361 | func allKeysStartWithDot(obj *collections.OrderedMap[string, packagejson.ExportsOrImports]) bool { |
| 362 | for k := range obj.Keys() { |
nothing calls this directly
no test coverage detected