1
0
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:
s2
2021-05-07 15:56:33 +02:00
parent d81e8e9fb8
commit 3ec373077c
550 changed files with 84712 additions and 15991 deletions

View File

@@ -1,8 +1,12 @@
var DEFAULTS = {
'*': {
colors: {
hexAlpha: false, // 4- and 8-character hex notation
opacity: true // rgba / hsla
},
customUnits: {
rpx: false
},
properties: {
backgroundClipMerging: true, // background-clip to shorthand
backgroundOriginMerging: true, // background-origin to shorthand
@@ -11,11 +15,11 @@ var DEFAULTS = {
ieBangHack: false, // !ie suffix hacks on IE<8
ieFilters: false, // whether to preserve `filter` and `-ms-filter` properties
iePrefixHack: false, // underscore / asterisk prefix hacks on IE
ieSuffixHack: false, // \9 suffix hacks on IE6-9
ieSuffixHack: false, // \9 suffix hacks on IE6-9, \0 suffix hack on IE6-11
merging: true, // merging properties into one
shorterLengthUnits: false, // optimize pixel units into `pt`, `pc` or `in` units
spaceAfterClosingBrace: true, // 'url() no-repeat' to 'url()no-repeat'
urlQuotes: false, // whether to wrap content of `url()` into quotes or not
urlQuotes: true, // whether to wrap content of `url()` into quotes or not
zeroUnits: true // 0[unit] -> 0
},
selectors: {
@@ -75,9 +79,17 @@ var DEFAULTS = {
}
};
DEFAULTS.ie11 = DEFAULTS['*'];
DEFAULTS.ie11 = merge(DEFAULTS['*'], {
properties: {
ieSuffixHack: true
}
});
DEFAULTS.ie10 = DEFAULTS['*'];
DEFAULTS.ie10 = merge(DEFAULTS['*'], {
properties: {
ieSuffixHack: true
}
});
DEFAULTS.ie9 = merge(DEFAULTS['*'], {
properties: {

View File

@@ -98,36 +98,36 @@ function formatFrom(source) {
}
if (typeof source == 'object') {
return override(DEFAULTS, source);
}
if (typeof source == 'object') {
return override(DEFAULTS, source);
return remapBreaks(override(DEFAULTS, source));
}
if (typeof source == 'string' && source == BEAUTIFY_ALIAS) {
return override(DEFAULTS, {
breaks: breaks(true),
indentBy: 2,
spaces: spaces(true)
});
return remapBreaks(
override(DEFAULTS, {
breaks: breaks(true),
indentBy: 2,
spaces: spaces(true)
})
);
}
if (typeof source == 'string' && source == KEEP_BREAKS_ALIAS) {
return override(DEFAULTS, {
breaks: {
afterAtRule: true,
afterBlockBegins: true,
afterBlockEnds: true,
afterComment: true,
afterRuleEnds: true,
beforeBlockEnds: true
}
});
return remapBreaks(
override(DEFAULTS, {
breaks: {
afterAtRule: true,
afterBlockBegins: true,
afterBlockEnds: true,
afterComment: true,
afterRuleEnds: true,
beforeBlockEnds: true
}
})
);
}
if (typeof source == 'string') {
return override(DEFAULTS, toHash(source));
return remapBreaks(override(DEFAULTS, toHash(source)));
}
return DEFAULTS;
@@ -209,6 +209,23 @@ function mapIndentWith(value) {
}
}
function remapBreaks(source) {
for (var key in Breaks) {
var breakName = Breaks[key];
var breakValue = source.breaks[breakName];
if (breakValue === true) {
source.breaks[breakName] = source.breakWith;
} else if (breakValue === false) {
source.breaks[breakName] = '';
} else {
source.breaks[breakName] = source.breakWith.repeat(parseInt(breakValue));
}
}
return source;
}
module.exports = {
Breaks: Breaks,
Spaces: Spaces,

View File

@@ -31,8 +31,7 @@ DEFAULTS[OptimizationLevel.One] = {
specialComments: 'all',
tidyAtRules: true,
tidyBlockScopes: true,
tidySelectors: true,
transform: noop
tidySelectors: true
};
DEFAULTS[OptimizationLevel.Two] = {
mergeAdjacentRules: true,
@@ -62,15 +61,12 @@ var LIST_VALUE_SEPARATOR = ',';
var OPTION_SEPARATOR = ';';
var OPTION_VALUE_SEPARATOR = ':';
function noop() {}
function optimizationLevelFrom(source) {
var level = override(DEFAULTS, {});
var Zero = OptimizationLevel.Zero;
var One = OptimizationLevel.One;
var Two = OptimizationLevel.Two;
if (undefined === source) {
delete level[Two];
return level;

25
node_modules/clean-css/lib/options/plugins.js generated vendored Normal file
View File

@@ -0,0 +1,25 @@
function pluginsFrom(plugins) {
var flatPlugins = {
level1Value: [],
level1Property: [],
level2Block: []
};
plugins = plugins || [];
flatPlugins.level1Value = plugins
.map(function (plugin) { return plugin.level1 && plugin.level1.value; })
.filter(function (plugin) { return plugin != null; });
flatPlugins.level1Property = plugins
.map(function (plugin) { return plugin.level1 && plugin.level1.property; })
.filter(function (plugin) { return plugin != null; });
flatPlugins.level2Block = plugins
.map(function (plugin) { return plugin.level2 && plugin.level2.block; })
.filter(function (plugin) { return plugin != null; });
return flatPlugins;
}
module.exports = pluginsFrom;

View File

@@ -1,5 +1,11 @@
function rebaseFrom(rebaseOption) {
return undefined === rebaseOption ? true : !!rebaseOption;
function rebaseFrom(rebaseOption, rebaseToOption) {
if (undefined !== rebaseToOption) {
return true;
} else if (undefined === rebaseOption) {
return false;
} else {
return !!rebaseOption;
}
}
module.exports = rebaseFrom;