File tree 1 file changed +4
-12
lines changed
1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -8,19 +8,11 @@ var logger = require('./logger')('createBitmaps');
8
8
9
9
var GENERATE_BITMAPS_SCRIPT = 'capture/genBitmaps.js' ;
10
10
11
- function includes ( string , search , start ) {
12
- if ( typeof start !== 'number' ) {
13
- start = 0 ;
14
- }
15
-
16
- if ( start + search . length > this . length ) {
17
- return false ;
18
- } else {
19
- return string . indexOf ( search , start ) !== - 1 ;
20
- }
11
+ function regexTest ( string , search ) {
12
+ var re = new RegExp ( search ) ;
13
+ return re . test ( string ) ;
21
14
}
22
15
23
-
24
16
/**
25
17
* Utility for generating a temporary config file required by GENERATE_BITMAPS_SCRIPT.
26
18
* @config {Object} Base user config object (derrived by user config file + CL param overrides).
@@ -40,7 +32,7 @@ function writeReferenceCreateConfig (config, isReference) {
40
32
41
33
config . args . filter . split ( ',' ) . forEach ( function ( filteredTest ) {
42
34
each ( configJSON . scenarios , function ( scenario ) {
43
- if ( includes ( scenario . label , filteredTest ) ) {
35
+ if ( regexTest ( scenario . label , filteredTest ) ) {
44
36
scenarii . push ( scenario ) ;
45
37
}
46
38
} ) ;
You can’t perform that action at this time.
0 commit comments