File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -5,26 +5,27 @@ var through = require('through2');
5
5
* of the plotly.js bundles
6
6
*/
7
7
8
+ var WHITESPACE_BEFORE = '\\s*' ;
8
9
var OPTIONAL_COMMA = ',?' ;
9
10
10
11
// one line string with or without trailing comma
11
12
function makeStringRegex ( attr ) {
12
13
return makeRegex (
13
- attr + ': \'.*\'' + OPTIONAL_COMMA
14
+ WHITESPACE_BEFORE + attr + ': \'.*\'' + OPTIONAL_COMMA
14
15
) ;
15
16
}
16
17
17
18
// joined array of strings with or without trailing comma
18
19
function makeJoinedArrayRegex ( attr ) {
19
20
return makeRegex (
20
- attr + ': \\[[\\s\\S]*?\\]' + '\\.join\\(.*' + OPTIONAL_COMMA
21
+ WHITESPACE_BEFORE + attr + ': \\[[\\s\\S]*?\\]' + '\\.join\\(.*' + OPTIONAL_COMMA
21
22
) ;
22
23
}
23
24
24
25
// array with or without trailing comma
25
26
function makeArrayRegex ( attr ) {
26
27
return makeRegex (
27
- attr + ': \\[[\\s\\S]*?\\]' + OPTIONAL_COMMA
28
+ WHITESPACE_BEFORE + attr + ': \\[[\\s\\S]*?\\]' + OPTIONAL_COMMA
28
29
) ;
29
30
}
30
31
You can’t perform that action at this time.
0 commit comments