fix return

return may need to be an empty array, else if you:
parse(""), it will raise TypeError
This commit is contained in:
medifle 2018-12-19 17:52:45 -05:00 committed by GitHub
parent 45435ce1bb
commit 54084ef856
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,7 +41,7 @@ function parse(expr) {
let result = expr.match(reg);
if (!result) return;
if (!result) return [];
result.shift();
return result;