Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
selectorPart.forEach(part => {
const position = part.indexOf(pseudoClass)
const pre = part.slice(0, position)
const body = part.slice(position)
const matches = balancedMatch("(", ")", body)
const bodySelectors = matches && matches.body ?
list
.comma(matches.body)
.reduce((acc, s) => [
...acc,
...explodeSelector(s, options),
], [])
: [body]
const postSelectors = matches && matches.post
? explodeSelector(matches.post, options)
: []
let newParts
if (postSelectors.length === 0) {
// the test below is a poor way to try we are facing a piece of a
// selector...
if (position === -1 || pre.indexOf(" ") > -1) {
if (preserveHacks && decl.raws.between) {
decl.raws.between = decl.raws.between.replace(re.whiteSpaces, "");
} else {
decl.raws.between = ":";
}
if (decl.important) {
decl.raws.important = "!important";
}
if (prop === "content") {
return;
}
if (prop === "font-family") {
decl.value = list.comma(value).map(unquoteFontFamily).join(",");
return;
}
values = list.comma(value);
value = values.map(wringValue.bind(null, prop)).join(",");
if (re.propertyMultipleValues.test(prop)) {
values = list.space(value);
if (values.length === 4 && values[1] === values[3]) {
values.splice(3, 1);
}
if (values.length === 3 && values[0] === values[2]) {
values.splice(2, 1);
}
if (prop === "content") {
return;
}
if (prop === "font-family") {
decl.value = list
.comma(value)
.map(unquoteFontFamily)
.join(",");
return;
}
let values = list.comma(value);
value = values.map(wringValue.bind(null, preserveHacks, prop)).join(",");
if (re.propertyMultipleValues.test(prop)) {
values = list.space(value);
if (values.length === 4 && values[1] === values[3]) {
values.splice(3, 1);
}
if (values.length === 3 && values[0] === values[2]) {
values.splice(2, 1);
}
if (values.length === 2 && values[0] === values[1]) {
values.splice(1, 1);
var parseQueryList = function (queryList) {
var queries = [];
list.comma(queryList).forEach(function (query) {
var expressions = {};
list.space(query).forEach(function (expression) {
var feature;
var value;
expression = expression.toLowerCase();
if (expression === "and") {
return;
}
if (/^\w+$/.test(expression)) {
expressions[expression] = true;
return;
}
function explodeSelector(selector, options) {
if (selector && selector.indexOf(pseudoClass) > -1) {
let newSelectors = []
const preWhitespaceMatches = selector.match(/^\s+/)
const preWhitespace = preWhitespaceMatches
? preWhitespaceMatches[0]
: ""
const selectorPart = list.comma(selector)
selectorPart.forEach(part => {
const position = part.indexOf(pseudoClass)
const pre = part.slice(0, position)
const body = part.slice(position)
const matches = balancedMatch("(", ")", body)
const bodySelectors = matches && matches.body ?
list
.comma(matches.body)
.reduce((acc, s) => [
...acc,
...explodeSelector(s, options),
], [])
: [body]
const postSelectors = matches && matches.post
function explodeSelector(pseudoClass, selector) {
const position = locatePseudoClass(selector, pseudoClass)
if (selector && position > -1) {
const pre = selector.slice(0, position)
const matches = balancedMatch("(", ")", selector.slice(position))
const bodySelectors = matches.body
? list
.comma(matches.body)
.map(s => explodeSelector(pseudoClass, s))
.join(`)${pseudoClass}(`)
: ""
const postSelectors = matches.post
? explodeSelector(pseudoClass, matches.post)
: ""
return `${pre}${pseudoClass}(${bodySelectors})${postSelectors}`
}
return selector
}
values: [function (value) {
return list.comma(value).length > 1
}]
},
decl.parent.each(function (i) {
if (i.type !== 'decl') {
return undefined;
}
if (i.prop.indexOf('transition-') !== 0) {
return undefined;
}
if (i.prop === 'transition-property') {
return undefined;
}
if (list.comma(i.value).length > 1) {
decl.warn(result, 'Replace transition-property to transition, ' + 'because Autoprefixer could not support ' + 'any cases of transition-property ' + 'and other transition-*');
}
return false;
});
};
decl.parent.each(function (i) {
if (i.type !== 'decl') {
return undefined;
}
if (i.prop.indexOf('transition-') !== 0) {
return undefined;
}
if (i.prop === 'transition-property') {
return undefined;
}
if (list.comma(i.value).length > 1) {
decl.warn(result, 'Replace transition-property to transition, ' + 'because Autoprefixer could not support ' + 'any cases of transition-property ' + 'and other transition-*');
}
return false;
});
};