mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-24 11:43:18 -05:00
Generate shortest rootDirs module specifier instead of first possible (#51244)
* Generate shortest rootDirs module specifier instead of first possible * Simplify `min`
This commit is contained in:
@@ -259,7 +259,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function betterMatch(a: PatternMatch | undefined, b: PatternMatch | undefined): PatternMatch | undefined {
|
||||
return min(a, b, compareMatches);
|
||||
return min([a, b], compareMatches);
|
||||
}
|
||||
function compareMatches(a: PatternMatch | undefined, b: PatternMatch | undefined): Comparison {
|
||||
return a === undefined ? Comparison.GreaterThan : b === undefined ? Comparison.LessThan
|
||||
|
||||
Reference in New Issue
Block a user