mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-13 03:02:49 +00:00
updated bunch of file paths and changed the way posts are loaded
This commit is contained in:
49
node_modules/clean-css/lib/utils/split.js
generated
vendored
Normal file
49
node_modules/clean-css/lib/utils/split.js
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
function split(value, separator, includeSeparator, openLevel, closeLevel) {
|
||||
var withRegex = typeof separator != 'string';
|
||||
var hasSeparator = withRegex ?
|
||||
separator.test(value) :
|
||||
value.indexOf(separator);
|
||||
|
||||
if (!hasSeparator)
|
||||
return [value];
|
||||
|
||||
openLevel = openLevel || '(';
|
||||
closeLevel = closeLevel || ')';
|
||||
|
||||
if (value.indexOf(openLevel) == -1 && !includeSeparator)
|
||||
return value.split(separator);
|
||||
|
||||
var level = 0;
|
||||
var cursor = 0;
|
||||
var lastStart = 0;
|
||||
var len = value.length;
|
||||
var tokens = [];
|
||||
|
||||
while (cursor < len) {
|
||||
if (value[cursor] == openLevel) {
|
||||
level++;
|
||||
} else if (value[cursor] == closeLevel) {
|
||||
level--;
|
||||
}
|
||||
|
||||
if (level === 0 && cursor > 0 && cursor + 1 < len && (withRegex ? separator.test(value[cursor]) : value[cursor] == separator)) {
|
||||
tokens.push(value.substring(lastStart, cursor + (includeSeparator ? 1 : 0)));
|
||||
lastStart = cursor + 1;
|
||||
}
|
||||
|
||||
cursor++;
|
||||
}
|
||||
|
||||
if (lastStart < cursor + 1) {
|
||||
var lastValue = value.substring(lastStart);
|
||||
var lastCharacter = lastValue[lastValue.length - 1];
|
||||
if (!includeSeparator && (withRegex ? separator.test(lastCharacter) : lastCharacter == separator))
|
||||
lastValue = lastValue.substring(0, lastValue.length - 1);
|
||||
|
||||
tokens.push(lastValue);
|
||||
}
|
||||
|
||||
return tokens;
|
||||
}
|
||||
|
||||
module.exports = split;
|
||||
Reference in New Issue
Block a user