format: prettify entire project
This commit is contained in:
172
node_modules/clean-css/lib/optimizer/level-2/can-override.js
generated
vendored
172
node_modules/clean-css/lib/optimizer/level-2/can-override.js
generated
vendored
@ -1,23 +1,39 @@
|
||||
var understandable = require('./properties/understandable');
|
||||
|
||||
function animationIterationCount(validator, value1, value2) {
|
||||
if (!understandable(validator, value1, value2, 0, true) && !(validator.isAnimationIterationCountKeyword(value2) || validator.isPositiveNumber(value2))) {
|
||||
if (
|
||||
!understandable(validator, value1, value2, 0, true) &&
|
||||
!(
|
||||
validator.isAnimationIterationCountKeyword(value2) ||
|
||||
validator.isPositiveNumber(value2)
|
||||
)
|
||||
) {
|
||||
return false;
|
||||
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return validator.isAnimationIterationCountKeyword(value2) || validator.isPositiveNumber(value2);
|
||||
return (
|
||||
validator.isAnimationIterationCountKeyword(value2) ||
|
||||
validator.isPositiveNumber(value2)
|
||||
);
|
||||
}
|
||||
|
||||
function animationName(validator, value1, value2) {
|
||||
if (!understandable(validator, value1, value2, 0, true) && !(validator.isAnimationNameKeyword(value2) || validator.isIdentifier(value2))) {
|
||||
if (
|
||||
!understandable(validator, value1, value2, 0, true) &&
|
||||
!(
|
||||
validator.isAnimationNameKeyword(value2) || validator.isIdentifier(value2)
|
||||
)
|
||||
) {
|
||||
return false;
|
||||
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return validator.isAnimationNameKeyword(value2) || validator.isIdentifier(value2);
|
||||
return (
|
||||
validator.isAnimationNameKeyword(value2) || validator.isIdentifier(value2)
|
||||
);
|
||||
}
|
||||
|
||||
function areSameFunction(validator, value1, value2) {
|
||||
@ -32,11 +48,20 @@ function areSameFunction(validator, value1, value2) {
|
||||
}
|
||||
|
||||
function backgroundPosition(validator, value1, value2) {
|
||||
if (!understandable(validator, value1, value2, 0, true) && !(validator.isBackgroundPositionKeyword(value2) || validator.isGlobal(value2))) {
|
||||
if (
|
||||
!understandable(validator, value1, value2, 0, true) &&
|
||||
!(
|
||||
validator.isBackgroundPositionKeyword(value2) ||
|
||||
validator.isGlobal(value2)
|
||||
)
|
||||
) {
|
||||
return false;
|
||||
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
|
||||
return true;
|
||||
} else if (validator.isBackgroundPositionKeyword(value2) || validator.isGlobal(value2)) {
|
||||
} else if (
|
||||
validator.isBackgroundPositionKeyword(value2) ||
|
||||
validator.isGlobal(value2)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -44,11 +69,17 @@ function backgroundPosition(validator, value1, value2) {
|
||||
}
|
||||
|
||||
function backgroundSize(validator, value1, value2) {
|
||||
if (!understandable(validator, value1, value2, 0, true) && !(validator.isBackgroundSizeKeyword(value2) || validator.isGlobal(value2))) {
|
||||
if (
|
||||
!understandable(validator, value1, value2, 0, true) &&
|
||||
!(validator.isBackgroundSizeKeyword(value2) || validator.isGlobal(value2))
|
||||
) {
|
||||
return false;
|
||||
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
|
||||
return true;
|
||||
} else if (validator.isBackgroundSizeKeyword(value2) || validator.isGlobal(value2)) {
|
||||
} else if (
|
||||
validator.isBackgroundSizeKeyword(value2) ||
|
||||
validator.isGlobal(value2)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -56,13 +87,22 @@ function backgroundSize(validator, value1, value2) {
|
||||
}
|
||||
|
||||
function color(validator, value1, value2) {
|
||||
if (!understandable(validator, value1, value2, 0, true) && !validator.isColor(value2)) {
|
||||
if (
|
||||
!understandable(validator, value1, value2, 0, true) &&
|
||||
!validator.isColor(value2)
|
||||
) {
|
||||
return false;
|
||||
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
|
||||
return true;
|
||||
} else if (!validator.colorOpacity && (validator.isRgbColor(value1) || validator.isHslColor(value1))) {
|
||||
} else if (
|
||||
!validator.colorOpacity &&
|
||||
(validator.isRgbColor(value1) || validator.isHslColor(value1))
|
||||
) {
|
||||
return false;
|
||||
} else if (!validator.colorOpacity && (validator.isRgbColor(value2) || validator.isHslColor(value2))) {
|
||||
} else if (
|
||||
!validator.colorOpacity &&
|
||||
(validator.isRgbColor(value2) || validator.isHslColor(value2))
|
||||
) {
|
||||
return false;
|
||||
} else if (validator.isColor(value1) && validator.isColor(value2)) {
|
||||
return true;
|
||||
@ -82,7 +122,10 @@ function fontFamily(validator, value1, value2) {
|
||||
}
|
||||
|
||||
function image(validator, value1, value2) {
|
||||
if (!understandable(validator, value1, value2, 0, true) && !validator.isImage(value2)) {
|
||||
if (
|
||||
!understandable(validator, value1, value2, 0, true) &&
|
||||
!validator.isImage(value2)
|
||||
) {
|
||||
return false;
|
||||
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
|
||||
return true;
|
||||
@ -96,8 +139,11 @@ function image(validator, value1, value2) {
|
||||
}
|
||||
|
||||
function keyword(propertyName) {
|
||||
return function(validator, value1, value2) {
|
||||
if (!understandable(validator, value1, value2, 0, true) && !validator.isKeyword(propertyName)(value2)) {
|
||||
return function (validator, value1, value2) {
|
||||
if (
|
||||
!understandable(validator, value1, value2, 0, true) &&
|
||||
!validator.isKeyword(propertyName)(value2)
|
||||
) {
|
||||
return false;
|
||||
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
|
||||
return true;
|
||||
@ -108,19 +154,27 @@ function keyword(propertyName) {
|
||||
}
|
||||
|
||||
function keywordWithGlobal(propertyName) {
|
||||
return function(validator, value1, value2) {
|
||||
if (!understandable(validator, value1, value2, 0, true) && !(validator.isKeyword(propertyName)(value2) || validator.isGlobal(value2))) {
|
||||
return function (validator, value1, value2) {
|
||||
if (
|
||||
!understandable(validator, value1, value2, 0, true) &&
|
||||
!(validator.isKeyword(propertyName)(value2) || validator.isGlobal(value2))
|
||||
) {
|
||||
return false;
|
||||
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return validator.isKeyword(propertyName)(value2) || validator.isGlobal(value2);
|
||||
return (
|
||||
validator.isKeyword(propertyName)(value2) || validator.isGlobal(value2)
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
function propertyName(validator, value1, value2) {
|
||||
if (!understandable(validator, value1, value2, 0, true) && !validator.isIdentifier(value2)) {
|
||||
if (
|
||||
!understandable(validator, value1, value2, 0, true) &&
|
||||
!validator.isIdentifier(value2)
|
||||
) {
|
||||
return false;
|
||||
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
|
||||
return true;
|
||||
@ -130,23 +184,35 @@ function propertyName(validator, value1, value2) {
|
||||
}
|
||||
|
||||
function sameFunctionOrValue(validator, value1, value2) {
|
||||
return areSameFunction(validator, value1, value2) ?
|
||||
true :
|
||||
value1 === value2;
|
||||
return areSameFunction(validator, value1, value2) ? true : value1 === value2;
|
||||
}
|
||||
|
||||
function textShadow(validator, value1, value2) {
|
||||
if (!understandable(validator, value1, value2, 0, true) && !(validator.isUnit(value2) || validator.isColor(value2) || validator.isGlobal(value2))) {
|
||||
if (
|
||||
!understandable(validator, value1, value2, 0, true) &&
|
||||
!(
|
||||
validator.isUnit(value2) ||
|
||||
validator.isColor(value2) ||
|
||||
validator.isGlobal(value2)
|
||||
)
|
||||
) {
|
||||
return false;
|
||||
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return validator.isUnit(value2) || validator.isColor(value2) || validator.isGlobal(value2);
|
||||
return (
|
||||
validator.isUnit(value2) ||
|
||||
validator.isColor(value2) ||
|
||||
validator.isGlobal(value2)
|
||||
);
|
||||
}
|
||||
|
||||
function time(validator, value1, value2) {
|
||||
if (!understandable(validator, value1, value2, 0, true) && !validator.isTime(value2)) {
|
||||
if (
|
||||
!understandable(validator, value1, value2, 0, true) &&
|
||||
!validator.isTime(value2)
|
||||
) {
|
||||
return false;
|
||||
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
|
||||
return true;
|
||||
@ -156,7 +222,12 @@ function time(validator, value1, value2) {
|
||||
return true;
|
||||
} else if (validator.isTime(value1)) {
|
||||
return false;
|
||||
} else if (validator.isFunction(value1) && !validator.isPrefixed(value1) && validator.isFunction(value2) && !validator.isPrefixed(value2)) {
|
||||
} else if (
|
||||
validator.isFunction(value1) &&
|
||||
!validator.isPrefixed(value1) &&
|
||||
validator.isFunction(value2) &&
|
||||
!validator.isPrefixed(value2)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -164,7 +235,10 @@ function time(validator, value1, value2) {
|
||||
}
|
||||
|
||||
function timingFunction(validator, value1, value2) {
|
||||
if (!understandable(validator, value1, value2, 0, true) && !(validator.isTimingFunction(value2) || validator.isGlobal(value2))) {
|
||||
if (
|
||||
!understandable(validator, value1, value2, 0, true) &&
|
||||
!(validator.isTimingFunction(value2) || validator.isGlobal(value2))
|
||||
) {
|
||||
return false;
|
||||
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
|
||||
return true;
|
||||
@ -174,7 +248,10 @@ function timingFunction(validator, value1, value2) {
|
||||
}
|
||||
|
||||
function unit(validator, value1, value2) {
|
||||
if (!understandable(validator, value1, value2, 0, true) && !validator.isUnit(value2)) {
|
||||
if (
|
||||
!understandable(validator, value1, value2, 0, true) &&
|
||||
!validator.isUnit(value2)
|
||||
) {
|
||||
return false;
|
||||
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
|
||||
return true;
|
||||
@ -184,7 +261,12 @@ function unit(validator, value1, value2) {
|
||||
return true;
|
||||
} else if (validator.isUnit(value1)) {
|
||||
return false;
|
||||
} else if (validator.isFunction(value1) && !validator.isPrefixed(value1) && validator.isFunction(value2) && !validator.isPrefixed(value2)) {
|
||||
} else if (
|
||||
validator.isFunction(value1) &&
|
||||
!validator.isPrefixed(value1) &&
|
||||
validator.isFunction(value2) &&
|
||||
!validator.isPrefixed(value2)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -194,23 +276,36 @@ function unit(validator, value1, value2) {
|
||||
function unitOrKeywordWithGlobal(propertyName) {
|
||||
var byKeyword = keywordWithGlobal(propertyName);
|
||||
|
||||
return function(validator, value1, value2) {
|
||||
return unit(validator, value1, value2) || byKeyword(validator, value1, value2);
|
||||
return function (validator, value1, value2) {
|
||||
return (
|
||||
unit(validator, value1, value2) || byKeyword(validator, value1, value2)
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
function unitOrNumber(validator, value1, value2) {
|
||||
if (!understandable(validator, value1, value2, 0, true) && !(validator.isUnit(value2) || validator.isNumber(value2))) {
|
||||
if (
|
||||
!understandable(validator, value1, value2, 0, true) &&
|
||||
!(validator.isUnit(value2) || validator.isNumber(value2))
|
||||
) {
|
||||
return false;
|
||||
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
|
||||
return true;
|
||||
} else if ((validator.isUnit(value1) || validator.isNumber(value1)) && !(validator.isUnit(value2) || validator.isNumber(value2))) {
|
||||
} else if (
|
||||
(validator.isUnit(value1) || validator.isNumber(value1)) &&
|
||||
!(validator.isUnit(value2) || validator.isNumber(value2))
|
||||
) {
|
||||
return false;
|
||||
} else if (validator.isUnit(value2) || validator.isNumber(value2)) {
|
||||
return true;
|
||||
} else if (validator.isUnit(value1) || validator.isNumber(value1)) {
|
||||
return false;
|
||||
} else if (validator.isFunction(value1) && !validator.isPrefixed(value1) && validator.isFunction(value2) && !validator.isPrefixed(value2)) {
|
||||
} else if (
|
||||
validator.isFunction(value1) &&
|
||||
!validator.isPrefixed(value1) &&
|
||||
validator.isFunction(value2) &&
|
||||
!validator.isPrefixed(value2)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -218,7 +313,10 @@ function unitOrNumber(validator, value1, value2) {
|
||||
}
|
||||
|
||||
function zIndex(validator, value1, value2) {
|
||||
if (!understandable(validator, value1, value2, 0, true) && !validator.isZIndex(value2)) {
|
||||
if (
|
||||
!understandable(validator, value1, value2, 0, true) &&
|
||||
!validator.isZIndex(value2)
|
||||
) {
|
||||
return false;
|
||||
} else if (validator.isVariable(value1) && validator.isVariable(value2)) {
|
||||
return true;
|
||||
@ -236,7 +334,7 @@ module.exports = {
|
||||
time: time,
|
||||
timingFunction: timingFunction,
|
||||
unit: unit,
|
||||
unitOrNumber: unitOrNumber
|
||||
unitOrNumber: unitOrNumber,
|
||||
},
|
||||
property: {
|
||||
animationDirection: keywordWithGlobal('animation-direction'),
|
||||
@ -278,6 +376,6 @@ module.exports = {
|
||||
verticalAlign: unitOrKeywordWithGlobal('vertical-align'),
|
||||
visibility: keywordWithGlobal('visibility'),
|
||||
whiteSpace: keywordWithGlobal('white-space'),
|
||||
zIndex: zIndex
|
||||
}
|
||||
zIndex: zIndex,
|
||||
},
|
||||
};
|
||||
|
Reference in New Issue
Block a user