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