mirror of
https://github.com/S2-/minifyfromhtml.git
synced 2025-08-03 20:30:04 +02:00
update node modules
This commit is contained in:
35
node_modules/clean-css/lib/optimizer/validator.js
generated
vendored
35
node_modules/clean-css/lib/optimizer/validator.js
generated
vendored
@@ -6,11 +6,14 @@ var functionAnyRegexStr = '(' + variableRegexStr + '|' + functionNoVendorRegexSt
|
||||
var calcRegex = new RegExp('^(\\-moz\\-|\\-webkit\\-)?calc\\([^\\)]+\\)$', 'i');
|
||||
var decimalRegex = /[0-9]/;
|
||||
var functionAnyRegex = new RegExp('^' + functionAnyRegexStr + '$', 'i');
|
||||
var hslColorRegex = /^hsl\(\s{0,31}[\-\.]?\d+\s{0,31},\s{0,31}\.?\d+%\s{0,31},\s{0,31}\.?\d+%\s{0,31}\)|hsla\(\s{0,31}[\-\.]?\d+\s{0,31},\s{0,31}\.?\d+%\s{0,31},\s{0,31}\.?\d+%\s{0,31},\s{0,31}\.?\d+\s{0,31}\)$/i;
|
||||
var identifierRegex = /^(\-[a-z0-9_][a-z0-9\-_]*|[a-z][a-z0-9\-_]*)$/i;
|
||||
var hexAlphaColorRegex = /^#(?:[0-9a-f]{4}|[0-9a-f]{8})$/i;
|
||||
var hslColorRegex = /^hsl\(\s{0,31}[\-\.]?\d+\s{0,31},\s{0,31}\d*\.?\d+%\s{0,31},\s{0,31}\d*\.?\d+%\s{0,31}\)|hsla\(\s{0,31}[\-\.]?\d+\s{0,31},\s{0,31}\d*\.?\d+%\s{0,31},\s{0,31}\d*\.?\d+%\s{0,31},\s{0,31}\.?\d+\s{0,31}\)$/;
|
||||
var identifierRegex = /^(\-[a-z0-9_][a-z0-9\-_]*|[a-z_][a-z0-9\-_]*)$/i;
|
||||
var namedEntityRegex = /^[a-z]+$/i;
|
||||
var prefixRegex = /^-([a-z0-9]|-)*$/i;
|
||||
var quotedTextRegex = /^("[^"]*"|'[^']*')$/i;
|
||||
var rgbColorRegex = /^rgb\(\s{0,31}[\d]{1,3}\s{0,31},\s{0,31}[\d]{1,3}\s{0,31},\s{0,31}[\d]{1,3}\s{0,31}\)|rgba\(\s{0,31}[\d]{1,3}\s{0,31},\s{0,31}[\d]{1,3}\s{0,31},\s{0,31}[\d]{1,3}\s{0,31},\s{0,31}[\.\d]+\s{0,31}\)$/i;
|
||||
var timeUnitPattern = /\d+(s|ms)/;
|
||||
var timingFunctionRegex = /^(cubic\-bezier|steps)\([^\)]+\)$/;
|
||||
var validTimeUnits = ['ms', 's'];
|
||||
var urlRegex = /^url\([\s\S]+\)$/i;
|
||||
@@ -250,7 +253,7 @@ var Keywords = {
|
||||
'decimal',
|
||||
'decimal-leading-zero',
|
||||
'disc',
|
||||
'decimal|disc', // this is the default value of list-style-type, see comment in compactable.js
|
||||
'decimal|disc', // this is the default value of list-style-type, see comment in configuration.js
|
||||
'georgian',
|
||||
'lower-alpha',
|
||||
'lower-greek',
|
||||
@@ -281,7 +284,7 @@ var Keywords = {
|
||||
'center',
|
||||
'justify',
|
||||
'left',
|
||||
'left|right', // this is the default value of list-style-type, see comment in compactable.js
|
||||
'left|right', // this is the default value of list-style-type, see comment in configuration.js
|
||||
'right'
|
||||
],
|
||||
'text-decoration': [
|
||||
@@ -375,10 +378,18 @@ function isHslColor(value) {
|
||||
return hslColorRegex.test(value);
|
||||
}
|
||||
|
||||
function isHexAlphaColor(value) {
|
||||
return hexAlphaColorRegex.test(value);
|
||||
}
|
||||
|
||||
function isIdentifier(value) {
|
||||
return identifierRegex.test(value);
|
||||
}
|
||||
|
||||
function isQuotedText(value) {
|
||||
return quotedTextRegex.test(value);
|
||||
}
|
||||
|
||||
function isImage(value) {
|
||||
return value == 'none' || value == 'inherit' || isUrl(value);
|
||||
}
|
||||
@@ -418,7 +429,12 @@ function isTime(value) {
|
||||
var numberUpTo = scanForNumber(value);
|
||||
|
||||
return numberUpTo == value.length && parseInt(value) === 0 ||
|
||||
numberUpTo > -1 && validTimeUnits.indexOf(value.slice(numberUpTo + 1)) > -1;
|
||||
numberUpTo > -1 && validTimeUnits.indexOf(value.slice(numberUpTo + 1)) > -1 ||
|
||||
isCalculatedTime(value);
|
||||
}
|
||||
|
||||
function isCalculatedTime(value) {
|
||||
return isFunction(value) && timeUnitPattern.test(value);
|
||||
}
|
||||
|
||||
function isTimingFunction() {
|
||||
@@ -433,7 +449,7 @@ function isUnit(validUnits, value) {
|
||||
var numberUpTo = scanForNumber(value);
|
||||
|
||||
return numberUpTo == value.length && parseInt(value) === 0 ||
|
||||
numberUpTo > -1 && validUnits.indexOf(value.slice(numberUpTo + 1)) > -1 ||
|
||||
numberUpTo > -1 && validUnits.indexOf(value.slice(numberUpTo + 1).toLowerCase()) > -1 ||
|
||||
value == 'auto' ||
|
||||
value == 'inherit';
|
||||
}
|
||||
@@ -480,8 +496,13 @@ function validator(compatibility) {
|
||||
return !(value in compatibility.units) || compatibility.units[value] === true;
|
||||
});
|
||||
|
||||
if (compatibility.customUnits.rpx) {
|
||||
validUnits.push('rpx');
|
||||
}
|
||||
|
||||
return {
|
||||
colorOpacity: compatibility.colors.opacity,
|
||||
colorHexAlpha: compatibility.colors.hexAlpha,
|
||||
isAnimationDirectionKeyword: isKeyword('animation-direction'),
|
||||
isAnimationFillModeKeyword: isKeyword('animation-fill-mode'),
|
||||
isAnimationIterationCountKeyword: isKeyword('animation-iteration-count'),
|
||||
@@ -505,6 +526,7 @@ function validator(compatibility) {
|
||||
isFontWeightKeyword: isKeyword('font-weight'),
|
||||
isFunction: isFunction,
|
||||
isGlobal: isKeyword('^'),
|
||||
isHexAlphaColor: isHexAlphaColor,
|
||||
isHslColor: isHslColor,
|
||||
isIdentifier: isIdentifier,
|
||||
isImage: isImage,
|
||||
@@ -515,6 +537,7 @@ function validator(compatibility) {
|
||||
isNumber: isNumber,
|
||||
isPrefixed: isPrefixed,
|
||||
isPositiveNumber: isPositiveNumber,
|
||||
isQuotedText: isQuotedText,
|
||||
isRgbColor: isRgbColor,
|
||||
isStyleKeyword: isKeyword('*-style'),
|
||||
isTime: isTime,
|
||||
|
Reference in New Issue
Block a user