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/bin-prettier.js
CHANGED
|
@@ -14,7 +14,7 @@ var thirdParty__default = thirdParty['default'];
|
|
|
14
14
|
var readline = _interopDefault(require('readline'));
|
|
15
15
|
|
|
16
16
|
var name = "prettier";
|
|
17
|
-
var version$1 = "1.15.
|
|
17
|
+
var version$1 = "1.15.2";
|
|
18
18
|
var description = "Prettier is an opinionated code formatter";
|
|
19
19
|
var bin = {
|
|
20
20
|
"prettier": "./bin/prettier.js"
|
|
@@ -33,7 +33,7 @@ var dependencies = {
|
|
|
33
33
|
"@babel/parser": "7.1.5",
|
|
34
34
|
"@glimmer/syntax": "0.30.3",
|
|
35
35
|
"@iarna/toml": "2.0.0",
|
|
36
|
-
"angular-estree-parser": "1.1.
|
|
36
|
+
"angular-estree-parser": "1.1.5",
|
|
37
37
|
"angular-html-parser": "1.0.0",
|
|
38
38
|
"camelcase": "4.1.0",
|
|
39
39
|
"chalk": "2.1.0",
|
|
@@ -110,7 +110,7 @@ var devDependencies = {
|
|
|
110
110
|
"jest-snapshot-serializer-raw": "1.1.0",
|
|
111
111
|
"jest-watch-typeahead": "0.1.0",
|
|
112
112
|
"mkdirp": "0.5.1",
|
|
113
|
-
"prettier": "1.15.
|
|
113
|
+
"prettier": "1.15.1",
|
|
114
114
|
"prettylint": "1.0.0",
|
|
115
115
|
"rimraf": "2.6.2",
|
|
116
116
|
"rollup": "0.47.6",
|
|
@@ -8861,6 +8861,17 @@ function optionInfoToSchema(optionInfo, _ref5) {
|
|
|
8861
8861
|
|
|
8862
8862
|
if (optionInfo.deprecated) {
|
|
8863
8863
|
handlers.deprecated = true;
|
|
8864
|
+
} // allow CLI overriding, e.g., prettier package.json --tab-width 1 --tab-width 2
|
|
8865
|
+
|
|
8866
|
+
|
|
8867
|
+
if (isCLI && !optionInfo.array) {
|
|
8868
|
+
var originalPreprocess = parameters.preprocess || function (x) {
|
|
8869
|
+
return x;
|
|
8870
|
+
};
|
|
8871
|
+
|
|
8872
|
+
parameters.preprocess = function (value, schema, utils) {
|
|
8873
|
+
return schema.preprocess(originalPreprocess(Array.isArray(value) ? value[value.length - 1] : value), utils);
|
|
8874
|
+
};
|
|
8864
8875
|
}
|
|
8865
8876
|
|
|
8866
8877
|
return optionInfo.array ? lib$1.ArraySchema.create(Object.assign(isCLI ? {
|
|
@@ -11272,9 +11283,8 @@ function isNextLineEmpty(text, node, locEnd) {
|
|
|
11272
11283
|
return isNextLineEmptyAfterIndex(text, locEnd(node));
|
|
11273
11284
|
}
|
|
11274
11285
|
|
|
11275
|
-
function
|
|
11286
|
+
function getNextNonSpaceNonCommentCharacterIndexWithStartIndex(text, idx) {
|
|
11276
11287
|
var oldIdx = null;
|
|
11277
|
-
var idx = locEnd(node);
|
|
11278
11288
|
|
|
11279
11289
|
while (idx !== oldIdx) {
|
|
11280
11290
|
oldIdx = idx;
|
|
@@ -11287,6 +11297,10 @@ function getNextNonSpaceNonCommentCharacterIndex(text, node, locEnd) {
|
|
|
11287
11297
|
return idx;
|
|
11288
11298
|
}
|
|
11289
11299
|
|
|
11300
|
+
function getNextNonSpaceNonCommentCharacterIndex(text, node, locEnd) {
|
|
11301
|
+
return getNextNonSpaceNonCommentCharacterIndexWithStartIndex(text, locEnd(node));
|
|
11302
|
+
}
|
|
11303
|
+
|
|
11290
11304
|
function getNextNonSpaceNonCommentCharacter(text, node, locEnd) {
|
|
11291
11305
|
return text.charAt(getNextNonSpaceNonCommentCharacterIndex(text, node, locEnd));
|
|
11292
11306
|
}
|
|
@@ -11680,6 +11694,7 @@ var util$1 = {
|
|
|
11680
11694
|
getParentExportDeclaration,
|
|
11681
11695
|
getPenultimate,
|
|
11682
11696
|
getLast: getLast$3,
|
|
11697
|
+
getNextNonSpaceNonCommentCharacterIndexWithStartIndex,
|
|
11683
11698
|
getNextNonSpaceNonCommentCharacterIndex,
|
|
11684
11699
|
getNextNonSpaceNonCommentCharacter,
|
|
11685
11700
|
skip,
|
|
@@ -22381,8 +22396,19 @@ function handleLastFunctionArgComments(text, precedingNode, enclosingNode, follo
|
|
|
22381
22396
|
}
|
|
22382
22397
|
|
|
22383
22398
|
if (enclosingNode && enclosingNode.type === "FunctionDeclaration" && followingNode && followingNode.type === "BlockStatement") {
|
|
22384
|
-
|
|
22385
|
-
|
|
22399
|
+
var functionParamRightParenIndex = function () {
|
|
22400
|
+
if (enclosingNode.params.length !== 0) {
|
|
22401
|
+
return util$1.getNextNonSpaceNonCommentCharacterIndexWithStartIndex(text, options.locEnd(util$1.getLast(enclosingNode.params)));
|
|
22402
|
+
}
|
|
22403
|
+
|
|
22404
|
+
var functionParamLeftParenIndex = util$1.getNextNonSpaceNonCommentCharacterIndexWithStartIndex(text, options.locEnd(enclosingNode.id));
|
|
22405
|
+
return util$1.getNextNonSpaceNonCommentCharacterIndexWithStartIndex(text, functionParamLeftParenIndex + 1);
|
|
22406
|
+
}();
|
|
22407
|
+
|
|
22408
|
+
if (options.locStart(comment) > functionParamRightParenIndex) {
|
|
22409
|
+
addBlockStatementFirstComment(followingNode, comment);
|
|
22410
|
+
return true;
|
|
22411
|
+
}
|
|
22386
22412
|
}
|
|
22387
22413
|
|
|
22388
22414
|
return false;
|
|
@@ -22984,6 +23010,7 @@ function needsParens(path$$1, options) {
|
|
|
22984
23010
|
case "SpreadProperty":
|
|
22985
23011
|
case "BinaryExpression":
|
|
22986
23012
|
case "LogicalExpression":
|
|
23013
|
+
case "NGPipeExpression":
|
|
22987
23014
|
case "ExportDefaultDeclaration":
|
|
22988
23015
|
case "AwaitExpression":
|
|
22989
23016
|
case "JSXSpreadAttribute":
|
|
@@ -23246,13 +23273,14 @@ function genericPrint(path$$1, options, printPath, args) {
|
|
|
23246
23273
|
var parentExportDecl = getParentExportDeclaration$1(path$$1);
|
|
23247
23274
|
var decorators = [];
|
|
23248
23275
|
|
|
23249
|
-
if (node.
|
|
23276
|
+
if (node.type === "ClassMethod" || node.type === "ClassProperty" || node.type === "TSAbstractClassProperty" || node.type === "ClassPrivateProperty") {// their decorators are handled themselves
|
|
23277
|
+
} else if (node.decorators && node.decorators.length > 0 && // If the parent node is an export declaration and the decorator
|
|
23250
23278
|
// was written before the export, the export will be responsible
|
|
23251
23279
|
// for printing the decorators.
|
|
23252
23280
|
!(parentExportDecl && options.locStart(parentExportDecl, {
|
|
23253
23281
|
ignoreDecorators: true
|
|
23254
23282
|
}) > options.locStart(node.decorators[0]))) {
|
|
23255
|
-
var shouldBreak = node.type === "
|
|
23283
|
+
var shouldBreak = node.type === "ClassExpression" || node.type === "ClassDeclaration" || hasNewlineBetweenOrAfterDecorators(node, options);
|
|
23256
23284
|
var separator = shouldBreak ? hardline$3 : line$3;
|
|
23257
23285
|
path$$1.each(function (decoratorPath) {
|
|
23258
23286
|
var decorator = decoratorPath.getValue();
|
|
@@ -23315,6 +23343,15 @@ function genericPrint(path$$1, options, printPath, args) {
|
|
|
23315
23343
|
return concat$4(parts);
|
|
23316
23344
|
}
|
|
23317
23345
|
|
|
23346
|
+
function hasNewlineBetweenOrAfterDecorators(node, options) {
|
|
23347
|
+
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)));
|
|
23348
|
+
}
|
|
23349
|
+
|
|
23350
|
+
function printDecorators(path$$1, options, print) {
|
|
23351
|
+
var node = path$$1.getValue();
|
|
23352
|
+
return group$1(concat$4([join$2(line$3, path$$1.map(print, "decorators")), hasNewlineBetweenOrAfterDecorators(node, options) ? hardline$3 : line$3]));
|
|
23353
|
+
}
|
|
23354
|
+
|
|
23318
23355
|
function hasPrettierIgnore(path$$1) {
|
|
23319
23356
|
return hasIgnoreComment$1(path$$1) || hasJsxIgnoreComment(path$$1);
|
|
23320
23357
|
}
|
|
@@ -24005,7 +24042,7 @@ function printPathNoParens(path$$1, options, print, args) {
|
|
|
24005
24042
|
parts.push(n.abstract ? "abstract " : "", printTypeScriptModifiers(path$$1, options, print), "interface ", path$$1.call(print, "id"), n.typeParameters ? path$$1.call(print, "typeParameters") : "", " ");
|
|
24006
24043
|
|
|
24007
24044
|
if (n.heritage.length) {
|
|
24008
|
-
parts.push(group$1(indent$2(concat$4([softline$1, "extends ", indent$2(join$2(concat$4([",", line$3]), path$$1.map(print, "heritage"))), " "]))));
|
|
24045
|
+
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"))), " "]))));
|
|
24009
24046
|
}
|
|
24010
24047
|
|
|
24011
24048
|
parts.push(path$$1.call(print, "body"));
|
|
@@ -24046,10 +24083,10 @@ function printPathNoParens(path$$1, options, print, args) {
|
|
|
24046
24083
|
|
|
24047
24084
|
var _parent3 = path$$1.getParentNode(0);
|
|
24048
24085
|
|
|
24049
|
-
var
|
|
24086
|
+
var isFlowInterfaceLikeBody = isTypeAnnotation && _parent3 && (_parent3.type === "InterfaceDeclaration" || _parent3.type === "DeclareInterface" || _parent3.type === "DeclareClass") && path$$1.getName() === "body";
|
|
24087
|
+
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) {
|
|
24050
24088
|
return property.value && (property.value.type === "ObjectPattern" || property.value.type === "ArrayPattern");
|
|
24051
24089
|
}) || n.type !== "ObjectPattern" && firstProperty && hasNewlineInRange$1(options.originalText, options.locStart(n), options.locStart(firstProperty));
|
|
24052
|
-
var isFlowInterfaceLikeBody = isTypeAnnotation && _parent3 && (_parent3.type === "InterfaceDeclaration" || _parent3.type === "DeclareInterface" || _parent3.type === "DeclareClass") && path$$1.getName() === "body";
|
|
24053
24090
|
var separator = isFlowInterfaceLikeBody ? ";" : n.type === "TSInterfaceBody" || n.type === "TSTypeLiteral" ? ifBreak$1(semi, ";") : ",";
|
|
24054
24091
|
var leftBrace = n.exact ? "{|" : "{";
|
|
24055
24092
|
var rightBrace = n.exact ? "|}" : "}"; // Unfortunately, things are grouped together in the ast can be
|
|
@@ -24143,6 +24180,10 @@ function printPathNoParens(path$$1, options, print, args) {
|
|
|
24143
24180
|
// Babel 6
|
|
24144
24181
|
|
|
24145
24182
|
case "ClassMethod":
|
|
24183
|
+
if (n.decorators && n.decorators.length !== 0) {
|
|
24184
|
+
parts.push(printDecorators(path$$1, options, print));
|
|
24185
|
+
}
|
|
24186
|
+
|
|
24146
24187
|
if (n.static) {
|
|
24147
24188
|
parts.push("static ");
|
|
24148
24189
|
}
|
|
@@ -24661,6 +24702,10 @@ function printPathNoParens(path$$1, options, print, args) {
|
|
|
24661
24702
|
case "TSAbstractClassProperty":
|
|
24662
24703
|
case "ClassPrivateProperty":
|
|
24663
24704
|
{
|
|
24705
|
+
if (n.decorators && n.decorators.length !== 0) {
|
|
24706
|
+
parts.push(printDecorators(path$$1, options, print));
|
|
24707
|
+
}
|
|
24708
|
+
|
|
24664
24709
|
if (n.accessibility) {
|
|
24665
24710
|
parts.push(n.accessibility + " ");
|
|
24666
24711
|
}
|
|
@@ -25028,7 +25073,7 @@ function printPathNoParens(path$$1, options, print, args) {
|
|
|
25028
25073
|
}
|
|
25029
25074
|
|
|
25030
25075
|
if (n["extends"].length > 0) {
|
|
25031
|
-
parts.push(group$1(indent$2(concat$4([line$3, "extends ", indent$2(join$2(concat$4([",", line$3]), path$$1.map(print, "extends")))]))));
|
|
25076
|
+
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")))]))));
|
|
25032
25077
|
}
|
|
25033
25078
|
|
|
25034
25079
|
parts.push(" ", path$$1.call(print, "body"));
|
|
@@ -25571,13 +25616,14 @@ function printPathNoParens(path$$1, options, print, args) {
|
|
|
25571
25616
|
parts.push("declare ");
|
|
25572
25617
|
}
|
|
25573
25618
|
|
|
25574
|
-
parts.push(printTypeScriptModifiers(path$$1, options, print));
|
|
25619
|
+
parts.push(printTypeScriptModifiers(path$$1, options, print));
|
|
25620
|
+
var textBetweenNodeAndItsId = options.originalText.slice(options.locStart(n), options.locStart(n.id)); // Global declaration looks like this:
|
|
25575
25621
|
// (declare)? global { ... }
|
|
25576
25622
|
|
|
25577
|
-
var isGlobalDeclaration = n.id.type === "Identifier" && n.id.name === "global" && !/namespace|module/.test(
|
|
25623
|
+
var isGlobalDeclaration = n.id.type === "Identifier" && n.id.name === "global" && !/namespace|module/.test(textBetweenNodeAndItsId);
|
|
25578
25624
|
|
|
25579
25625
|
if (!isGlobalDeclaration) {
|
|
25580
|
-
parts.push(isExternalModule ? "module " : "namespace ");
|
|
25626
|
+
parts.push(isExternalModule || /\smodule\s/.test(textBetweenNodeAndItsId) ? "module " : "namespace ");
|
|
25581
25627
|
}
|
|
25582
25628
|
}
|
|
25583
25629
|
|
|
@@ -25860,7 +25906,8 @@ var functionCompositionFunctionNames = new Set(["pipe", // RxJS, Ramda
|
|
|
25860
25906
|
"composeK", // Ramda
|
|
25861
25907
|
"flow", // Lodash
|
|
25862
25908
|
"flowRight", // Lodash
|
|
25863
|
-
"connect" // Redux
|
|
25909
|
+
"connect", // Redux
|
|
25910
|
+
"createSelector" // Reselect
|
|
25864
25911
|
]);
|
|
25865
25912
|
|
|
25866
25913
|
function isFunctionCompositionFunction(node) {
|
|
@@ -27610,7 +27657,7 @@ function isTestCall(n, parent) {
|
|
|
27610
27657
|
return false;
|
|
27611
27658
|
}
|
|
27612
27659
|
|
|
27613
|
-
return isFunctionOrArrowExpression(n.arguments[1]) && n.arguments[1].params.length <= 1 || isAngularTestWrapper(n.arguments[1]);
|
|
27660
|
+
return (n.arguments.length === 2 ? isFunctionOrArrowExpression(n.arguments[1]) : isFunctionOrArrowExpressionWithBody(n.arguments[1]) && n.arguments[1].params.length <= 1) || isAngularTestWrapper(n.arguments[1]);
|
|
27614
27661
|
}
|
|
27615
27662
|
}
|
|
27616
27663
|
|
|
@@ -27635,13 +27682,17 @@ function isFunctionOrArrowExpression(node) {
|
|
|
27635
27682
|
return node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression";
|
|
27636
27683
|
}
|
|
27637
27684
|
|
|
27685
|
+
function isFunctionOrArrowExpressionWithBody(node) {
|
|
27686
|
+
return node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression" && node.body.type === "BlockStatement";
|
|
27687
|
+
}
|
|
27688
|
+
|
|
27638
27689
|
function isUnitTestSetUp(n) {
|
|
27639
27690
|
var unitTestSetUpRe = /^(before|after)(Each|All)$/;
|
|
27640
27691
|
return n.callee.type === "Identifier" && unitTestSetUpRe.test(n.callee.name) && n.arguments.length === 1;
|
|
27641
27692
|
}
|
|
27642
27693
|
|
|
27643
27694
|
function isTheOnlyJSXElementInMarkdown(options, path$$1) {
|
|
27644
|
-
if (options.parentParser !== "markdown") {
|
|
27695
|
+
if (options.parentParser !== "markdown" && options.parentParser !== "mdx") {
|
|
27645
27696
|
return false;
|
|
27646
27697
|
}
|
|
27647
27698
|
|
|
@@ -27726,6 +27777,10 @@ function rawText(node) {
|
|
|
27726
27777
|
return node.extra ? node.extra.raw : node.raw;
|
|
27727
27778
|
}
|
|
27728
27779
|
|
|
27780
|
+
function identity$1(x) {
|
|
27781
|
+
return x;
|
|
27782
|
+
}
|
|
27783
|
+
|
|
27729
27784
|
var printerEstree = {
|
|
27730
27785
|
preprocess: preprocess_1,
|
|
27731
27786
|
print: genericPrint,
|
|
@@ -28930,7 +28985,7 @@ function genericPrint$2(path$$1, options, print) {
|
|
|
28930
28985
|
return concat$8(["@", // If a Less file ends up being parsed with the SCSS parser, Less
|
|
28931
28986
|
// variable declarations will be parsed as at-rules with names ending
|
|
28932
28987
|
// with a colon, so keep the original case then.
|
|
28933
|
-
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] !== ";" ? "" : ";"]);
|
|
28988
|
+
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] !== ";" ? "" : ";"]);
|
|
28934
28989
|
}
|
|
28935
28990
|
// postcss-media-query-parser
|
|
28936
28991
|
|
|
@@ -29232,7 +29287,7 @@ function genericPrint$2(path$$1, options, print) {
|
|
|
29232
29287
|
|
|
29233
29288
|
|
|
29234
29289
|
if (isGridValue) {
|
|
29235
|
-
if (iNode.source.start.line !== iNextNode.source.start.line) {
|
|
29290
|
+
if (iNode.source && iNextNode.source && iNode.source.start.line !== iNextNode.source.start.line) {
|
|
29236
29291
|
_parts.push(hardline$6);
|
|
29237
29292
|
|
|
29238
29293
|
didBreak = true;
|
|
@@ -30370,7 +30425,7 @@ var languageGraphql = {
|
|
|
30370
30425
|
printers: printers$3
|
|
30371
30426
|
};
|
|
30372
30427
|
|
|
30373
|
-
const json$6 = {"cjkPattern":"[\\u1100-\\u11ff\\u2e80-\\u2e99\\u2e9b-\\u2ef3\\u2f00-\\u2fd5\\u3000-\\u303f\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\
|
|
30428
|
+
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]"};
|
|
30374
30429
|
|
|
30375
30430
|
var cjkPattern = json$6.cjkPattern;
|
|
30376
30431
|
var kPattern = json$6.kPattern;
|
|
@@ -30378,10 +30433,10 @@ var punctuationPattern$1 = json$6.punctuationPattern;
|
|
|
30378
30433
|
var getLast$5 = util$1.getLast;
|
|
30379
30434
|
var kRegex = new RegExp(kPattern);
|
|
30380
30435
|
var punctuationRegex = new RegExp(punctuationPattern$1);
|
|
30381
|
-
/**
|
|
30382
|
-
* split text into whitespaces and words
|
|
30383
|
-
* @param {string} text
|
|
30384
|
-
* @return {Array<{ type: "whitespace", value: " " | "\n" | "" } | { type: "word", value: string }>}
|
|
30436
|
+
/**
|
|
30437
|
+
* split text into whitespaces and words
|
|
30438
|
+
* @param {string} text
|
|
30439
|
+
* @return {Array<{ type: "whitespace", value: " " | "\n" | "" } | { type: "word", value: string }>}
|
|
30385
30440
|
*/
|
|
30386
30441
|
|
|
30387
30442
|
function splitText$1(text, options) {
|
|
@@ -30491,7 +30546,7 @@ function getFencedCodeBlockValue$2(node, originalText) {
|
|
|
30491
30546
|
var text = originalText.slice(node.position.start.offset, node.position.end.offset);
|
|
30492
30547
|
var leadingSpaceCount = text.match(/^\s*/)[0].length;
|
|
30493
30548
|
var replaceRegex = new RegExp(`^\\s{0,${leadingSpaceCount}}`);
|
|
30494
|
-
var lineContents = text.split("\n");
|
|
30549
|
+
var lineContents = text.replace(/\r\n?/g, "\n").split("\n");
|
|
30495
30550
|
var markerStyle = text[leadingSpaceCount]; // ` or ~
|
|
30496
30551
|
|
|
30497
30552
|
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
|
|
@@ -31032,7 +31087,7 @@ function genericPrint$4(path$$1, options, print) {
|
|
|
31032
31087
|
if (node.isIndented) {
|
|
31033
31088
|
// indented code block
|
|
31034
31089
|
var alignment = " ".repeat(4);
|
|
31035
|
-
return align$2(alignment, concat$12([alignment,
|
|
31090
|
+
return align$2(alignment, concat$12([alignment, replaceNewlinesWith(node.value, hardline$10)]));
|
|
31036
31091
|
} // fenced code block
|
|
31037
31092
|
|
|
31038
31093
|
|
|
@@ -31040,7 +31095,7 @@ function genericPrint$4(path$$1, options, print) {
|
|
|
31040
31095
|
|
|
31041
31096
|
var _style2 = styleUnit.repeat(Math.max(3, util$1.getMaxContinuousCount(node.value, styleUnit) + 1));
|
|
31042
31097
|
|
|
31043
|
-
return concat$12([_style2, node.lang || "", hardline$10,
|
|
31098
|
+
return concat$12([_style2, node.lang || "", hardline$10, replaceNewlinesWith(getFencedCodeBlockValue(node, options.originalText), hardline$10), hardline$10, _style2]);
|
|
31044
31099
|
}
|
|
31045
31100
|
|
|
31046
31101
|
case "yaml":
|
|
@@ -31196,7 +31251,7 @@ function getNthListSiblingIndex(node, parentNode) {
|
|
|
31196
31251
|
}
|
|
31197
31252
|
|
|
31198
31253
|
function replaceNewlinesWith(str, doc$$2) {
|
|
31199
|
-
return join$9(doc$$2, str.split("\n"));
|
|
31254
|
+
return join$9(doc$$2, str.replace(/\r\n?/g, "\n").split("\n"));
|
|
31200
31255
|
}
|
|
31201
31256
|
|
|
31202
31257
|
function getNthSiblingIndex(node, parentNode, condition) {
|
|
@@ -32018,33 +32073,47 @@ function mapObject(object, fn) {
|
|
|
32018
32073
|
return newObject;
|
|
32019
32074
|
}
|
|
32020
32075
|
|
|
32021
|
-
function
|
|
32022
|
-
|
|
32076
|
+
function shouldPreserveContent$1(node) {
|
|
32077
|
+
if (node.type === "element" && node.fullName === "template" && node.attrMap.lang && node.attrMap.lang !== "html") {
|
|
32078
|
+
return true;
|
|
32079
|
+
} // unterminated node in ie conditional comment
|
|
32080
|
+
// e.g. <!--[if lt IE 9]><html><![endif]-->
|
|
32023
32081
|
|
|
32024
|
-
|
|
32025
|
-
|
|
32082
|
+
|
|
32083
|
+
if (node.type === "ieConditionalComment" && node.lastChild && !node.lastChild.isSelfClosing && !node.lastChild.endSourceSpan) {
|
|
32084
|
+
return true;
|
|
32085
|
+
} // incomplete html in ie conditional comment
|
|
32086
|
+
// e.g. <!--[if lt IE 9]></div><![endif]-->
|
|
32087
|
+
|
|
32088
|
+
|
|
32089
|
+
if (node.type === "ieConditionalComment" && !node.complete) {
|
|
32090
|
+
return true;
|
|
32026
32091
|
} // TODO: handle non-text children in <pre>
|
|
32027
32092
|
|
|
32028
32093
|
|
|
32029
32094
|
if (isPreLikeNode$1(node) && node.children.some(function (child) {
|
|
32030
|
-
return child.type !== "text";
|
|
32095
|
+
return child.type !== "text" && child.type !== "interpolation";
|
|
32031
32096
|
})) {
|
|
32032
32097
|
return true;
|
|
32033
32098
|
}
|
|
32034
32099
|
|
|
32035
|
-
|
|
32100
|
+
return false;
|
|
32101
|
+
}
|
|
32036
32102
|
|
|
32037
|
-
|
|
32103
|
+
function hasPrettierIgnore$3(node) {
|
|
32104
|
+
if (node.type === "attribute" || node.type === "text") {
|
|
32038
32105
|
return false;
|
|
32039
32106
|
}
|
|
32040
32107
|
|
|
32041
|
-
|
|
32108
|
+
if (!node.parent) {
|
|
32109
|
+
return false;
|
|
32110
|
+
}
|
|
32042
32111
|
|
|
32043
|
-
if (typeof index !== "number" || index === 0) {
|
|
32112
|
+
if (typeof node.index !== "number" || node.index === 0) {
|
|
32044
32113
|
return false;
|
|
32045
32114
|
}
|
|
32046
32115
|
|
|
32047
|
-
var prevNode =
|
|
32116
|
+
var prevNode = node.parent.children[node.index - 1];
|
|
32048
32117
|
return isPrettierIgnore$1(prevNode);
|
|
32049
32118
|
}
|
|
32050
32119
|
|
|
@@ -32091,6 +32160,10 @@ function isLeadingSpaceSensitiveNode(node) {
|
|
|
32091
32160
|
return false;
|
|
32092
32161
|
}
|
|
32093
32162
|
|
|
32163
|
+
if ((node.type === "text" || node.type === "interpolation") && node.prev && (node.prev.type === "text" || node.prev.type === "interpolation")) {
|
|
32164
|
+
return true;
|
|
32165
|
+
}
|
|
32166
|
+
|
|
32094
32167
|
if (!node.parent || node.parent.cssDisplay === "none") {
|
|
32095
32168
|
return false;
|
|
32096
32169
|
}
|
|
@@ -32119,6 +32192,10 @@ function isTrailingSpaceSensitiveNode(node) {
|
|
|
32119
32192
|
return false;
|
|
32120
32193
|
}
|
|
32121
32194
|
|
|
32195
|
+
if ((node.type === "text" || node.type === "interpolation") && node.next && (node.next.type === "text" || node.next.type === "interpolation")) {
|
|
32196
|
+
return true;
|
|
32197
|
+
}
|
|
32198
|
+
|
|
32122
32199
|
if (!node.parent || node.parent.cssDisplay === "none") {
|
|
32123
32200
|
return false;
|
|
32124
32201
|
}
|
|
@@ -32185,7 +32262,7 @@ function isCustomElementWithSurroundingLineBreak(node) {
|
|
|
32185
32262
|
}
|
|
32186
32263
|
|
|
32187
32264
|
function isCustomElement(node) {
|
|
32188
|
-
return node.type === "element" && !node.namespace && node.name.includes("-");
|
|
32265
|
+
return node.type === "element" && !node.namespace && (node.name.includes("-") || /[A-Z]/.test(node.name[0]));
|
|
32189
32266
|
}
|
|
32190
32267
|
|
|
32191
32268
|
function hasSurroundingLineBreak(node) {
|
|
@@ -32485,10 +32562,14 @@ function normalizeParts$2(parts) {
|
|
|
32485
32562
|
return newParts;
|
|
32486
32563
|
}
|
|
32487
32564
|
|
|
32488
|
-
function identity$
|
|
32565
|
+
function identity$2(x) {
|
|
32489
32566
|
return x;
|
|
32490
32567
|
}
|
|
32491
32568
|
|
|
32569
|
+
function shouldNotPrintClosingTag$1(node) {
|
|
32570
|
+
return !node.isSelfClosing && !node.endSourceSpan && (hasPrettierIgnore$3(node) || shouldPreserveContent$1(node.parent));
|
|
32571
|
+
}
|
|
32572
|
+
|
|
32492
32573
|
var utils_1$3 = {
|
|
32493
32574
|
HTML_ELEMENT_ATTRIBUTES,
|
|
32494
32575
|
HTML_TAGS,
|
|
@@ -32504,7 +32585,7 @@ var utils_1$3 = {
|
|
|
32504
32585
|
getNodeCssStyleWhiteSpace,
|
|
32505
32586
|
getPrettierIgnoreAttributeCommentData: getPrettierIgnoreAttributeCommentData$1,
|
|
32506
32587
|
hasPrettierIgnore: hasPrettierIgnore$3,
|
|
32507
|
-
identity: identity$
|
|
32588
|
+
identity: identity$2,
|
|
32508
32589
|
inferScriptParser: inferScriptParser$1,
|
|
32509
32590
|
isDanglingSpaceSensitiveNode,
|
|
32510
32591
|
isFrontMatterNode,
|
|
@@ -32518,7 +32599,9 @@ var utils_1$3 = {
|
|
|
32518
32599
|
preferHardlineAsLeadingSpaces: preferHardlineAsLeadingSpaces$1,
|
|
32519
32600
|
preferHardlineAsTrailingSpaces,
|
|
32520
32601
|
replaceDocNewlines: replaceDocNewlines$1,
|
|
32521
|
-
replaceNewlines: replaceNewlines$1
|
|
32602
|
+
replaceNewlines: replaceNewlines$1,
|
|
32603
|
+
shouldNotPrintClosingTag: shouldNotPrintClosingTag$1,
|
|
32604
|
+
shouldPreserveContent: shouldPreserveContent$1
|
|
32522
32605
|
};
|
|
32523
32606
|
|
|
32524
32607
|
var canHaveInterpolation$1 = utils_1$3.canHaveInterpolation;
|
|
@@ -33390,6 +33473,8 @@ var normalizeParts$1 = utils_1$3.normalizeParts;
|
|
|
33390
33473
|
var preferHardlineAsLeadingSpaces = utils_1$3.preferHardlineAsLeadingSpaces;
|
|
33391
33474
|
var replaceDocNewlines = utils_1$3.replaceDocNewlines;
|
|
33392
33475
|
var replaceNewlines = utils_1$3.replaceNewlines;
|
|
33476
|
+
var shouldNotPrintClosingTag = utils_1$3.shouldNotPrintClosingTag;
|
|
33477
|
+
var shouldPreserveContent = utils_1$3.shouldPreserveContent;
|
|
33393
33478
|
var insertPragma$6 = pragma$9.insertPragma;
|
|
33394
33479
|
var printVueFor = syntaxVue.printVueFor;
|
|
33395
33480
|
var printVueSlotScope = syntaxVue.printVueSlotScope;
|
|
@@ -33500,7 +33585,7 @@ function genericPrint$5(path$$1, options, print) {
|
|
|
33500
33585
|
}) : isScriptLikeTag(node) && node.parent.type === "root" && options.parser === "vue" ? childrenDoc : indent$9(childrenDoc);
|
|
33501
33586
|
}(concat$14([shouldHugContent ? ifBreak$5(softline$7, "", {
|
|
33502
33587
|
groupId: attrGroupId
|
|
33503
|
-
}) : 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, "", {
|
|
33588
|
+
}) : 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, "", {
|
|
33504
33589
|
groupId: attrGroupId
|
|
33505
33590
|
}) : 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) {
|
|
33506
33591
|
return n.parent && n.parent.type !== "root";
|
|
@@ -33618,12 +33703,17 @@ function printChildren$1(path$$1, options, print) {
|
|
|
33618
33703
|
}, "children"));
|
|
33619
33704
|
|
|
33620
33705
|
function printChild(childPath) {
|
|
33621
|
-
|
|
33622
|
-
|
|
33706
|
+
var child = childPath.getValue();
|
|
33707
|
+
|
|
33708
|
+
if (hasPrettierIgnore$2(child)) {
|
|
33709
|
+
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)));
|
|
33623
33710
|
}
|
|
33624
33711
|
|
|
33625
|
-
|
|
33626
|
-
|
|
33712
|
+
if (shouldPreserveContent(child)) {
|
|
33713
|
+
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)));
|
|
33714
|
+
}
|
|
33715
|
+
|
|
33716
|
+
return print(childPath);
|
|
33627
33717
|
}
|
|
33628
33718
|
|
|
33629
33719
|
function printBetweenLine(prevNode, nextNode) {
|
|
@@ -33681,7 +33771,7 @@ function printOpeningTag(path$$1, options, print) {
|
|
|
33681
33771
|
};
|
|
33682
33772
|
return path$$1.map(function (attrPath) {
|
|
33683
33773
|
var attr = attrPath.getValue();
|
|
33684
|
-
return hasPrettierIgnoreAttribute(attr) ? options.originalText.slice(options.locStart(attr), options.locEnd(attr)) : print(attrPath);
|
|
33774
|
+
return hasPrettierIgnoreAttribute(attr) ? concat$14(replaceNewlines(options.originalText.slice(options.locStart(attr), options.locEnd(attr)), literalline$6)) : print(attrPath);
|
|
33685
33775
|
}, "attrs");
|
|
33686
33776
|
}(node.prev && node.prev.type === "comment" && getPrettierIgnoreAttributeCommentData(node.prev.value)))])),
|
|
33687
33777
|
/**
|
|
@@ -33827,6 +33917,10 @@ function printOpeningTagEndMarker(node) {
|
|
|
33827
33917
|
function printClosingTagStartMarker(node) {
|
|
33828
33918
|
assert(!node.isSelfClosing);
|
|
33829
33919
|
|
|
33920
|
+
if (shouldNotPrintClosingTag(node)) {
|
|
33921
|
+
return "";
|
|
33922
|
+
}
|
|
33923
|
+
|
|
33830
33924
|
switch (node.type) {
|
|
33831
33925
|
case "ieConditionalComment":
|
|
33832
33926
|
return "<!";
|
|
@@ -33837,6 +33931,10 @@ function printClosingTagStartMarker(node) {
|
|
|
33837
33931
|
}
|
|
33838
33932
|
|
|
33839
33933
|
function printClosingTagEndMarker(node) {
|
|
33934
|
+
if (shouldNotPrintClosingTag(node)) {
|
|
33935
|
+
return "";
|
|
33936
|
+
}
|
|
33937
|
+
|
|
33840
33938
|
switch (node.type) {
|
|
33841
33939
|
case "comment":
|
|
33842
33940
|
return "-->";
|
|
@@ -33939,7 +34037,8 @@ function printEmbeddedAttributeValue(node, originalTextToDoc, options) {
|
|
|
33939
34037
|
// copied from https://github.com/vuejs/vue/blob/v2.5.17/src/compiler/codegen/events.js#L3-L4
|
|
33940
34038
|
var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/;
|
|
33941
34039
|
var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
|
|
33942
|
-
var value = getValue()
|
|
34040
|
+
var value = getValue() // https://github.com/vuejs/vue/blob/v2.5.17/src/compiler/helpers.js#L104
|
|
34041
|
+
.trim();
|
|
33943
34042
|
return printMaybeHug(simplePathRE.test(value) || fnExpRE.test(value) ? textToDoc(value, {
|
|
33944
34043
|
parser: "__js_expression"
|
|
33945
34044
|
}) : stripTrailingHardline$2(textToDoc(value, {
|