public
/
clean-css.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
09748be
)
Fixes #707 - correct guard clause in `split` helper.
author
Jakub Pawlowicz
<contact@jakubpawlowicz.com>
Mon, 23 Nov 2015 20:24:25 +0000
(20:24 +0000)
committer
Jakub Pawlowicz
<contact@jakubpawlowicz.com>
Mon, 23 Nov 2015 20:24:25 +0000
(20:24 +0000)
Turns out the case with no separators and a string pattern was never
caught by a guard clause.
Thanks to @alexlamsl for spotting it.
lib/utils/split.js
patch
|
blob
|
history
diff --git
a/lib/utils/split.js
b/lib/utils/split.js
index
0faf745
..
178c739
100644
(file)
--- a/
lib/utils/split.js
+++ b/
lib/utils/split.js
@@
-2,7
+2,7
@@
function split(value, separator, includeSeparator, openLevel, closeLevel) {
var withRegex = typeof separator != 'string';
var hasSeparator = withRegex ?
separator.test(value) :
- value.indexOf(separator);
+ value.indexOf(separator)
> -1
;
if (!hasSeparator)
return [value];