@@ -10,7 +10,7 @@ namespace ts.refactor.convertStringOrTemplateLiteral {
10
10
11
11
registerRefactor ( refactorName , { getEditsForAction, getAvailableActions } ) ;
12
12
13
- function getAvailableActions ( context : RefactorContext ) : ReadonlyArray < ApplicableRefactorInfo > {
13
+ function getAvailableActions ( context : RefactorContext ) : readonly ApplicableRefactorInfo [ ] {
14
14
const { file, startPosition } = context ;
15
15
const node = getNodeOrParentOfParentheses ( file , startPosition ) ;
16
16
const maybeBinary = getParentBinaryExpression ( node ) ;
@@ -123,7 +123,7 @@ namespace ts.refactor.convertStringOrTemplateLiteral {
123
123
return expr ;
124
124
}
125
125
126
- function makeSingleExpressionOrBinary ( nodes : ReadonlyArray < Expression > ) : Expression {
126
+ function makeSingleExpressionOrBinary ( nodes : readonly Expression [ ] ) : Expression {
127
127
if ( nodes . length > 1 ) {
128
128
const left = nodes [ 0 ] ;
129
129
const right = nodes [ 1 ] ;
@@ -135,7 +135,7 @@ namespace ts.refactor.convertStringOrTemplateLiteral {
135
135
return nodes [ 0 ] ;
136
136
}
137
137
138
- function arrayToTree ( nodes : ReadonlyArray < Expression > , index : number , accumulator : BinaryExpression ) : Expression {
138
+ function arrayToTree ( nodes : readonly Expression [ ] , index : number , accumulator : BinaryExpression ) : Expression {
139
139
if ( nodes . length === index ) return accumulator ;
140
140
141
141
const right = nodes [ index ] ;
@@ -178,7 +178,7 @@ namespace ts.refactor.convertStringOrTemplateLiteral {
178
178
179
179
// to copy comments following the string
180
180
// "foo" /* comment */ + "bar" /* comment */ + "bar2"
181
- const copyCommentFromMultiNode = ( nodes : ReadonlyArray < Expression > , file : SourceFile , copyOperatorComments : ( index : number , targetNode : Node ) => void ) =>
181
+ const copyCommentFromMultiNode = ( nodes : readonly Expression [ ] , file : SourceFile , copyOperatorComments : ( index : number , targetNode : Node ) => void ) =>
182
182
( indexes : number [ ] , targetNode : Node ) => {
183
183
while ( indexes . length > 0 ) {
184
184
const index = indexes . shift ( ) ! ;
@@ -187,7 +187,7 @@ namespace ts.refactor.convertStringOrTemplateLiteral {
187
187
}
188
188
} ;
189
189
190
- function concatConsecutiveString ( index : number , nodes : ReadonlyArray < Expression > ) : [ number , string , number [ ] ] {
190
+ function concatConsecutiveString ( index : number , nodes : readonly Expression [ ] ) : [ number , string , number [ ] ] {
191
191
let text = "" ;
192
192
const indexes = [ ] ;
193
193
@@ -202,7 +202,7 @@ namespace ts.refactor.convertStringOrTemplateLiteral {
202
202
return [ index , text , indexes ] ;
203
203
}
204
204
205
- function nodesToTemplate ( { nodes, operators} : { nodes : ReadonlyArray < Expression > , operators : Token < BinaryOperator > [ ] } , file : SourceFile ) {
205
+ function nodesToTemplate ( { nodes, operators} : { nodes : readonly Expression [ ] , operators : Token < BinaryOperator > [ ] } , file : SourceFile ) {
206
206
const copyOperatorComments = copyTrailingOperatorComments ( operators , file ) ;
207
207
const copyCommentFromStringLiterals = copyCommentFromMultiNode ( nodes , file , copyOperatorComments ) ;
208
208
const [ begin , headText , headIndexes ] = concatConsecutiveString ( 0 , nodes ) ;
0 commit comments