Skip to content

Commit eb8872b

Browse files
committed
feature(spawnify) getRegStrEnd: simplified data
1 parent 4f905bb commit eb8872b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/spawnify.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,16 @@
295295
};
296296

297297
function getRegStrEnd() {
298-
var regStrEnd = '(\\s|\\;|&&|\\|\\|)';
298+
var chars = ['s', ';', '&&', '\\', '|'],
299+
300+
escaped = chars
301+
.map(function(char) {
302+
return '\\' + char;
303+
}).join('|'),
304+
305+
regStr = '(' + escaped + ')';
299306

300-
return regStrEnd;
307+
return regStr;
301308
}
302309

303310
function isContain(str, symbols) {

0 commit comments

Comments
 (0)