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 {
6666 } else if ( rule . patterns !== undefined ) {
6767 const patterns : string [ ] = [ ] ;
6868 // 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 ) {
7170 if ( pattern . include !== null ) {
7271 patterns . push ( `(?${ pattern . include } )` ) ;
7372 }
@@ -180,11 +179,11 @@ function expandPatternMatchProperties<T>(
180179 const patterns : string [ ] = Array . isArray ( pattern ) ? pattern : [ pattern ] ;
181180 rule [ key ] = patterns . map ( ( p ) => `((?${ p } ))` ) . join ( "|" ) as T ;
182181 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 ( ) ] = {
185184 patterns : [
186185 {
187- include : patterns [ patternIndex ] ,
186+ include : capture ,
188187 } ,
189188 ] ,
190189 } ;
You can’t perform that action at this time.
0 commit comments