File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
extensions/ql-vscode/gulpfile.ts Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -66,8 +66,7 @@ function getNodeMatchText(rule: Pattern): string {
66
66
} else if ( rule . patterns !== undefined ) {
67
67
const patterns : string [ ] = [ ] ;
68
68
// For a list of patterns, use the disjunction of those patterns.
69
- for ( const patternIndex in rule . patterns ) {
70
- const pattern = rule . patterns [ patternIndex ] ;
69
+ for ( const pattern of rule . patterns ) {
71
70
if ( pattern . include !== null ) {
72
71
patterns . push ( `(?${ pattern . include } )` ) ;
73
72
}
@@ -180,11 +179,11 @@ function expandPatternMatchProperties<T>(
180
179
const patterns : string [ ] = Array . isArray ( pattern ) ? pattern : [ pattern ] ;
181
180
rule [ key ] = patterns . map ( ( p ) => `((?${ p } ))` ) . join ( "|" ) as T ;
182
181
const captures : Pattern [ "captures" ] = { } ;
183
- for ( const patternIndex in patterns ) {
184
- captures [ ( Number ( patternIndex ) + 1 ) . toString ( ) ] = {
182
+ for ( const [ captureIndex , capture ] of patterns . entries ( ) ) {
183
+ captures [ ( Number ( captureIndex ) + 1 ) . toString ( ) ] = {
185
184
patterns : [
186
185
{
187
- include : patterns [ patternIndex ] ,
186
+ include : capture ,
188
187
} ,
189
188
] ,
190
189
} ;
You can’t perform that action at this time.
0 commit comments