From: Jakub Pawlowicz Date: Mon, 23 Nov 2015 20:24:25 +0000 (+0000) Subject: Fixes #707 - correct guard clause in `split` helper. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=69e975fdaa5ed31178c9d84bfa425eecaf42af1d;p=clean-css.git Fixes #707 - correct guard clause in `split` helper. Turns out the case with no separators and a string pattern was never caught by a guard clause. Thanks to @alexlamsl for spotting it. --- diff --git a/lib/utils/split.js b/lib/utils/split.js index 0faf7459..178c7393 100644 --- 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];