File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -309,27 +309,28 @@ export function _defaultSplittableCommandFormatter(cmd: string): string {
309
309
splitFill ( null , srcChar )
310
310
} else {
311
311
let startNewCmdKey = false
312
- for ( let j in srcChar ) {
313
- if ( srcChar [ j ] === ',' ) {
314
- splitFill ( 't-cmd-splitter' , srcChar [ j ] )
315
- } else if ( srcChar [ j ] === '|' ) {
316
- splitFill ( null , srcChar [ j ] )
312
+ const charArr : string [ ] = [ ...srcChar ]
313
+ charArr . forEach ( ( ch , j ) => {
314
+ if ( ch === ',' ) {
315
+ splitFill ( 't-cmd-splitter' , ch )
316
+ } else if ( ch === '|' ) {
317
+ splitFill ( null , ch )
317
318
318
319
isCmdKey = true
319
- if ( j < srcChar . length - 1 ) {
320
+ if ( j < charArr . length - 1 ) {
320
321
startNewCmdKey = true
321
322
}
322
323
} else {
323
324
if ( startNewCmdKey ) {
324
- splitFill ( 't-cmd-key' , srcChar [ j ] )
325
+ splitFill ( 't-cmd-key' , ch )
325
326
} else {
326
- splitFill ( null , srcChar [ j ] )
327
+ splitFill ( null , ch )
327
328
}
328
329
}
329
- if ( j === srcChar . length - 1 && srcChar [ j ] !== '|' ) {
330
+ if ( j === charArr . length - 1 && ch !== '|' ) {
330
331
isCmdKey = false
331
332
}
332
- }
333
+ } )
333
334
}
334
335
}
335
336
if ( i < split . length - 1 ) {
You can’t perform that action at this time.
0 commit comments