diff options
author | Florian Dold <florian.dold@gmail.com> | 2019-03-27 21:01:33 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2019-03-27 21:01:33 +0100 |
commit | cc97a4dd2a967e1c2273bd5f4c5f49a5bf2e2585 (patch) | |
tree | 92c5d88706a6ffc654d1b133618d357890e7096b /node_modules/clean-css/lib/utils/split.js | |
parent | 3771b4d6b67b34c130f3a9a1a15f42deefdb2eda (diff) |
remove node_modules
Diffstat (limited to 'node_modules/clean-css/lib/utils/split.js')
-rw-r--r-- | node_modules/clean-css/lib/utils/split.js | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/node_modules/clean-css/lib/utils/split.js b/node_modules/clean-css/lib/utils/split.js deleted file mode 100644 index c91625506..000000000 --- a/node_modules/clean-css/lib/utils/split.js +++ /dev/null @@ -1,50 +0,0 @@ -var Marker = require('../tokenizer/marker'); - -function split(value, separator) { - var openLevel = Marker.OPEN_ROUND_BRACKET; - var closeLevel = Marker.CLOSE_ROUND_BRACKET; - var level = 0; - var cursor = 0; - var lastStart = 0; - var lastValue; - var lastCharacter; - var len = value.length; - var parts = []; - - if (value.indexOf(separator) == -1) { - return [value]; - } - - if (value.indexOf(openLevel) == -1) { - return value.split(separator); - } - - while (cursor < len) { - if (value[cursor] == openLevel) { - level++; - } else if (value[cursor] == closeLevel) { - level--; - } - - if (level === 0 && cursor > 0 && cursor + 1 < len && value[cursor] == separator) { - parts.push(value.substring(lastStart, cursor)); - lastStart = cursor + 1; - } - - cursor++; - } - - if (lastStart < cursor + 1) { - lastValue = value.substring(lastStart); - lastCharacter = lastValue[lastValue.length - 1]; - if (lastCharacter == separator) { - lastValue = lastValue.substring(0, lastValue.length - 1); - } - - parts.push(lastValue); - } - - return parts; -} - -module.exports = split; |