File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 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');
55 * of the plotly.js bundles
66 */
77
8+ var WHITESPACE_BEFORE = '\\s*' ;
9+ var OPTIONAL_COMMA = ',?' ;
810
911// one line string with or without trailing comma
1012function makeStringRegex ( attr ) {
1113 return makeRegex (
12- attr + ': \'.*\'' + ',?'
14+ WHITESPACE_BEFORE + attr + ': \'.*\'' + OPTIONAL_COMMA
1315 ) ;
1416}
1517
1618// joined array of strings with or without trailing comma
1719function makeJoinedArrayRegex ( attr ) {
1820 return makeRegex (
19- attr + ': \\[[\\s\\S]*?\\]' + '\\.join\\(.*' + ',?'
21+ WHITESPACE_BEFORE + attr + ': \\[[\\s\\S]*?\\]' + '\\.join\\(.*' + OPTIONAL_COMMA
2022 ) ;
2123}
2224
2325// array with or without trailing comma
2426function makeArrayRegex ( attr ) {
2527 return makeRegex (
26- attr + ': \\[[\\s\\S]*?\\]' + ',?'
28+ WHITESPACE_BEFORE + attr + ': \\[[\\s\\S]*?\\]' + OPTIONAL_COMMA
2729 ) ;
2830}
2931
You can’t perform that action at this time.
0 commit comments