prettier 1.15.1 → 1.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin-prettier.js +150 -51
- package/index.js +150 -51
- package/package.json +1 -1
- package/parser-angular.js +1 -1
- package/parser-babylon.js +1 -1
- package/parser-flow.js +1 -1
- package/parser-html.js +1 -1
- package/parser-markdown.js +1 -1
- package/parser-typescript.js +1 -1
- package/standalone.js +148 -49
package/index.js
CHANGED
|
@@ -12,7 +12,7 @@ var thirdParty = require('./third-party');
|
|
|
12
12
|
var thirdParty__default = thirdParty['default'];
|
|
13
13
|
|
|
14
14
|
var name = "prettier";
|
|
15
|
-
var version$1 = "1.15.
|
|
15
|
+
var version$1 = "1.15.2";
|
|
16
16
|
var description = "Prettier is an opinionated code formatter";
|
|
17
17
|
var bin = {
|
|
18
18
|
"prettier": "./bin/prettier.js"
|
|
@@ -31,7 +31,7 @@ var dependencies = {
|
|
|
31
31
|
"@babel/parser": "7.1.5",
|
|
32
32
|
"@glimmer/syntax": "0.30.3",
|
|
33
33
|
"@iarna/toml": "2.0.0",
|
|
34
|
-
"angular-estree-parser": "1.1.
|
|
34
|
+
"angular-estree-parser": "1.1.5",
|
|
35
35
|
"angular-html-parser": "1.0.0",
|
|
36
36
|
"camelcase": "4.1.0",
|
|
37
37
|
"chalk": "2.1.0",
|
|
@@ -108,7 +108,7 @@ var devDependencies = {
|
|
|
108
108
|
"jest-snapshot-serializer-raw": "1.1.0",
|
|
109
109
|
"jest-watch-typeahead": "0.1.0",
|
|
110
110
|
"mkdirp": "0.5.1",
|
|
111
|
-
"prettier": "1.15.
|
|
111
|
+
"prettier": "1.15.1",
|
|
112
112
|
"prettylint": "1.0.0",
|
|
113
113
|
"rimraf": "2.6.2",
|
|
114
114
|
"rollup": "0.47.6",
|
|
@@ -8859,6 +8859,17 @@ function optionInfoToSchema(optionInfo, _ref5) {
|
|
|
8859
8859
|
|
|
8860
8860
|
if (optionInfo.deprecated) {
|
|
8861
8861
|
handlers.deprecated = true;
|
|
8862
|
+
} // allow CLI overriding, e.g., prettier package.json --tab-width 1 --tab-width 2
|
|
8863
|
+
|
|
8864
|
+
|
|
8865
|
+
if (isCLI && !optionInfo.array) {
|
|
8866
|
+
var originalPreprocess = parameters.preprocess || function (x) {
|
|
8867
|
+
return x;
|
|
8868
|
+
};
|
|
8869
|
+
|
|
8870
|
+
parameters.preprocess = function (value, schema, utils) {
|
|
8871
|
+
return schema.preprocess(originalPreprocess(Array.isArray(value) ? value[value.length - 1] : value), utils);
|
|
8872
|
+
};
|
|
8862
8873
|
}
|
|
8863
8874
|
|
|
8864
8875
|
return optionInfo.array ? lib$1.ArraySchema.create(Object.assign(isCLI ? {
|
|
@@ -11270,9 +11281,8 @@ function isNextLineEmpty(text, node, locEnd) {
|
|
|
11270
11281
|
return isNextLineEmptyAfterIndex(text, locEnd(node));
|
|
11271
11282
|
}
|
|
11272
11283
|
|
|
11273
|
-
function
|
|
11284
|
+
function getNextNonSpaceNonCommentCharacterIndexWithStartIndex(text, idx) {
|
|
11274
11285
|
var oldIdx = null;
|
|
11275
|
-
var idx = locEnd(node);
|
|
11276
11286
|
|
|
11277
11287
|
while (idx !== oldIdx) {
|
|
11278
11288
|
oldIdx = idx;
|
|
@@ -11285,6 +11295,10 @@ function getNextNonSpaceNonCommentCharacterIndex(text, node, locEnd) {
|
|
|
11285
11295
|
return idx;
|
|
11286
11296
|
}
|
|
11287
11297
|
|
|
11298
|
+
function getNextNonSpaceNonCommentCharacterIndex(text, node, locEnd) {
|
|
11299
|
+
return getNextNonSpaceNonCommentCharacterIndexWithStartIndex(text, locEnd(node));
|
|
11300
|
+
}
|
|
11301
|
+
|
|
11288
11302
|
function getNextNonSpaceNonCommentCharacter(text, node, locEnd) {
|
|
11289
11303
|
return text.charAt(getNextNonSpaceNonCommentCharacterIndex(text, node, locEnd));
|
|
11290
11304
|
}
|
|
@@ -11678,6 +11692,7 @@ var util$1 = {
|
|
|
11678
11692
|
getParentExportDeclaration,
|
|
11679
11693
|
getPenultimate,
|
|
11680
11694
|
getLast: getLast$3,
|
|
11695
|
+
getNextNonSpaceNonCommentCharacterIndexWithStartIndex,
|
|
11681
11696
|
getNextNonSpaceNonCommentCharacterIndex,
|
|
11682
11697
|
getNextNonSpaceNonCommentCharacter,
|
|
11683
11698
|
skip,
|
|
@@ -22379,8 +22394,19 @@ function handleLastFunctionArgComments(text, precedingNode, enclosingNode, follo
|
|
|
22379
22394
|
}
|
|
22380
22395
|
|
|
22381
22396
|
if (enclosingNode && enclosingNode.type === "FunctionDeclaration" && followingNode && followingNode.type === "BlockStatement") {
|
|
22382
|
-
|
|
22383
|
-
|
|
22397
|
+
var functionParamRightParenIndex = function () {
|
|
22398
|
+
if (enclosingNode.params.length !== 0) {
|
|
22399
|
+
return util$1.getNextNonSpaceNonCommentCharacterIndexWithStartIndex(text, options.locEnd(util$1.getLast(enclosingNode.params)));
|
|
22400
|
+
}
|
|
22401
|
+
|
|
22402
|
+
var functionParamLeftParenIndex = util$1.getNextNonSpaceNonCommentCharacterIndexWithStartIndex(text, options.locEnd(enclosingNode.id));
|
|
22403
|
+
return util$1.getNextNonSpaceNonCommentCharacterIndexWithStartIndex(text, functionParamLeftParenIndex + 1);
|
|
22404
|
+
}();
|
|
22405
|
+
|
|
22406
|
+
if (options.locStart(comment) > functionParamRightParenIndex) {
|
|
22407
|
+
addBlockStatementFirstComment(followingNode, comment);
|
|
22408
|
+
return true;
|
|
22409
|
+
}
|
|
22384
22410
|
}
|
|
22385
22411
|
|
|
22386
22412
|
return false;
|
|
@@ -22982,6 +23008,7 @@ function needsParens(path$$1, options) {
|
|
|
22982
23008
|
case "SpreadProperty":
|
|
22983
23009
|
case "BinaryExpression":
|
|
22984
23010
|
case "LogicalExpression":
|
|
23011
|
+
case "NGPipeExpression":
|
|
22985
23012
|
case "ExportDefaultDeclaration":
|
|
22986
23013
|
case "AwaitExpression":
|
|
22987
23014
|
case "JSXSpreadAttribute":
|
|
@@ -23244,13 +23271,14 @@ function genericPrint(path$$1, options, printPath, args) {
|
|
|
23244
23271
|
var parentExportDecl = getParentExportDeclaration$1(path$$1);
|
|
23245
23272
|
var decorators = [];
|
|
23246
23273
|
|
|
23247
|
-
if (node.
|
|
23274
|
+
if (node.type === "ClassMethod" || node.type === "ClassProperty" || node.type === "TSAbstractClassProperty" || node.type === "ClassPrivateProperty") {// their decorators are handled themselves
|
|
23275
|
+
} else if (node.decorators && node.decorators.length > 0 && // If the parent node is an export declaration and the decorator
|
|
23248
23276
|
// was written before the export, the export will be responsible
|
|
23249
23277
|
// for printing the decorators.
|
|
23250
23278
|
!(parentExportDecl && options.locStart(parentExportDecl, {
|
|
23251
23279
|
ignoreDecorators: true
|
|
23252
23280
|
}) > options.locStart(node.decorators[0]))) {
|
|
23253
|
-
var shouldBreak = node.type === "
|
|
23281
|
+
var shouldBreak = node.type === "ClassExpression" || node.type === "ClassDeclaration" || hasNewlineBetweenOrAfterDecorators(node, options);
|
|
23254
23282
|
var separator = shouldBreak ? hardline$3 : line$3;
|
|
23255
23283
|
path$$1.each(function (decoratorPath) {
|
|
23256
23284
|
var decorator = decoratorPath.getValue();
|
|
@@ -23313,6 +23341,15 @@ function genericPrint(path$$1, options, printPath, args) {
|
|
|
23313
23341
|
return concat$4(parts);
|
|
23314
23342
|
}
|
|
23315
23343
|
|
|
23344
|
+
function hasNewlineBetweenOrAfterDecorators(node, options) {
|
|
23345
|
+
return hasNewlineInRange$1(options.originalText, options.locStart(node.decorators[0]), options.locEnd(getLast$4(node.decorators))) || hasNewline$2(options.originalText, options.locEnd(getLast$4(node.decorators)));
|
|
23346
|
+
}
|
|
23347
|
+
|
|
23348
|
+
function printDecorators(path$$1, options, print) {
|
|
23349
|
+
var node = path$$1.getValue();
|
|
23350
|
+
return group$1(concat$4([join$2(line$3, path$$1.map(print, "decorators")), hasNewlineBetweenOrAfterDecorators(node, options) ? hardline$3 : line$3]));
|
|
23351
|
+
}
|
|
23352
|
+
|
|
23316
23353
|
function hasPrettierIgnore(path$$1) {
|
|
23317
23354
|
return hasIgnoreComment$1(path$$1) || hasJsxIgnoreComment(path$$1);
|
|
23318
23355
|
}
|
|
@@ -24003,7 +24040,7 @@ function printPathNoParens(path$$1, options, print, args) {
|
|
|
24003
24040
|
parts.push(n.abstract ? "abstract " : "", printTypeScriptModifiers(path$$1, options, print), "interface ", path$$1.call(print, "id"), n.typeParameters ? path$$1.call(print, "typeParameters") : "", " ");
|
|
24004
24041
|
|
|
24005
24042
|
if (n.heritage.length) {
|
|
24006
|
-
parts.push(group$1(indent$2(concat$4([softline$1, "extends ", indent$2(join$2(concat$4([",", line$3]), path$$1.map(print, "heritage"))), " "]))));
|
|
24043
|
+
parts.push(group$1(indent$2(concat$4([softline$1, "extends ", (n.heritage.length === 1 ? identity$1 : indent$2)(join$2(concat$4([",", line$3]), path$$1.map(print, "heritage"))), " "]))));
|
|
24007
24044
|
}
|
|
24008
24045
|
|
|
24009
24046
|
parts.push(path$$1.call(print, "body"));
|
|
@@ -24044,10 +24081,10 @@ function printPathNoParens(path$$1, options, print, args) {
|
|
|
24044
24081
|
|
|
24045
24082
|
var _parent3 = path$$1.getParentNode(0);
|
|
24046
24083
|
|
|
24047
|
-
var
|
|
24084
|
+
var isFlowInterfaceLikeBody = isTypeAnnotation && _parent3 && (_parent3.type === "InterfaceDeclaration" || _parent3.type === "DeclareInterface" || _parent3.type === "DeclareClass") && path$$1.getName() === "body";
|
|
24085
|
+
var shouldBreak = n.type === "TSInterfaceBody" || isFlowInterfaceLikeBody || n.type === "ObjectPattern" && _parent3.type !== "FunctionDeclaration" && _parent3.type !== "FunctionExpression" && _parent3.type !== "ArrowFunctionExpression" && _parent3.type !== "AssignmentPattern" && _parent3.type !== "CatchClause" && n.properties.some(function (property) {
|
|
24048
24086
|
return property.value && (property.value.type === "ObjectPattern" || property.value.type === "ArrayPattern");
|
|
24049
24087
|
}) || n.type !== "ObjectPattern" && firstProperty && hasNewlineInRange$1(options.originalText, options.locStart(n), options.locStart(firstProperty));
|
|
24050
|
-
var isFlowInterfaceLikeBody = isTypeAnnotation && _parent3 && (_parent3.type === "InterfaceDeclaration" || _parent3.type === "DeclareInterface" || _parent3.type === "DeclareClass") && path$$1.getName() === "body";
|
|
24051
24088
|
var separator = isFlowInterfaceLikeBody ? ";" : n.type === "TSInterfaceBody" || n.type === "TSTypeLiteral" ? ifBreak$1(semi, ";") : ",";
|
|
24052
24089
|
var leftBrace = n.exact ? "{|" : "{";
|
|
24053
24090
|
var rightBrace = n.exact ? "|}" : "}"; // Unfortunately, things are grouped together in the ast can be
|
|
@@ -24141,6 +24178,10 @@ function printPathNoParens(path$$1, options, print, args) {
|
|
|
24141
24178
|
// Babel 6
|
|
24142
24179
|
|
|
24143
24180
|
case "ClassMethod":
|
|
24181
|
+
if (n.decorators && n.decorators.length !== 0) {
|
|
24182
|
+
parts.push(printDecorators(path$$1, options, print));
|
|
24183
|
+
}
|
|
24184
|
+
|
|
24144
24185
|
if (n.static) {
|
|
24145
24186
|
parts.push("static ");
|
|
24146
24187
|
}
|
|
@@ -24659,6 +24700,10 @@ function printPathNoParens(path$$1, options, print, args) {
|
|
|
24659
24700
|
case "TSAbstractClassProperty":
|
|
24660
24701
|
case "ClassPrivateProperty":
|
|
24661
24702
|
{
|
|
24703
|
+
if (n.decorators && n.decorators.length !== 0) {
|
|
24704
|
+
parts.push(printDecorators(path$$1, options, print));
|
|
24705
|
+
}
|
|
24706
|
+
|
|
24662
24707
|
if (n.accessibility) {
|
|
24663
24708
|
parts.push(n.accessibility + " ");
|
|
24664
24709
|
}
|
|
@@ -25026,7 +25071,7 @@ function printPathNoParens(path$$1, options, print, args) {
|
|
|
25026
25071
|
}
|
|
25027
25072
|
|
|
25028
25073
|
if (n["extends"].length > 0) {
|
|
25029
|
-
parts.push(group$1(indent$2(concat$4([line$3, "extends ", indent$2(join$2(concat$4([",", line$3]), path$$1.map(print, "extends")))]))));
|
|
25074
|
+
parts.push(group$1(indent$2(concat$4([line$3, "extends ", (n.extends.length === 1 ? identity$1 : indent$2)(join$2(concat$4([",", line$3]), path$$1.map(print, "extends")))]))));
|
|
25030
25075
|
}
|
|
25031
25076
|
|
|
25032
25077
|
parts.push(" ", path$$1.call(print, "body"));
|
|
@@ -25569,13 +25614,14 @@ function printPathNoParens(path$$1, options, print, args) {
|
|
|
25569
25614
|
parts.push("declare ");
|
|
25570
25615
|
}
|
|
25571
25616
|
|
|
25572
|
-
parts.push(printTypeScriptModifiers(path$$1, options, print));
|
|
25617
|
+
parts.push(printTypeScriptModifiers(path$$1, options, print));
|
|
25618
|
+
var textBetweenNodeAndItsId = options.originalText.slice(options.locStart(n), options.locStart(n.id)); // Global declaration looks like this:
|
|
25573
25619
|
// (declare)? global { ... }
|
|
25574
25620
|
|
|
25575
|
-
var isGlobalDeclaration = n.id.type === "Identifier" && n.id.name === "global" && !/namespace|module/.test(
|
|
25621
|
+
var isGlobalDeclaration = n.id.type === "Identifier" && n.id.name === "global" && !/namespace|module/.test(textBetweenNodeAndItsId);
|
|
25576
25622
|
|
|
25577
25623
|
if (!isGlobalDeclaration) {
|
|
25578
|
-
parts.push(isExternalModule ? "module " : "namespace ");
|
|
25624
|
+
parts.push(isExternalModule || /\smodule\s/.test(textBetweenNodeAndItsId) ? "module " : "namespace ");
|
|
25579
25625
|
}
|
|
25580
25626
|
}
|
|
25581
25627
|
|
|
@@ -25858,7 +25904,8 @@ var functionCompositionFunctionNames = new Set(["pipe", // RxJS, Ramda
|
|
|
25858
25904
|
"composeK", // Ramda
|
|
25859
25905
|
"flow", // Lodash
|
|
25860
25906
|
"flowRight", // Lodash
|
|
25861
|
-
"connect" // Redux
|
|
25907
|
+
"connect", // Redux
|
|
25908
|
+
"createSelector" // Reselect
|
|
25862
25909
|
]);
|
|
25863
25910
|
|
|
25864
25911
|
function isFunctionCompositionFunction(node) {
|
|
@@ -27608,7 +27655,7 @@ function isTestCall(n, parent) {
|
|
|
27608
27655
|
return false;
|
|
27609
27656
|
}
|
|
27610
27657
|
|
|
27611
|
-
return isFunctionOrArrowExpression(n.arguments[1]) && n.arguments[1].params.length <= 1 || isAngularTestWrapper(n.arguments[1]);
|
|
27658
|
+
return (n.arguments.length === 2 ? isFunctionOrArrowExpression(n.arguments[1]) : isFunctionOrArrowExpressionWithBody(n.arguments[1]) && n.arguments[1].params.length <= 1) || isAngularTestWrapper(n.arguments[1]);
|
|
27612
27659
|
}
|
|
27613
27660
|
}
|
|
27614
27661
|
|
|
@@ -27633,13 +27680,17 @@ function isFunctionOrArrowExpression(node) {
|
|
|
27633
27680
|
return node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression";
|
|
27634
27681
|
}
|
|
27635
27682
|
|
|
27683
|
+
function isFunctionOrArrowExpressionWithBody(node) {
|
|
27684
|
+
return node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression" && node.body.type === "BlockStatement";
|
|
27685
|
+
}
|
|
27686
|
+
|
|
27636
27687
|
function isUnitTestSetUp(n) {
|
|
27637
27688
|
var unitTestSetUpRe = /^(before|after)(Each|All)$/;
|
|
27638
27689
|
return n.callee.type === "Identifier" && unitTestSetUpRe.test(n.callee.name) && n.arguments.length === 1;
|
|
27639
27690
|
}
|
|
27640
27691
|
|
|
27641
27692
|
function isTheOnlyJSXElementInMarkdown(options, path$$1) {
|
|
27642
|
-
if (options.parentParser !== "markdown") {
|
|
27693
|
+
if (options.parentParser !== "markdown" && options.parentParser !== "mdx") {
|
|
27643
27694
|
return false;
|
|
27644
27695
|
}
|
|
27645
27696
|
|
|
@@ -27724,6 +27775,10 @@ function rawText(node) {
|
|
|
27724
27775
|
return node.extra ? node.extra.raw : node.raw;
|
|
27725
27776
|
}
|
|
27726
27777
|
|
|
27778
|
+
function identity$1(x) {
|
|
27779
|
+
return x;
|
|
27780
|
+
}
|
|
27781
|
+
|
|
27727
27782
|
var printerEstree = {
|
|
27728
27783
|
preprocess: preprocess_1,
|
|
27729
27784
|
print: genericPrint,
|
|
@@ -28928,7 +28983,7 @@ function genericPrint$2(path$$1, options, print) {
|
|
|
28928
28983
|
return concat$8(["@", // If a Less file ends up being parsed with the SCSS parser, Less
|
|
28929
28984
|
// variable declarations will be parsed as at-rules with names ending
|
|
28930
28985
|
// with a colon, so keep the original case then.
|
|
28931
|
-
isDetachedRulesetCallNode(node) || node.name.endsWith(":") ? node.name : maybeToLowerCase(node.name), node.params ? concat$8([isDetachedRulesetCallNode(node) ? "" : isTemplatePlaceholderNode(node) ? node.raws.afterName : " ", path$$1.call(print, "params")]) : "", node.selector ? indent$5(concat$8([" ", path$$1.call(print, "selector")])) : "", node.value ? group$6(concat$8([" ", path$$1.call(print, "value"), isSCSSControlDirectiveNode(node) ? hasParensAroundNode(node) ? " " : line$5 : ""])) : node.name === "else" ? " " : "", node.nodes ? concat$8([isSCSSControlDirectiveNode(node) ? "" : " ", "{", indent$5(concat$8([node.nodes.length > 0 ? softline$3 : "", printNodeSequence(path$$1, options, print)])), softline$3, "}"]) : isTemplatePlaceholderNode(node) && !_parentNode.raws.semicolon && options.originalText[options.locEnd(node) - 1] !== ";" ? "" : ";"]);
|
|
28986
|
+
isDetachedRulesetCallNode(node) || node.name.endsWith(":") ? node.name : maybeToLowerCase(node.name), node.params ? concat$8([isDetachedRulesetCallNode(node) ? "" : isTemplatePlaceholderNode(node) && /^\s*\n/.test(node.raws.afterName) ? /^\s*\n\s*\n/.test(node.raws.afterName) ? concat$8([hardline$6, hardline$6]) : hardline$6 : " ", path$$1.call(print, "params")]) : "", node.selector ? indent$5(concat$8([" ", path$$1.call(print, "selector")])) : "", node.value ? group$6(concat$8([" ", path$$1.call(print, "value"), isSCSSControlDirectiveNode(node) ? hasParensAroundNode(node) ? " " : line$5 : ""])) : node.name === "else" ? " " : "", node.nodes ? concat$8([isSCSSControlDirectiveNode(node) ? "" : " ", "{", indent$5(concat$8([node.nodes.length > 0 ? softline$3 : "", printNodeSequence(path$$1, options, print)])), softline$3, "}"]) : isTemplatePlaceholderNode(node) && !_parentNode.raws.semicolon && options.originalText[options.locEnd(node) - 1] !== ";" ? "" : ";"]);
|
|
28932
28987
|
}
|
|
28933
28988
|
// postcss-media-query-parser
|
|
28934
28989
|
|
|
@@ -29230,7 +29285,7 @@ function genericPrint$2(path$$1, options, print) {
|
|
|
29230
29285
|
|
|
29231
29286
|
|
|
29232
29287
|
if (isGridValue) {
|
|
29233
|
-
if (iNode.source.start.line !== iNextNode.source.start.line) {
|
|
29288
|
+
if (iNode.source && iNextNode.source && iNode.source.start.line !== iNextNode.source.start.line) {
|
|
29234
29289
|
_parts.push(hardline$6);
|
|
29235
29290
|
|
|
29236
29291
|
didBreak = true;
|
|
@@ -30368,7 +30423,7 @@ var languageGraphql = {
|
|
|
30368
30423
|
printers: printers$3
|
|
30369
30424
|
};
|
|
30370
30425
|
|
|
30371
|
-
const json$6 = {"cjkPattern":"[\\u1100-\\u11ff\\u2e80-\\u2e99\\u2e9b-\\u2ef3\\u2f00-\\u2fd5\\u3000-\\u303f\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\
|
|
30426
|
+
const json$6 = {"cjkPattern":"[\\u1100-\\u11ff\\u2e80-\\u2e99\\u2e9b-\\u2ef3\\u2f00-\\u2fd5\\u3000-\\u303f\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312e\\u3131-\\u318e\\u3190-\\u3191\\u3196-\\u31ba\\u31c0-\\u31e3\\u31f0-\\u321e\\u322a-\\u3247\\u3260-\\u327e\\u328a-\\u32b0\\u32c0-\\u32cb\\u32d0-\\u32fe\\u3300-\\u3370\\u337b-\\u337f\\u33e0-\\u33fe\\u3400-\\u4db5\\u4e00-\\u9fea\\ua960-\\ua97c\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufe10-\\ufe1f\\ufe30-\\ufe6f\\uff00-\\uffef]|[\\ud840-\\ud868\\ud86a-\\ud86c\\ud86f-\\ud872\\ud874-\\ud879][\\udc00-\\udfff]|\\ud82c[\\udc00-\\udd1e]|\\ud83c[\\ude00\\ude50-\\ude51]|\\ud869[\\udc00-\\uded6\\udf00-\\udfff]|\\ud86d[\\udc00-\\udf34\\udf40-\\udfff]|\\ud86e[\\udc00-\\udc1d\\udc20-\\udfff]|\\ud873[\\udc00-\\udea1\\udeb0-\\udfff]|\\ud87a[\\udc00-\\udfe0]|\\ud87e[\\udc00-\\ude1d]","kPattern":"[\\u1100-\\u11ff\\u3001-\\u3003\\u3008-\\u3011\\u3013-\\u301f\\u302e-\\u3030\\u3037\\u30fb\\u3131-\\u318e\\u3200-\\u321e\\u3260-\\u327e\\ua960-\\ua97c\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\ufe45-\\ufe46\\uff61-\\uff65\\uffa0-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc]","punctuationPattern":"[\\u0021-\\u002f\\u003a-\\u0040\\u005b-\\u0060\\u007b-\\u007e\\u00a1\\u00a7\\u00ab\\u00b6-\\u00b7\\u00bb\\u00bf\\u037e\\u0387\\u055a-\\u055f\\u0589-\\u058a\\u05be\\u05c0\\u05c3\\u05c6\\u05f3-\\u05f4\\u0609-\\u060a\\u060c-\\u060d\\u061b\\u061e-\\u061f\\u066a-\\u066d\\u06d4\\u0700-\\u070d\\u07f7-\\u07f9\\u0830-\\u083e\\u085e\\u0964-\\u0965\\u0970\\u09fd\\u0af0\\u0df4\\u0e4f\\u0e5a-\\u0e5b\\u0f04-\\u0f12\\u0f14\\u0f3a-\\u0f3d\\u0f85\\u0fd0-\\u0fd4\\u0fd9-\\u0fda\\u104a-\\u104f\\u10fb\\u1360-\\u1368\\u1400\\u166d-\\u166e\\u169b-\\u169c\\u16eb-\\u16ed\\u1735-\\u1736\\u17d4-\\u17d6\\u17d8-\\u17da\\u1800-\\u180a\\u1944-\\u1945\\u1a1e-\\u1a1f\\u1aa0-\\u1aa6\\u1aa8-\\u1aad\\u1b5a-\\u1b60\\u1bfc-\\u1bff\\u1c3b-\\u1c3f\\u1c7e-\\u1c7f\\u1cc0-\\u1cc7\\u1cd3\\u2010-\\u2027\\u2030-\\u2043\\u2045-\\u2051\\u2053-\\u205e\\u207d-\\u207e\\u208d-\\u208e\\u2308-\\u230b\\u2329-\\u232a\\u2768-\\u2775\\u27c5-\\u27c6\\u27e6-\\u27ef\\u2983-\\u2998\\u29d8-\\u29db\\u29fc-\\u29fd\\u2cf9-\\u2cfc\\u2cfe-\\u2cff\\u2d70\\u2e00-\\u2e2e\\u2e30-\\u2e49\\u3001-\\u3003\\u3008-\\u3011\\u3014-\\u301f\\u3030\\u303d\\u30a0\\u30fb\\ua4fe-\\ua4ff\\ua60d-\\ua60f\\ua673\\ua67e\\ua6f2-\\ua6f7\\ua874-\\ua877\\ua8ce-\\ua8cf\\ua8f8-\\ua8fa\\ua8fc\\ua92e-\\ua92f\\ua95f\\ua9c1-\\ua9cd\\ua9de-\\ua9df\\uaa5c-\\uaa5f\\uaade-\\uaadf\\uaaf0-\\uaaf1\\uabeb\\ufd3e-\\ufd3f\\ufe10-\\ufe19\\ufe30-\\ufe52\\ufe54-\\ufe61\\ufe63\\ufe68\\ufe6a-\\ufe6b\\uff01-\\uff03\\uff05-\\uff0a\\uff0c-\\uff0f\\uff1a-\\uff1b\\uff1f-\\uff20\\uff3b-\\uff3d\\uff3f\\uff5b\\uff5d\\uff5f-\\uff65]|\\ud800[\\udd00-\\udd02\\udf9f\\udfd0]|\\ud801[\\udd6f]|\\ud802[\\udc57\\udd1f\\udd3f\\ude50-\\ude58\\ude7f\\udef0-\\udef6\\udf39-\\udf3f\\udf99-\\udf9c]|\\ud804[\\udc47-\\udc4d\\udcbb-\\udcbc\\udcbe-\\udcc1\\udd40-\\udd43\\udd74-\\udd75\\uddc5-\\uddc9\\uddcd\\udddb\\udddd-\\udddf\\ude38-\\ude3d\\udea9]|\\ud805[\\udc4b-\\udc4f\\udc5b\\udc5d\\udcc6\\uddc1-\\uddd7\\ude41-\\ude43\\ude60-\\ude6c\\udf3c-\\udf3e]|\\ud806[\\ude3f-\\ude46\\ude9a-\\ude9c\\ude9e-\\udea2]|\\ud807[\\udc41-\\udc45\\udc70-\\udc71]|\\ud809[\\udc70-\\udc74]|\\ud81a[\\ude6e-\\ude6f\\udef5\\udf37-\\udf3b\\udf44]|\\ud82f[\\udc9f]|\\ud836[\\ude87-\\ude8b]|\\ud83a[\\udd5e-\\udd5f]"};
|
|
30372
30427
|
|
|
30373
30428
|
var cjkPattern = json$6.cjkPattern;
|
|
30374
30429
|
var kPattern = json$6.kPattern;
|
|
@@ -30376,10 +30431,10 @@ var punctuationPattern$1 = json$6.punctuationPattern;
|
|
|
30376
30431
|
var getLast$5 = util$1.getLast;
|
|
30377
30432
|
var kRegex = new RegExp(kPattern);
|
|
30378
30433
|
var punctuationRegex = new RegExp(punctuationPattern$1);
|
|
30379
|
-
/**
|
|
30380
|
-
* split text into whitespaces and words
|
|
30381
|
-
* @param {string} text
|
|
30382
|
-
* @return {Array<{ type: "whitespace", value: " " | "\n" | "" } | { type: "word", value: string }>}
|
|
30434
|
+
/**
|
|
30435
|
+
* split text into whitespaces and words
|
|
30436
|
+
* @param {string} text
|
|
30437
|
+
* @return {Array<{ type: "whitespace", value: " " | "\n" | "" } | { type: "word", value: string }>}
|
|
30383
30438
|
*/
|
|
30384
30439
|
|
|
30385
30440
|
function splitText$1(text, options) {
|
|
@@ -30489,7 +30544,7 @@ function getFencedCodeBlockValue$2(node, originalText) {
|
|
|
30489
30544
|
var text = originalText.slice(node.position.start.offset, node.position.end.offset);
|
|
30490
30545
|
var leadingSpaceCount = text.match(/^\s*/)[0].length;
|
|
30491
30546
|
var replaceRegex = new RegExp(`^\\s{0,${leadingSpaceCount}}`);
|
|
30492
|
-
var lineContents = text.split("\n");
|
|
30547
|
+
var lineContents = text.replace(/\r\n?/g, "\n").split("\n");
|
|
30493
30548
|
var markerStyle = text[leadingSpaceCount]; // ` or ~
|
|
30494
30549
|
|
|
30495
30550
|
var marker = text.slice(leadingSpaceCount).match(new RegExp(`^[${markerStyle}]+`))[0]; // https://spec.commonmark.org/0.28/#example-104: Closing fences may be indented by 0-3 spaces
|
|
@@ -31030,7 +31085,7 @@ function genericPrint$4(path$$1, options, print) {
|
|
|
31030
31085
|
if (node.isIndented) {
|
|
31031
31086
|
// indented code block
|
|
31032
31087
|
var alignment = " ".repeat(4);
|
|
31033
|
-
return align$2(alignment, concat$12([alignment,
|
|
31088
|
+
return align$2(alignment, concat$12([alignment, replaceNewlinesWith(node.value, hardline$10)]));
|
|
31034
31089
|
} // fenced code block
|
|
31035
31090
|
|
|
31036
31091
|
|
|
@@ -31038,7 +31093,7 @@ function genericPrint$4(path$$1, options, print) {
|
|
|
31038
31093
|
|
|
31039
31094
|
var _style2 = styleUnit.repeat(Math.max(3, util$1.getMaxContinuousCount(node.value, styleUnit) + 1));
|
|
31040
31095
|
|
|
31041
|
-
return concat$12([_style2, node.lang || "", hardline$10,
|
|
31096
|
+
return concat$12([_style2, node.lang || "", hardline$10, replaceNewlinesWith(getFencedCodeBlockValue(node, options.originalText), hardline$10), hardline$10, _style2]);
|
|
31042
31097
|
}
|
|
31043
31098
|
|
|
31044
31099
|
case "yaml":
|
|
@@ -31194,7 +31249,7 @@ function getNthListSiblingIndex(node, parentNode) {
|
|
|
31194
31249
|
}
|
|
31195
31250
|
|
|
31196
31251
|
function replaceNewlinesWith(str, doc$$2) {
|
|
31197
|
-
return join$9(doc$$2, str.split("\n"));
|
|
31252
|
+
return join$9(doc$$2, str.replace(/\r\n?/g, "\n").split("\n"));
|
|
31198
31253
|
}
|
|
31199
31254
|
|
|
31200
31255
|
function getNthSiblingIndex(node, parentNode, condition) {
|
|
@@ -32016,33 +32071,47 @@ function mapObject(object, fn) {
|
|
|
32016
32071
|
return newObject;
|
|
32017
32072
|
}
|
|
32018
32073
|
|
|
32019
|
-
function
|
|
32020
|
-
|
|
32074
|
+
function shouldPreserveContent$1(node) {
|
|
32075
|
+
if (node.type === "element" && node.fullName === "template" && node.attrMap.lang && node.attrMap.lang !== "html") {
|
|
32076
|
+
return true;
|
|
32077
|
+
} // unterminated node in ie conditional comment
|
|
32078
|
+
// e.g. <!--[if lt IE 9]><html><![endif]-->
|
|
32021
32079
|
|
|
32022
|
-
|
|
32023
|
-
|
|
32080
|
+
|
|
32081
|
+
if (node.type === "ieConditionalComment" && node.lastChild && !node.lastChild.isSelfClosing && !node.lastChild.endSourceSpan) {
|
|
32082
|
+
return true;
|
|
32083
|
+
} // incomplete html in ie conditional comment
|
|
32084
|
+
// e.g. <!--[if lt IE 9]></div><![endif]-->
|
|
32085
|
+
|
|
32086
|
+
|
|
32087
|
+
if (node.type === "ieConditionalComment" && !node.complete) {
|
|
32088
|
+
return true;
|
|
32024
32089
|
} // TODO: handle non-text children in <pre>
|
|
32025
32090
|
|
|
32026
32091
|
|
|
32027
32092
|
if (isPreLikeNode$1(node) && node.children.some(function (child) {
|
|
32028
|
-
return child.type !== "text";
|
|
32093
|
+
return child.type !== "text" && child.type !== "interpolation";
|
|
32029
32094
|
})) {
|
|
32030
32095
|
return true;
|
|
32031
32096
|
}
|
|
32032
32097
|
|
|
32033
|
-
|
|
32098
|
+
return false;
|
|
32099
|
+
}
|
|
32034
32100
|
|
|
32035
|
-
|
|
32101
|
+
function hasPrettierIgnore$3(node) {
|
|
32102
|
+
if (node.type === "attribute" || node.type === "text") {
|
|
32036
32103
|
return false;
|
|
32037
32104
|
}
|
|
32038
32105
|
|
|
32039
|
-
|
|
32106
|
+
if (!node.parent) {
|
|
32107
|
+
return false;
|
|
32108
|
+
}
|
|
32040
32109
|
|
|
32041
|
-
if (typeof index !== "number" || index === 0) {
|
|
32110
|
+
if (typeof node.index !== "number" || node.index === 0) {
|
|
32042
32111
|
return false;
|
|
32043
32112
|
}
|
|
32044
32113
|
|
|
32045
|
-
var prevNode =
|
|
32114
|
+
var prevNode = node.parent.children[node.index - 1];
|
|
32046
32115
|
return isPrettierIgnore$1(prevNode);
|
|
32047
32116
|
}
|
|
32048
32117
|
|
|
@@ -32089,6 +32158,10 @@ function isLeadingSpaceSensitiveNode(node) {
|
|
|
32089
32158
|
return false;
|
|
32090
32159
|
}
|
|
32091
32160
|
|
|
32161
|
+
if ((node.type === "text" || node.type === "interpolation") && node.prev && (node.prev.type === "text" || node.prev.type === "interpolation")) {
|
|
32162
|
+
return true;
|
|
32163
|
+
}
|
|
32164
|
+
|
|
32092
32165
|
if (!node.parent || node.parent.cssDisplay === "none") {
|
|
32093
32166
|
return false;
|
|
32094
32167
|
}
|
|
@@ -32117,6 +32190,10 @@ function isTrailingSpaceSensitiveNode(node) {
|
|
|
32117
32190
|
return false;
|
|
32118
32191
|
}
|
|
32119
32192
|
|
|
32193
|
+
if ((node.type === "text" || node.type === "interpolation") && node.next && (node.next.type === "text" || node.next.type === "interpolation")) {
|
|
32194
|
+
return true;
|
|
32195
|
+
}
|
|
32196
|
+
|
|
32120
32197
|
if (!node.parent || node.parent.cssDisplay === "none") {
|
|
32121
32198
|
return false;
|
|
32122
32199
|
}
|
|
@@ -32183,7 +32260,7 @@ function isCustomElementWithSurroundingLineBreak(node) {
|
|
|
32183
32260
|
}
|
|
32184
32261
|
|
|
32185
32262
|
function isCustomElement(node) {
|
|
32186
|
-
return node.type === "element" && !node.namespace && node.name.includes("-");
|
|
32263
|
+
return node.type === "element" && !node.namespace && (node.name.includes("-") || /[A-Z]/.test(node.name[0]));
|
|
32187
32264
|
}
|
|
32188
32265
|
|
|
32189
32266
|
function hasSurroundingLineBreak(node) {
|
|
@@ -32483,10 +32560,14 @@ function normalizeParts$2(parts) {
|
|
|
32483
32560
|
return newParts;
|
|
32484
32561
|
}
|
|
32485
32562
|
|
|
32486
|
-
function identity$
|
|
32563
|
+
function identity$2(x) {
|
|
32487
32564
|
return x;
|
|
32488
32565
|
}
|
|
32489
32566
|
|
|
32567
|
+
function shouldNotPrintClosingTag$1(node) {
|
|
32568
|
+
return !node.isSelfClosing && !node.endSourceSpan && (hasPrettierIgnore$3(node) || shouldPreserveContent$1(node.parent));
|
|
32569
|
+
}
|
|
32570
|
+
|
|
32490
32571
|
var utils_1$3 = {
|
|
32491
32572
|
HTML_ELEMENT_ATTRIBUTES,
|
|
32492
32573
|
HTML_TAGS,
|
|
@@ -32502,7 +32583,7 @@ var utils_1$3 = {
|
|
|
32502
32583
|
getNodeCssStyleWhiteSpace,
|
|
32503
32584
|
getPrettierIgnoreAttributeCommentData: getPrettierIgnoreAttributeCommentData$1,
|
|
32504
32585
|
hasPrettierIgnore: hasPrettierIgnore$3,
|
|
32505
|
-
identity: identity$
|
|
32586
|
+
identity: identity$2,
|
|
32506
32587
|
inferScriptParser: inferScriptParser$1,
|
|
32507
32588
|
isDanglingSpaceSensitiveNode,
|
|
32508
32589
|
isFrontMatterNode,
|
|
@@ -32516,7 +32597,9 @@ var utils_1$3 = {
|
|
|
32516
32597
|
preferHardlineAsLeadingSpaces: preferHardlineAsLeadingSpaces$1,
|
|
32517
32598
|
preferHardlineAsTrailingSpaces,
|
|
32518
32599
|
replaceDocNewlines: replaceDocNewlines$1,
|
|
32519
|
-
replaceNewlines: replaceNewlines$1
|
|
32600
|
+
replaceNewlines: replaceNewlines$1,
|
|
32601
|
+
shouldNotPrintClosingTag: shouldNotPrintClosingTag$1,
|
|
32602
|
+
shouldPreserveContent: shouldPreserveContent$1
|
|
32520
32603
|
};
|
|
32521
32604
|
|
|
32522
32605
|
var canHaveInterpolation$1 = utils_1$3.canHaveInterpolation;
|
|
@@ -33388,6 +33471,8 @@ var normalizeParts$1 = utils_1$3.normalizeParts;
|
|
|
33388
33471
|
var preferHardlineAsLeadingSpaces = utils_1$3.preferHardlineAsLeadingSpaces;
|
|
33389
33472
|
var replaceDocNewlines = utils_1$3.replaceDocNewlines;
|
|
33390
33473
|
var replaceNewlines = utils_1$3.replaceNewlines;
|
|
33474
|
+
var shouldNotPrintClosingTag = utils_1$3.shouldNotPrintClosingTag;
|
|
33475
|
+
var shouldPreserveContent = utils_1$3.shouldPreserveContent;
|
|
33391
33476
|
var insertPragma$6 = pragma$9.insertPragma;
|
|
33392
33477
|
var printVueFor = syntaxVue.printVueFor;
|
|
33393
33478
|
var printVueSlotScope = syntaxVue.printVueSlotScope;
|
|
@@ -33498,7 +33583,7 @@ function genericPrint$5(path$$1, options, print) {
|
|
|
33498
33583
|
}) : isScriptLikeTag(node) && node.parent.type === "root" && options.parser === "vue" ? childrenDoc : indent$9(childrenDoc);
|
|
33499
33584
|
}(concat$14([shouldHugContent ? ifBreak$5(softline$7, "", {
|
|
33500
33585
|
groupId: attrGroupId
|
|
33501
|
-
}) : node.firstChild.type === "text" && node.firstChild.isWhitespaceSensitive && node.firstChild.isIndentationSensitive ? node.firstChild.value.indexOf("\n") === -1 ? "" : literalline$6 : node.firstChild.hasLeadingSpaces && node.firstChild.isLeadingSpaceSensitive ? line$9 : softline$7, printChildren$1(path$$1, options, print)])), (node.next ? needsToBorrowPrevClosingTagEndMarker(node.next) : needsToBorrowLastChildClosingTagEndMarker(node.parent)) ? node.lastChild.hasTrailingSpaces && node.lastChild.isTrailingSpaceSensitive ? " " : "" : shouldHugContent ? ifBreak$5(softline$7, "", {
|
|
33586
|
+
}) : node.firstChild.type === "text" && node.firstChild.isWhitespaceSensitive && node.firstChild.isIndentationSensitive ? node.children.length === 1 && node.firstChild.type === "text" && node.firstChild.value.indexOf("\n") === -1 || node.firstChild.sourceSpan.start.line === node.lastChild.sourceSpan.end.line ? "" : literalline$6 : node.firstChild.hasLeadingSpaces && node.firstChild.isLeadingSpaceSensitive ? line$9 : softline$7, printChildren$1(path$$1, options, print)])), (node.next ? needsToBorrowPrevClosingTagEndMarker(node.next) : needsToBorrowLastChildClosingTagEndMarker(node.parent)) ? node.lastChild.hasTrailingSpaces && node.lastChild.isTrailingSpaceSensitive ? " " : "" : shouldHugContent ? ifBreak$5(softline$7, "", {
|
|
33502
33587
|
groupId: attrGroupId
|
|
33503
33588
|
}) : node.lastChild.hasTrailingSpaces && node.lastChild.isTrailingSpaceSensitive ? line$9 : node.type === "element" && isPreLikeNode(node) && node.lastChild.type === "text" && (node.lastChild.value.indexOf("\n") === -1 || new RegExp(`\\n\\s{${options.tabWidth * countParents(path$$1, function (n) {
|
|
33504
33589
|
return n.parent && n.parent.type !== "root";
|
|
@@ -33616,12 +33701,17 @@ function printChildren$1(path$$1, options, print) {
|
|
|
33616
33701
|
}, "children"));
|
|
33617
33702
|
|
|
33618
33703
|
function printChild(childPath) {
|
|
33619
|
-
|
|
33620
|
-
|
|
33704
|
+
var child = childPath.getValue();
|
|
33705
|
+
|
|
33706
|
+
if (hasPrettierIgnore$2(child)) {
|
|
33707
|
+
return concat$14([].concat(printOpeningTagPrefix(child), replaceNewlines(options.originalText.slice(options.locStart(child) + (child.prev && needsToBorrowNextOpeningTagStartMarker(child.prev) ? printOpeningTagStartMarker(child).length : 0), options.locEnd(child) - (child.next && needsToBorrowPrevClosingTagEndMarker(child.next) ? printClosingTagEndMarker(child).length : 0)), literalline$6), printClosingTagSuffix(child)));
|
|
33621
33708
|
}
|
|
33622
33709
|
|
|
33623
|
-
|
|
33624
|
-
|
|
33710
|
+
if (shouldPreserveContent(child)) {
|
|
33711
|
+
return concat$14([].concat(printOpeningTagPrefix(child), group$14(printOpeningTag(childPath, options, print)), replaceNewlines(options.originalText.slice(child.startSourceSpan.end.offset - (child.firstChild && needsToBorrowParentOpeningTagEndMarker(child.firstChild) ? printOpeningTagEndMarker(child).length : 0), child.endSourceSpan.start.offset + (child.lastChild && needsToBorrowParentClosingTagStartMarker(child.lastChild) ? printClosingTagStartMarker(child).length : 0)), literalline$6), printClosingTag(child), printClosingTagSuffix(child)));
|
|
33712
|
+
}
|
|
33713
|
+
|
|
33714
|
+
return print(childPath);
|
|
33625
33715
|
}
|
|
33626
33716
|
|
|
33627
33717
|
function printBetweenLine(prevNode, nextNode) {
|
|
@@ -33679,7 +33769,7 @@ function printOpeningTag(path$$1, options, print) {
|
|
|
33679
33769
|
};
|
|
33680
33770
|
return path$$1.map(function (attrPath) {
|
|
33681
33771
|
var attr = attrPath.getValue();
|
|
33682
|
-
return hasPrettierIgnoreAttribute(attr) ? options.originalText.slice(options.locStart(attr), options.locEnd(attr)) : print(attrPath);
|
|
33772
|
+
return hasPrettierIgnoreAttribute(attr) ? concat$14(replaceNewlines(options.originalText.slice(options.locStart(attr), options.locEnd(attr)), literalline$6)) : print(attrPath);
|
|
33683
33773
|
}, "attrs");
|
|
33684
33774
|
}(node.prev && node.prev.type === "comment" && getPrettierIgnoreAttributeCommentData(node.prev.value)))])),
|
|
33685
33775
|
/**
|
|
@@ -33825,6 +33915,10 @@ function printOpeningTagEndMarker(node) {
|
|
|
33825
33915
|
function printClosingTagStartMarker(node) {
|
|
33826
33916
|
assert(!node.isSelfClosing);
|
|
33827
33917
|
|
|
33918
|
+
if (shouldNotPrintClosingTag(node)) {
|
|
33919
|
+
return "";
|
|
33920
|
+
}
|
|
33921
|
+
|
|
33828
33922
|
switch (node.type) {
|
|
33829
33923
|
case "ieConditionalComment":
|
|
33830
33924
|
return "<!";
|
|
@@ -33835,6 +33929,10 @@ function printClosingTagStartMarker(node) {
|
|
|
33835
33929
|
}
|
|
33836
33930
|
|
|
33837
33931
|
function printClosingTagEndMarker(node) {
|
|
33932
|
+
if (shouldNotPrintClosingTag(node)) {
|
|
33933
|
+
return "";
|
|
33934
|
+
}
|
|
33935
|
+
|
|
33838
33936
|
switch (node.type) {
|
|
33839
33937
|
case "comment":
|
|
33840
33938
|
return "-->";
|
|
@@ -33937,7 +34035,8 @@ function printEmbeddedAttributeValue(node, originalTextToDoc, options) {
|
|
|
33937
34035
|
// copied from https://github.com/vuejs/vue/blob/v2.5.17/src/compiler/codegen/events.js#L3-L4
|
|
33938
34036
|
var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/;
|
|
33939
34037
|
var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
|
|
33940
|
-
var value = getValue()
|
|
34038
|
+
var value = getValue() // https://github.com/vuejs/vue/blob/v2.5.17/src/compiler/helpers.js#L104
|
|
34039
|
+
.trim();
|
|
33941
34040
|
return printMaybeHug(simplePathRE.test(value) || fnExpRE.test(value) ? textToDoc(value, {
|
|
33942
34041
|
parser: "__js_expression"
|
|
33943
34042
|
}) : stripTrailingHardline$2(textToDoc(value, {
|