@@ -152,11 +152,7 @@ func prettyPrintPath(prefix string, key string, value logger.Path) string {
152
152
}
153
153
154
154
func prettyPrintStringArray (prefix string , key string , value []string ) string {
155
- quoted := make ([]string , len (value ))
156
- for i , v := range value {
157
- quoted [i ] = fmt .Sprintf ("%q" , v )
158
- }
159
- return fmt .Sprintf ("%s %q: [%s]," , prefix , key , strings .Join (quoted , "," ))
155
+ return fmt .Sprintf ("%s %q: [%s]," , prefix , key , helpers .StringArrayToQuotedCommaSeparatedString (value ))
160
156
}
161
157
162
158
func prettyPrintTSTarget (prefix string , key string , value * config.TSTarget ) string {
@@ -1600,13 +1596,9 @@ func (r resolverQuery) loadAsMainField(dirInfo *dirInfo, path string, extensionO
1600
1596
fmt .Sprintf ("The %q field here was ignored. Main fields must be configured explicitly when using the \" neutral\" platform." ,
1601
1597
field )))
1602
1598
} else {
1603
- quoted := make ([]string , len (mainFieldKeys ))
1604
- for i , key := range mainFieldKeys {
1605
- quoted [i ] = fmt .Sprintf ("%q" , key )
1606
- }
1607
1599
r .debugMeta .notes = append (r .debugMeta .notes , tracker .MsgData (keyRange ,
1608
1600
fmt .Sprintf ("The %q field here was ignored because the list of main fields to use is currently set to [%s]." ,
1609
- field , strings . Join ( quoted , ", " ))))
1601
+ field , helpers . StringArrayToQuotedCommaSeparatedString ( mainFieldKeys ))))
1610
1602
}
1611
1603
break
1612
1604
}
@@ -2045,14 +2037,6 @@ func (r resolverQuery) finalizeImportsExportsResult(
2045
2037
fmt .Sprintf ("Importing the directory %q is not supported:" , resolvedPath ))}
2046
2038
2047
2039
case pjStatusUndefinedNoConditionsMatch :
2048
- prettyPrintConditions := func (conditions []string ) string {
2049
- quoted := make ([]string , len (conditions ))
2050
- for i , condition := range conditions {
2051
- quoted [i ] = fmt .Sprintf ("%q" , condition )
2052
- }
2053
- return strings .Join (quoted , ", " )
2054
- }
2055
-
2056
2040
keys := make ([]string , 0 , len (conditions ))
2057
2041
for key := range conditions {
2058
2042
keys = append (keys , key )
@@ -2071,8 +2055,8 @@ func (r resolverQuery) finalizeImportsExportsResult(
2071
2055
2072
2056
tracker .MsgData (debug .token ,
2073
2057
fmt .Sprintf ("None of the conditions provided (%s) match any of the currently active conditions (%s):" ,
2074
- prettyPrintConditions (unmatchedConditions ),
2075
- prettyPrintConditions (keys ),
2058
+ helpers . StringArrayToQuotedCommaSeparatedString (unmatchedConditions ),
2059
+ helpers . StringArrayToQuotedCommaSeparatedString (keys ),
2076
2060
)),
2077
2061
}
2078
2062
0 commit comments