1
0
mirror of https://github.com/S2-/minifyfromhtml.git synced 2025-08-03 04:10: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

@@ -109,6 +109,7 @@ function property(context, tokens, position, lastPropertyAt) {
break;
case Token.COMMENT:
store(context, token);
store(context, breakFor(context, Breaks.AfterComment) + context.indentWith);
break;
case Token.PROPERTY:
store(context, token[1]);
@@ -142,8 +143,8 @@ function value(context, token) {
}
}
function allowsBreak(context, where) {
return context.format && context.format.breaks[where];
function breakFor(context, where) {
return context.format ? context.format.breaks[where] : emptyCharacter;
}
function allowsSpace(context, where) {
@@ -156,7 +157,7 @@ function openBrace(context, where, needsPrefixSpace) {
context.indentWith = context.format.indentWith.repeat(context.indentBy);
return (needsPrefixSpace && allowsSpace(context, Spaces.BeforeBlockBegins) ? Marker.SPACE : emptyCharacter) +
Marker.OPEN_CURLY_BRACKET +
(allowsBreak(context, where) ? context.format.breakWith : emptyCharacter) +
breakFor(context, where) +
context.indentWith;
} else {
return Marker.OPEN_CURLY_BRACKET;
@@ -167,10 +168,10 @@ function closeBrace(context, where, beforeBlockEnd, isLast) {
if (context.format) {
context.indentBy -= context.format.indentBy;
context.indentWith = context.format.indentWith.repeat(context.indentBy);
return (allowsBreak(context, Breaks.AfterProperty) || beforeBlockEnd && allowsBreak(context, Breaks.BeforeBlockEnds) ? context.format.breakWith : emptyCharacter) +
return (beforeBlockEnd ? breakFor(context, Breaks.BeforeBlockEnds) : breakFor(context, Breaks.AfterProperty)) +
context.indentWith +
Marker.CLOSE_CURLY_BRACKET +
(isLast ? emptyCharacter : (allowsBreak(context, where) ? context.format.breakWith : emptyCharacter) + context.indentWith);
(isLast ? emptyCharacter : breakFor(context, where) + context.indentWith);
} else {
return Marker.CLOSE_CURLY_BRACKET;
}
@@ -184,13 +185,13 @@ function colon(context) {
function semicolon(context, where, isLast) {
return context.format ?
Marker.SEMICOLON + (isLast || !allowsBreak(context, where) ? emptyCharacter : context.format.breakWith + context.indentWith) :
Marker.SEMICOLON + (isLast ? emptyCharacter : (breakFor(context, where) + context.indentWith)) :
Marker.SEMICOLON;
}
function comma(context) {
return context.format ?
Marker.COMMA + (allowsBreak(context, Breaks.BetweenSelectors) ? context.format.breakWith : emptyCharacter) + context.indentWith :
Marker.COMMA + breakFor(context, Breaks.BetweenSelectors) + context.indentWith :
Marker.COMMA;
}
@@ -223,7 +224,7 @@ function all(context, tokens) {
break;
case Token.COMMENT:
store(context, token);
store(context, allowsBreak(context, Breaks.AfterComment) ? context.format.breakWith : emptyCharacter);
store(context, breakFor(context, Breaks.AfterComment) + context.indentWith);
break;
case Token.RAW:
store(context, token);