houdini 1.0.0-next.6 → 1.0.0-next.8
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/build/cmd-cjs/index.js +398 -399
- package/build/cmd-esm/index.js +372 -373
- package/build/codegen-cjs/index.js +372 -372
- package/build/codegen-esm/index.js +360 -360
- package/build/lib/config.d.ts +2 -1
- package/build/lib/path.d.ts +1 -1
- package/build/lib-cjs/index.js +393 -390
- package/build/lib-esm/index.js +368 -365
- package/build/runtime/cache/cache.d.ts +6 -6
- package/build/runtime/cache/storage.d.ts +5 -5
- package/build/runtime/cache/stuff.d.ts +0 -2
- package/build/runtime/client/documentStore.d.ts +5 -4
- package/build/runtime/client/index.d.ts +12 -10
- package/build/runtime/client/plugins/injectedPlugins.d.ts +2 -1
- package/build/runtime/client/utils/documentPlugins.d.ts +2 -2
- package/build/runtime/lib/flatten.d.ts +2 -0
- package/build/runtime/lib/types.d.ts +1 -0
- package/build/runtime/public/record.d.ts +1 -2
- package/build/runtime-cjs/cache/cache.d.ts +6 -6
- package/build/runtime-cjs/cache/cache.js +6 -5
- package/build/runtime-cjs/cache/lists.js +3 -3
- package/build/runtime-cjs/cache/storage.d.ts +5 -5
- package/build/runtime-cjs/cache/storage.js +2 -2
- package/build/runtime-cjs/cache/stuff.d.ts +0 -2
- package/build/runtime-cjs/cache/stuff.js +2 -19
- package/build/runtime-cjs/cache/subscription.js +5 -4
- package/build/runtime-cjs/client/documentStore.d.ts +5 -4
- package/build/runtime-cjs/client/documentStore.js +3 -3
- package/build/runtime-cjs/client/index.d.ts +12 -10
- package/build/runtime-cjs/client/index.js +37 -11
- package/build/runtime-cjs/client/plugins/injectedPlugins.d.ts +2 -1
- package/build/runtime-cjs/client/utils/documentPlugins.d.ts +2 -2
- package/build/runtime-cjs/lib/flatten.d.ts +2 -0
- package/build/runtime-cjs/lib/flatten.js +41 -0
- package/build/runtime-cjs/lib/types.d.ts +1 -0
- package/build/runtime-cjs/public/cache.js +2 -2
- package/build/runtime-cjs/public/record.d.ts +1 -2
- package/build/runtime-cjs/public/record.js +1 -2
- package/build/runtime-esm/cache/cache.d.ts +6 -6
- package/build/runtime-esm/cache/cache.js +7 -6
- package/build/runtime-esm/cache/lists.js +3 -3
- package/build/runtime-esm/cache/storage.d.ts +5 -5
- package/build/runtime-esm/cache/storage.js +2 -2
- package/build/runtime-esm/cache/stuff.d.ts +0 -2
- package/build/runtime-esm/cache/stuff.js +1 -17
- package/build/runtime-esm/cache/subscription.js +6 -5
- package/build/runtime-esm/client/documentStore.d.ts +5 -4
- package/build/runtime-esm/client/documentStore.js +3 -3
- package/build/runtime-esm/client/index.d.ts +12 -10
- package/build/runtime-esm/client/index.js +36 -11
- package/build/runtime-esm/client/plugins/injectedPlugins.d.ts +2 -1
- package/build/runtime-esm/client/utils/documentPlugins.d.ts +2 -2
- package/build/runtime-esm/lib/flatten.d.ts +2 -0
- package/build/runtime-esm/lib/flatten.js +17 -0
- package/build/runtime-esm/lib/types.d.ts +1 -0
- package/build/runtime-esm/public/cache.js +2 -2
- package/build/runtime-esm/public/record.d.ts +1 -2
- package/build/runtime-esm/public/record.js +1 -2
- package/build/test-cjs/index.js +372 -372
- package/build/test-esm/index.js +360 -360
- package/build/vite-cjs/index.js +395 -391
- package/build/vite-esm/index.js +370 -366
- package/package.json +4 -4
package/build/vite-cjs/index.js
CHANGED
|
@@ -7214,10 +7214,10 @@ var require_printer = __commonJS({
|
|
|
7214
7214
|
Object.defineProperty(exports, "__esModule", {
|
|
7215
7215
|
value: true
|
|
7216
7216
|
});
|
|
7217
|
-
exports.print =
|
|
7217
|
+
exports.print = print11;
|
|
7218
7218
|
var _visitor = require_visitor();
|
|
7219
7219
|
var _blockString = require_blockString();
|
|
7220
|
-
function
|
|
7220
|
+
function print11(ast) {
|
|
7221
7221
|
return (0, _visitor.visit)(ast, {
|
|
7222
7222
|
leave: printDocASTReducer2
|
|
7223
7223
|
});
|
|
@@ -58556,12 +58556,12 @@ var require_comments = __commonJS({
|
|
|
58556
58556
|
comment.trailing = true;
|
|
58557
58557
|
addCommentHelper(node, comment);
|
|
58558
58558
|
}
|
|
58559
|
-
function printLeadingComment(commentPath,
|
|
58559
|
+
function printLeadingComment(commentPath, print11) {
|
|
58560
58560
|
var comment = commentPath.getValue();
|
|
58561
58561
|
n.Comment.assert(comment);
|
|
58562
58562
|
var loc = comment.loc;
|
|
58563
58563
|
var lines = loc && loc.lines;
|
|
58564
|
-
var parts = [
|
|
58564
|
+
var parts = [print11(commentPath)];
|
|
58565
58565
|
if (comment.trailing) {
|
|
58566
58566
|
parts.push("\n");
|
|
58567
58567
|
} else if (lines instanceof lines_1.Lines) {
|
|
@@ -58576,7 +58576,7 @@ var require_comments = __commonJS({
|
|
|
58576
58576
|
}
|
|
58577
58577
|
return (0, lines_1.concat)(parts);
|
|
58578
58578
|
}
|
|
58579
|
-
function printTrailingComment(commentPath,
|
|
58579
|
+
function printTrailingComment(commentPath, print11) {
|
|
58580
58580
|
var comment = commentPath.getValue(commentPath);
|
|
58581
58581
|
n.Comment.assert(comment);
|
|
58582
58582
|
var loc = comment.loc;
|
|
@@ -58591,12 +58591,12 @@ var require_comments = __commonJS({
|
|
|
58591
58591
|
parts.push(new Array(leadingSpace.length).join("\n"));
|
|
58592
58592
|
}
|
|
58593
58593
|
}
|
|
58594
|
-
parts.push(
|
|
58594
|
+
parts.push(print11(commentPath));
|
|
58595
58595
|
return (0, lines_1.concat)(parts);
|
|
58596
58596
|
}
|
|
58597
|
-
function printComments(path2,
|
|
58597
|
+
function printComments(path2, print11) {
|
|
58598
58598
|
var value = path2.getValue();
|
|
58599
|
-
var innerLines =
|
|
58599
|
+
var innerLines = print11(path2);
|
|
58600
58600
|
var comments = n.Node.check(value) && types17.getFieldValue(value, "comments");
|
|
58601
58601
|
if (!comments || comments.length === 0) {
|
|
58602
58602
|
return innerLines;
|
|
@@ -58608,9 +58608,9 @@ var require_comments = __commonJS({
|
|
|
58608
58608
|
var leading = types17.getFieldValue(comment, "leading");
|
|
58609
58609
|
var trailing = types17.getFieldValue(comment, "trailing");
|
|
58610
58610
|
if (leading || trailing && !(n.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
58611
|
-
leadingParts.push(printLeadingComment(commentPath,
|
|
58611
|
+
leadingParts.push(printLeadingComment(commentPath, print11));
|
|
58612
58612
|
} else if (trailing) {
|
|
58613
|
-
trailingParts.push(printTrailingComment(commentPath,
|
|
58613
|
+
trailingParts.push(printTrailingComment(commentPath, print11));
|
|
58614
58614
|
}
|
|
58615
58615
|
}, "comments");
|
|
58616
58616
|
leadingParts.push.apply(leadingParts, trailingParts);
|
|
@@ -59301,7 +59301,7 @@ var require_patcher = __commonJS({
|
|
|
59301
59301
|
};
|
|
59302
59302
|
exports.Patcher = Patcher;
|
|
59303
59303
|
var Pp = Patcher.prototype;
|
|
59304
|
-
Pp.tryToReprintComments = function(newNode, oldNode,
|
|
59304
|
+
Pp.tryToReprintComments = function(newNode, oldNode, print11) {
|
|
59305
59305
|
var patcher = this;
|
|
59306
59306
|
if (!newNode.comments && !oldNode.comments) {
|
|
59307
59307
|
return true;
|
|
@@ -59318,7 +59318,7 @@ var require_patcher = __commonJS({
|
|
|
59318
59318
|
assert_1.default.ok(oldComment.leading || oldComment.trailing);
|
|
59319
59319
|
patcher.replace(
|
|
59320
59320
|
oldComment.loc,
|
|
59321
|
-
|
|
59321
|
+
print11(reprint.newPath).indentTail(oldComment.loc.indent)
|
|
59322
59322
|
);
|
|
59323
59323
|
});
|
|
59324
59324
|
}
|
|
@@ -59365,17 +59365,17 @@ var require_patcher = __commonJS({
|
|
|
59365
59365
|
var reprints = [];
|
|
59366
59366
|
if (!lines || !findReprints(path2, reprints))
|
|
59367
59367
|
return;
|
|
59368
|
-
return function(
|
|
59368
|
+
return function(print11) {
|
|
59369
59369
|
var patcher = new Patcher(lines);
|
|
59370
59370
|
reprints.forEach(function(reprint) {
|
|
59371
59371
|
var newNode = reprint.newPath.getValue();
|
|
59372
59372
|
var oldNode = reprint.oldPath.getValue();
|
|
59373
59373
|
SourceLocation.assert(oldNode.loc, true);
|
|
59374
|
-
var needToPrintNewPathWithComments = !patcher.tryToReprintComments(newNode, oldNode,
|
|
59374
|
+
var needToPrintNewPathWithComments = !patcher.tryToReprintComments(newNode, oldNode, print11);
|
|
59375
59375
|
if (needToPrintNewPathWithComments) {
|
|
59376
59376
|
patcher.deleteComments(oldNode);
|
|
59377
59377
|
}
|
|
59378
|
-
var newLines =
|
|
59378
|
+
var newLines = print11(reprint.newPath, {
|
|
59379
59379
|
includeComments: needToPrintNewPathWithComments,
|
|
59380
59380
|
avoidRootParens: oldNode.type === newNode.type && reprint.oldPath.hasParens()
|
|
59381
59381
|
}).indentTail(oldNode.loc.indent);
|
|
@@ -59592,10 +59592,10 @@ var require_printer2 = __commonJS({
|
|
|
59592
59592
|
function makePrintFunctionWith(options, overrides) {
|
|
59593
59593
|
options = Object.assign({}, options, overrides);
|
|
59594
59594
|
return function(path2) {
|
|
59595
|
-
return
|
|
59595
|
+
return print11(path2, options);
|
|
59596
59596
|
};
|
|
59597
59597
|
}
|
|
59598
|
-
function
|
|
59598
|
+
function print11(path2, options) {
|
|
59599
59599
|
assert_1.default.ok(path2 instanceof fast_path_1.default);
|
|
59600
59600
|
options = options || {};
|
|
59601
59601
|
if (options.includeComments) {
|
|
@@ -59611,7 +59611,7 @@ var require_printer2 = __commonJS({
|
|
|
59611
59611
|
}
|
|
59612
59612
|
}
|
|
59613
59613
|
var reprinter = (0, patcher_1.getReprinter)(path2);
|
|
59614
|
-
var lines = reprinter ? reprinter(
|
|
59614
|
+
var lines = reprinter ? reprinter(print11) : genericPrint(path2, config4, options, makePrintFunctionWith(options, {
|
|
59615
59615
|
includeComments: true,
|
|
59616
59616
|
avoidRootParens: false
|
|
59617
59617
|
}));
|
|
@@ -59622,7 +59622,7 @@ var require_printer2 = __commonJS({
|
|
|
59622
59622
|
if (!ast) {
|
|
59623
59623
|
return emptyPrintResult;
|
|
59624
59624
|
}
|
|
59625
|
-
var lines =
|
|
59625
|
+
var lines = print11(fast_path_1.default.from(ast), {
|
|
59626
59626
|
includeComments: true,
|
|
59627
59627
|
avoidRootParens: false
|
|
59628
59628
|
});
|
|
@@ -59675,7 +59675,7 @@ var require_printer2 = __commonJS({
|
|
|
59675
59675
|
}
|
|
59676
59676
|
return (0, lines_1.concat)(parts);
|
|
59677
59677
|
}
|
|
59678
|
-
function genericPrintNoParens(path2, options,
|
|
59678
|
+
function genericPrintNoParens(path2, options, print11) {
|
|
59679
59679
|
var n = path2.getValue();
|
|
59680
59680
|
if (!n) {
|
|
59681
59681
|
return (0, lines_1.fromString)("");
|
|
@@ -59687,45 +59687,45 @@ var require_printer2 = __commonJS({
|
|
|
59687
59687
|
var parts = [];
|
|
59688
59688
|
switch (n.type) {
|
|
59689
59689
|
case "File":
|
|
59690
|
-
return path2.call(
|
|
59690
|
+
return path2.call(print11, "program");
|
|
59691
59691
|
case "Program":
|
|
59692
59692
|
if (n.directives) {
|
|
59693
59693
|
path2.each(function(childPath) {
|
|
59694
|
-
parts.push(
|
|
59694
|
+
parts.push(print11(childPath), ";\n");
|
|
59695
59695
|
}, "directives");
|
|
59696
59696
|
}
|
|
59697
59697
|
if (n.interpreter) {
|
|
59698
|
-
parts.push(path2.call(
|
|
59698
|
+
parts.push(path2.call(print11, "interpreter"));
|
|
59699
59699
|
}
|
|
59700
59700
|
parts.push(path2.call(function(bodyPath) {
|
|
59701
|
-
return printStatementSequence(bodyPath, options,
|
|
59701
|
+
return printStatementSequence(bodyPath, options, print11);
|
|
59702
59702
|
}, "body"));
|
|
59703
59703
|
return (0, lines_1.concat)(parts);
|
|
59704
59704
|
case "Noop":
|
|
59705
59705
|
case "EmptyStatement":
|
|
59706
59706
|
return (0, lines_1.fromString)("");
|
|
59707
59707
|
case "ExpressionStatement":
|
|
59708
|
-
return (0, lines_1.concat)([path2.call(
|
|
59708
|
+
return (0, lines_1.concat)([path2.call(print11, "expression"), ";"]);
|
|
59709
59709
|
case "ParenthesizedExpression":
|
|
59710
|
-
return (0, lines_1.concat)(["(", path2.call(
|
|
59710
|
+
return (0, lines_1.concat)(["(", path2.call(print11, "expression"), ")"]);
|
|
59711
59711
|
case "BinaryExpression":
|
|
59712
59712
|
case "LogicalExpression":
|
|
59713
59713
|
case "AssignmentExpression":
|
|
59714
59714
|
return (0, lines_1.fromString)(" ").join([
|
|
59715
|
-
path2.call(
|
|
59715
|
+
path2.call(print11, "left"),
|
|
59716
59716
|
n.operator,
|
|
59717
|
-
path2.call(
|
|
59717
|
+
path2.call(print11, "right")
|
|
59718
59718
|
]);
|
|
59719
59719
|
case "AssignmentPattern":
|
|
59720
59720
|
return (0, lines_1.concat)([
|
|
59721
|
-
path2.call(
|
|
59721
|
+
path2.call(print11, "left"),
|
|
59722
59722
|
" = ",
|
|
59723
|
-
path2.call(
|
|
59723
|
+
path2.call(print11, "right")
|
|
59724
59724
|
]);
|
|
59725
59725
|
case "MemberExpression":
|
|
59726
59726
|
case "OptionalMemberExpression": {
|
|
59727
|
-
parts.push(path2.call(
|
|
59728
|
-
var property = path2.call(
|
|
59727
|
+
parts.push(path2.call(print11, "object"));
|
|
59728
|
+
var property = path2.call(print11, "property");
|
|
59729
59729
|
var optional = types17.getFieldValue(n, "optional");
|
|
59730
59730
|
if (n.computed) {
|
|
59731
59731
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
@@ -59735,18 +59735,18 @@ var require_printer2 = __commonJS({
|
|
|
59735
59735
|
return (0, lines_1.concat)(parts);
|
|
59736
59736
|
}
|
|
59737
59737
|
case "ChainExpression":
|
|
59738
|
-
return path2.call(
|
|
59738
|
+
return path2.call(print11, "expression");
|
|
59739
59739
|
case "MetaProperty":
|
|
59740
59740
|
return (0, lines_1.concat)([
|
|
59741
|
-
path2.call(
|
|
59741
|
+
path2.call(print11, "meta"),
|
|
59742
59742
|
".",
|
|
59743
|
-
path2.call(
|
|
59743
|
+
path2.call(print11, "property")
|
|
59744
59744
|
]);
|
|
59745
59745
|
case "BindExpression":
|
|
59746
59746
|
if (n.object) {
|
|
59747
|
-
parts.push(path2.call(
|
|
59747
|
+
parts.push(path2.call(print11, "object"));
|
|
59748
59748
|
}
|
|
59749
|
-
parts.push("::", path2.call(
|
|
59749
|
+
parts.push("::", path2.call(print11, "callee"));
|
|
59750
59750
|
return (0, lines_1.concat)(parts);
|
|
59751
59751
|
case "Path":
|
|
59752
59752
|
return (0, lines_1.fromString)(".").join(n.body);
|
|
@@ -59754,7 +59754,7 @@ var require_printer2 = __commonJS({
|
|
|
59754
59754
|
return (0, lines_1.concat)([
|
|
59755
59755
|
(0, lines_1.fromString)(n.name, options),
|
|
59756
59756
|
n.optional ? "?" : "",
|
|
59757
|
-
path2.call(
|
|
59757
|
+
path2.call(print11, "typeAnnotation")
|
|
59758
59758
|
]);
|
|
59759
59759
|
case "SpreadElement":
|
|
59760
59760
|
case "SpreadElementPattern":
|
|
@@ -59765,8 +59765,8 @@ var require_printer2 = __commonJS({
|
|
|
59765
59765
|
case "RestElement":
|
|
59766
59766
|
return (0, lines_1.concat)([
|
|
59767
59767
|
"...",
|
|
59768
|
-
path2.call(
|
|
59769
|
-
path2.call(
|
|
59768
|
+
path2.call(print11, "argument"),
|
|
59769
|
+
path2.call(print11, "typeAnnotation")
|
|
59770
59770
|
]);
|
|
59771
59771
|
case "FunctionDeclaration":
|
|
59772
59772
|
case "FunctionExpression":
|
|
@@ -59781,15 +59781,15 @@ var require_printer2 = __commonJS({
|
|
|
59781
59781
|
if (n.generator)
|
|
59782
59782
|
parts.push("*");
|
|
59783
59783
|
if (n.id) {
|
|
59784
|
-
parts.push(" ", path2.call(
|
|
59784
|
+
parts.push(" ", path2.call(print11, "id"), path2.call(print11, "typeParameters"));
|
|
59785
59785
|
} else {
|
|
59786
59786
|
if (n.typeParameters) {
|
|
59787
|
-
parts.push(path2.call(
|
|
59787
|
+
parts.push(path2.call(print11, "typeParameters"));
|
|
59788
59788
|
}
|
|
59789
59789
|
}
|
|
59790
|
-
parts.push("(", printFunctionParams(path2, options,
|
|
59790
|
+
parts.push("(", printFunctionParams(path2, options, print11), ")", path2.call(print11, "returnType"));
|
|
59791
59791
|
if (n.body) {
|
|
59792
|
-
parts.push(" ", path2.call(
|
|
59792
|
+
parts.push(" ", path2.call(print11, "body"));
|
|
59793
59793
|
}
|
|
59794
59794
|
return (0, lines_1.concat)(parts);
|
|
59795
59795
|
case "ArrowFunctionExpression":
|
|
@@ -59797,44 +59797,44 @@ var require_printer2 = __commonJS({
|
|
|
59797
59797
|
parts.push("async ");
|
|
59798
59798
|
}
|
|
59799
59799
|
if (n.typeParameters) {
|
|
59800
|
-
parts.push(path2.call(
|
|
59800
|
+
parts.push(path2.call(print11, "typeParameters"));
|
|
59801
59801
|
}
|
|
59802
59802
|
if (!options.arrowParensAlways && n.params.length === 1 && !n.rest && n.params[0].type === "Identifier" && !n.params[0].typeAnnotation && !n.returnType) {
|
|
59803
|
-
parts.push(path2.call(
|
|
59803
|
+
parts.push(path2.call(print11, "params", 0));
|
|
59804
59804
|
} else {
|
|
59805
|
-
parts.push("(", printFunctionParams(path2, options,
|
|
59805
|
+
parts.push("(", printFunctionParams(path2, options, print11), ")", path2.call(print11, "returnType"));
|
|
59806
59806
|
}
|
|
59807
|
-
parts.push(" => ", path2.call(
|
|
59807
|
+
parts.push(" => ", path2.call(print11, "body"));
|
|
59808
59808
|
return (0, lines_1.concat)(parts);
|
|
59809
59809
|
case "MethodDefinition":
|
|
59810
|
-
return printMethod(path2, options,
|
|
59810
|
+
return printMethod(path2, options, print11);
|
|
59811
59811
|
case "YieldExpression":
|
|
59812
59812
|
parts.push("yield");
|
|
59813
59813
|
if (n.delegate)
|
|
59814
59814
|
parts.push("*");
|
|
59815
59815
|
if (n.argument)
|
|
59816
|
-
parts.push(" ", path2.call(
|
|
59816
|
+
parts.push(" ", path2.call(print11, "argument"));
|
|
59817
59817
|
return (0, lines_1.concat)(parts);
|
|
59818
59818
|
case "AwaitExpression":
|
|
59819
59819
|
parts.push("await");
|
|
59820
59820
|
if (n.all)
|
|
59821
59821
|
parts.push("*");
|
|
59822
59822
|
if (n.argument)
|
|
59823
|
-
parts.push(" ", path2.call(
|
|
59823
|
+
parts.push(" ", path2.call(print11, "argument"));
|
|
59824
59824
|
return (0, lines_1.concat)(parts);
|
|
59825
59825
|
case "ModuleExpression":
|
|
59826
59826
|
return (0, lines_1.concat)([
|
|
59827
59827
|
"module {\n",
|
|
59828
|
-
path2.call(
|
|
59828
|
+
path2.call(print11, "body").indent(options.tabWidth),
|
|
59829
59829
|
"\n}"
|
|
59830
59830
|
]);
|
|
59831
59831
|
case "ModuleDeclaration":
|
|
59832
|
-
parts.push("module", path2.call(
|
|
59832
|
+
parts.push("module", path2.call(print11, "id"));
|
|
59833
59833
|
if (n.source) {
|
|
59834
59834
|
assert_1.default.ok(!n.body);
|
|
59835
|
-
parts.push("from", path2.call(
|
|
59835
|
+
parts.push("from", path2.call(print11, "source"));
|
|
59836
59836
|
} else {
|
|
59837
|
-
parts.push(path2.call(
|
|
59837
|
+
parts.push(path2.call(print11, "body"));
|
|
59838
59838
|
}
|
|
59839
59839
|
return (0, lines_1.fromString)(" ").join(parts);
|
|
59840
59840
|
case "ImportSpecifier":
|
|
@@ -59842,27 +59842,27 @@ var require_printer2 = __commonJS({
|
|
|
59842
59842
|
parts.push(n.importKind + " ");
|
|
59843
59843
|
}
|
|
59844
59844
|
if (n.imported) {
|
|
59845
|
-
parts.push(path2.call(
|
|
59845
|
+
parts.push(path2.call(print11, "imported"));
|
|
59846
59846
|
if (n.local && n.local.name !== n.imported.name) {
|
|
59847
|
-
parts.push(" as ", path2.call(
|
|
59847
|
+
parts.push(" as ", path2.call(print11, "local"));
|
|
59848
59848
|
}
|
|
59849
59849
|
} else if (n.id) {
|
|
59850
|
-
parts.push(path2.call(
|
|
59850
|
+
parts.push(path2.call(print11, "id"));
|
|
59851
59851
|
if (n.name) {
|
|
59852
|
-
parts.push(" as ", path2.call(
|
|
59852
|
+
parts.push(" as ", path2.call(print11, "name"));
|
|
59853
59853
|
}
|
|
59854
59854
|
}
|
|
59855
59855
|
return (0, lines_1.concat)(parts);
|
|
59856
59856
|
case "ExportSpecifier":
|
|
59857
59857
|
if (n.local) {
|
|
59858
|
-
parts.push(path2.call(
|
|
59858
|
+
parts.push(path2.call(print11, "local"));
|
|
59859
59859
|
if (n.exported && n.exported.name !== n.local.name) {
|
|
59860
|
-
parts.push(" as ", path2.call(
|
|
59860
|
+
parts.push(" as ", path2.call(print11, "exported"));
|
|
59861
59861
|
}
|
|
59862
59862
|
} else if (n.id) {
|
|
59863
|
-
parts.push(path2.call(
|
|
59863
|
+
parts.push(path2.call(print11, "id"));
|
|
59864
59864
|
if (n.name) {
|
|
59865
|
-
parts.push(" as ", path2.call(
|
|
59865
|
+
parts.push(" as ", path2.call(print11, "name"));
|
|
59866
59866
|
}
|
|
59867
59867
|
}
|
|
59868
59868
|
return (0, lines_1.concat)(parts);
|
|
@@ -59871,40 +59871,40 @@ var require_printer2 = __commonJS({
|
|
|
59871
59871
|
case "ImportNamespaceSpecifier":
|
|
59872
59872
|
parts.push("* as ");
|
|
59873
59873
|
if (n.local) {
|
|
59874
|
-
parts.push(path2.call(
|
|
59874
|
+
parts.push(path2.call(print11, "local"));
|
|
59875
59875
|
} else if (n.id) {
|
|
59876
|
-
parts.push(path2.call(
|
|
59876
|
+
parts.push(path2.call(print11, "id"));
|
|
59877
59877
|
}
|
|
59878
59878
|
return (0, lines_1.concat)(parts);
|
|
59879
59879
|
case "ImportDefaultSpecifier":
|
|
59880
59880
|
if (n.local) {
|
|
59881
|
-
return path2.call(
|
|
59881
|
+
return path2.call(print11, "local");
|
|
59882
59882
|
}
|
|
59883
|
-
return path2.call(
|
|
59883
|
+
return path2.call(print11, "id");
|
|
59884
59884
|
case "TSExportAssignment":
|
|
59885
|
-
return (0, lines_1.concat)(["export = ", path2.call(
|
|
59885
|
+
return (0, lines_1.concat)(["export = ", path2.call(print11, "expression")]);
|
|
59886
59886
|
case "ExportDeclaration":
|
|
59887
59887
|
case "ExportDefaultDeclaration":
|
|
59888
59888
|
case "ExportNamedDeclaration":
|
|
59889
|
-
return printExportDeclaration(path2, options,
|
|
59889
|
+
return printExportDeclaration(path2, options, print11);
|
|
59890
59890
|
case "ExportAllDeclaration":
|
|
59891
59891
|
parts.push("export *");
|
|
59892
59892
|
if (n.exported) {
|
|
59893
|
-
parts.push(" as ", path2.call(
|
|
59893
|
+
parts.push(" as ", path2.call(print11, "exported"));
|
|
59894
59894
|
}
|
|
59895
|
-
parts.push(" from ", path2.call(
|
|
59895
|
+
parts.push(" from ", path2.call(print11, "source"), ";");
|
|
59896
59896
|
return (0, lines_1.concat)(parts);
|
|
59897
59897
|
case "TSNamespaceExportDeclaration":
|
|
59898
|
-
parts.push("export as namespace ", path2.call(
|
|
59898
|
+
parts.push("export as namespace ", path2.call(print11, "id"));
|
|
59899
59899
|
return maybeAddSemicolon((0, lines_1.concat)(parts));
|
|
59900
59900
|
case "ExportNamespaceSpecifier":
|
|
59901
|
-
return (0, lines_1.concat)(["* as ", path2.call(
|
|
59901
|
+
return (0, lines_1.concat)(["* as ", path2.call(print11, "exported")]);
|
|
59902
59902
|
case "ExportDefaultSpecifier":
|
|
59903
|
-
return path2.call(
|
|
59903
|
+
return path2.call(print11, "exported");
|
|
59904
59904
|
case "Import":
|
|
59905
59905
|
return (0, lines_1.fromString)("import", options);
|
|
59906
59906
|
case "ImportExpression":
|
|
59907
|
-
return (0, lines_1.concat)(["import(", path2.call(
|
|
59907
|
+
return (0, lines_1.concat)(["import(", path2.call(print11, "source"), ")"]);
|
|
59908
59908
|
case "ImportDeclaration": {
|
|
59909
59909
|
parts.push("import ");
|
|
59910
59910
|
if (n.importKind && n.importKind !== "value") {
|
|
@@ -59916,9 +59916,9 @@ var require_printer2 = __commonJS({
|
|
|
59916
59916
|
path2.each(function(specifierPath) {
|
|
59917
59917
|
var spec = specifierPath.getValue();
|
|
59918
59918
|
if (spec.type === "ImportSpecifier") {
|
|
59919
|
-
bracedSpecifiers_1.push(
|
|
59919
|
+
bracedSpecifiers_1.push(print11(specifierPath));
|
|
59920
59920
|
} else if (spec.type === "ImportDefaultSpecifier" || spec.type === "ImportNamespaceSpecifier") {
|
|
59921
|
-
unbracedSpecifiers_1.push(
|
|
59921
|
+
unbracedSpecifiers_1.push(print11(specifierPath));
|
|
59922
59922
|
}
|
|
59923
59923
|
}, "specifiers");
|
|
59924
59924
|
unbracedSpecifiers_1.forEach(function(lines2, i2) {
|
|
@@ -59948,16 +59948,16 @@ var require_printer2 = __commonJS({
|
|
|
59948
59948
|
}
|
|
59949
59949
|
parts.push(" from ");
|
|
59950
59950
|
}
|
|
59951
|
-
parts.push(path2.call(
|
|
59951
|
+
parts.push(path2.call(print11, "source"), maybePrintImportAssertions(path2, options, print11), ";");
|
|
59952
59952
|
return (0, lines_1.concat)(parts);
|
|
59953
59953
|
}
|
|
59954
59954
|
case "ImportAttribute":
|
|
59955
|
-
return (0, lines_1.concat)([path2.call(
|
|
59955
|
+
return (0, lines_1.concat)([path2.call(print11, "key"), ": ", path2.call(print11, "value")]);
|
|
59956
59956
|
case "StaticBlock":
|
|
59957
59957
|
parts.push("static ");
|
|
59958
59958
|
case "BlockStatement": {
|
|
59959
59959
|
var naked_1 = path2.call(function(bodyPath) {
|
|
59960
|
-
return printStatementSequence(bodyPath, options,
|
|
59960
|
+
return printStatementSequence(bodyPath, options, print11);
|
|
59961
59961
|
}, "body");
|
|
59962
59962
|
if (naked_1.isEmpty()) {
|
|
59963
59963
|
if (!n.directives || n.directives.length === 0) {
|
|
@@ -59968,7 +59968,7 @@ var require_printer2 = __commonJS({
|
|
|
59968
59968
|
parts.push("{\n");
|
|
59969
59969
|
if (n.directives) {
|
|
59970
59970
|
path2.each(function(childPath) {
|
|
59971
|
-
parts.push(maybeAddSemicolon(
|
|
59971
|
+
parts.push(maybeAddSemicolon(print11(childPath).indent(options.tabWidth)), n.directives.length > 1 || !naked_1.isEmpty() ? "\n" : "");
|
|
59972
59972
|
}, "directives");
|
|
59973
59973
|
}
|
|
59974
59974
|
parts.push(naked_1.indent(options.tabWidth));
|
|
@@ -59978,7 +59978,7 @@ var require_printer2 = __commonJS({
|
|
|
59978
59978
|
case "ReturnStatement": {
|
|
59979
59979
|
parts.push("return");
|
|
59980
59980
|
if (n.argument) {
|
|
59981
|
-
var argLines = path2.call(
|
|
59981
|
+
var argLines = path2.call(print11, "argument");
|
|
59982
59982
|
if (argLines.startsWithComment() || argLines.length > 1 && namedTypes.JSXElement && namedTypes.JSXElement.check(n.argument)) {
|
|
59983
59983
|
parts.push(" (\n", argLines.indent(options.tabWidth), "\n)");
|
|
59984
59984
|
} else {
|
|
@@ -59990,17 +59990,17 @@ var require_printer2 = __commonJS({
|
|
|
59990
59990
|
}
|
|
59991
59991
|
case "CallExpression":
|
|
59992
59992
|
case "OptionalCallExpression":
|
|
59993
|
-
parts.push(path2.call(
|
|
59993
|
+
parts.push(path2.call(print11, "callee"));
|
|
59994
59994
|
if (n.typeParameters) {
|
|
59995
|
-
parts.push(path2.call(
|
|
59995
|
+
parts.push(path2.call(print11, "typeParameters"));
|
|
59996
59996
|
}
|
|
59997
59997
|
if (n.typeArguments) {
|
|
59998
|
-
parts.push(path2.call(
|
|
59998
|
+
parts.push(path2.call(print11, "typeArguments"));
|
|
59999
59999
|
}
|
|
60000
60000
|
if (types17.getFieldValue(n, "optional")) {
|
|
60001
60001
|
parts.push("?.");
|
|
60002
60002
|
}
|
|
60003
|
-
parts.push(printArgumentsList(path2, options,
|
|
60003
|
+
parts.push(printArgumentsList(path2, options, print11));
|
|
60004
60004
|
return (0, lines_1.concat)(parts);
|
|
60005
60005
|
case "RecordExpression":
|
|
60006
60006
|
parts.push("#");
|
|
@@ -60030,7 +60030,7 @@ var require_printer2 = __commonJS({
|
|
|
60030
60030
|
var i_1 = 0;
|
|
60031
60031
|
fields.forEach(function(field) {
|
|
60032
60032
|
path2.each(function(childPath) {
|
|
60033
|
-
var lines2 =
|
|
60033
|
+
var lines2 = print11(childPath);
|
|
60034
60034
|
if (!oneLine_1) {
|
|
60035
60035
|
lines2 = lines2.indent(options.tabWidth);
|
|
60036
60036
|
}
|
|
@@ -60067,32 +60067,32 @@ var require_printer2 = __commonJS({
|
|
|
60067
60067
|
parts[parts.length - 1] = " " + rightBrace;
|
|
60068
60068
|
}
|
|
60069
60069
|
if (n.typeAnnotation) {
|
|
60070
|
-
parts.push(path2.call(
|
|
60070
|
+
parts.push(path2.call(print11, "typeAnnotation"));
|
|
60071
60071
|
}
|
|
60072
60072
|
return (0, lines_1.concat)(parts);
|
|
60073
60073
|
}
|
|
60074
60074
|
case "PropertyPattern":
|
|
60075
60075
|
return (0, lines_1.concat)([
|
|
60076
|
-
path2.call(
|
|
60076
|
+
path2.call(print11, "key"),
|
|
60077
60077
|
": ",
|
|
60078
|
-
path2.call(
|
|
60078
|
+
path2.call(print11, "pattern")
|
|
60079
60079
|
]);
|
|
60080
60080
|
case "ObjectProperty":
|
|
60081
60081
|
case "Property": {
|
|
60082
60082
|
if (n.method || n.kind === "get" || n.kind === "set") {
|
|
60083
|
-
return printMethod(path2, options,
|
|
60083
|
+
return printMethod(path2, options, print11);
|
|
60084
60084
|
}
|
|
60085
60085
|
if (n.shorthand && n.value.type === "AssignmentPattern") {
|
|
60086
|
-
return path2.call(
|
|
60086
|
+
return path2.call(print11, "value");
|
|
60087
60087
|
}
|
|
60088
|
-
var key = path2.call(
|
|
60088
|
+
var key = path2.call(print11, "key");
|
|
60089
60089
|
if (n.computed) {
|
|
60090
60090
|
parts.push("[", key, "]");
|
|
60091
60091
|
} else {
|
|
60092
60092
|
parts.push(key);
|
|
60093
60093
|
}
|
|
60094
60094
|
if (!n.shorthand || n.key.name !== n.value.name) {
|
|
60095
|
-
parts.push(": ", path2.call(
|
|
60095
|
+
parts.push(": ", path2.call(print11, "value"));
|
|
60096
60096
|
}
|
|
60097
60097
|
return (0, lines_1.concat)(parts);
|
|
60098
60098
|
}
|
|
@@ -60100,18 +60100,18 @@ var require_printer2 = __commonJS({
|
|
|
60100
60100
|
case "ObjectMethod":
|
|
60101
60101
|
case "ClassPrivateMethod":
|
|
60102
60102
|
case "TSDeclareMethod":
|
|
60103
|
-
return printMethod(path2, options,
|
|
60103
|
+
return printMethod(path2, options, print11);
|
|
60104
60104
|
case "PrivateName":
|
|
60105
|
-
return (0, lines_1.concat)(["#", path2.call(
|
|
60105
|
+
return (0, lines_1.concat)(["#", path2.call(print11, "id")]);
|
|
60106
60106
|
case "Decorator":
|
|
60107
|
-
return (0, lines_1.concat)(["@", path2.call(
|
|
60107
|
+
return (0, lines_1.concat)(["@", path2.call(print11, "expression")]);
|
|
60108
60108
|
case "TupleExpression":
|
|
60109
60109
|
parts.push("#");
|
|
60110
60110
|
case "ArrayExpression":
|
|
60111
60111
|
case "ArrayPattern": {
|
|
60112
60112
|
var elems = n.elements;
|
|
60113
60113
|
var len_2 = elems.length;
|
|
60114
|
-
var printed_1 = path2.map(
|
|
60114
|
+
var printed_1 = path2.map(print11, "elements");
|
|
60115
60115
|
var joined = (0, lines_1.fromString)(", ").join(printed_1);
|
|
60116
60116
|
var oneLine_2 = joined.getLineLength(1) <= options.wrapColumn;
|
|
60117
60117
|
if (oneLine_2) {
|
|
@@ -60149,12 +60149,12 @@ var require_printer2 = __commonJS({
|
|
|
60149
60149
|
parts.push("]");
|
|
60150
60150
|
}
|
|
60151
60151
|
if (n.typeAnnotation) {
|
|
60152
|
-
parts.push(path2.call(
|
|
60152
|
+
parts.push(path2.call(print11, "typeAnnotation"));
|
|
60153
60153
|
}
|
|
60154
60154
|
return (0, lines_1.concat)(parts);
|
|
60155
60155
|
}
|
|
60156
60156
|
case "SequenceExpression":
|
|
60157
|
-
return (0, lines_1.fromString)(", ").join(path2.map(
|
|
60157
|
+
return (0, lines_1.fromString)(", ").join(path2.map(print11, "expressions"));
|
|
60158
60158
|
case "ThisExpression":
|
|
60159
60159
|
return (0, lines_1.fromString)("this");
|
|
60160
60160
|
case "Super":
|
|
@@ -60175,7 +60175,7 @@ var require_printer2 = __commonJS({
|
|
|
60175
60175
|
case "Literal":
|
|
60176
60176
|
return (0, lines_1.fromString)(getPossibleRaw(n) || (typeof n.value === "string" ? nodeStr(n.value, options) : n.value), options);
|
|
60177
60177
|
case "Directive":
|
|
60178
|
-
return path2.call(
|
|
60178
|
+
return path2.call(print11, "value");
|
|
60179
60179
|
case "DirectiveLiteral":
|
|
60180
60180
|
return (0, lines_1.fromString)(getPossibleRaw(n) || nodeStr(n.value, options), options);
|
|
60181
60181
|
case "InterpreterDirective":
|
|
@@ -60189,32 +60189,32 @@ var require_printer2 = __commonJS({
|
|
|
60189
60189
|
parts.push(n.operator);
|
|
60190
60190
|
if (/[a-z]$/.test(n.operator))
|
|
60191
60191
|
parts.push(" ");
|
|
60192
|
-
parts.push(path2.call(
|
|
60192
|
+
parts.push(path2.call(print11, "argument"));
|
|
60193
60193
|
return (0, lines_1.concat)(parts);
|
|
60194
60194
|
case "UpdateExpression":
|
|
60195
|
-
parts.push(path2.call(
|
|
60195
|
+
parts.push(path2.call(print11, "argument"), n.operator);
|
|
60196
60196
|
if (n.prefix)
|
|
60197
60197
|
parts.reverse();
|
|
60198
60198
|
return (0, lines_1.concat)(parts);
|
|
60199
60199
|
case "ConditionalExpression":
|
|
60200
60200
|
return (0, lines_1.concat)([
|
|
60201
|
-
path2.call(
|
|
60201
|
+
path2.call(print11, "test"),
|
|
60202
60202
|
" ? ",
|
|
60203
|
-
path2.call(
|
|
60203
|
+
path2.call(print11, "consequent"),
|
|
60204
60204
|
" : ",
|
|
60205
|
-
path2.call(
|
|
60205
|
+
path2.call(print11, "alternate")
|
|
60206
60206
|
]);
|
|
60207
60207
|
case "NewExpression": {
|
|
60208
|
-
parts.push("new ", path2.call(
|
|
60208
|
+
parts.push("new ", path2.call(print11, "callee"));
|
|
60209
60209
|
if (n.typeParameters) {
|
|
60210
|
-
parts.push(path2.call(
|
|
60210
|
+
parts.push(path2.call(print11, "typeParameters"));
|
|
60211
60211
|
}
|
|
60212
60212
|
if (n.typeArguments) {
|
|
60213
|
-
parts.push(path2.call(
|
|
60213
|
+
parts.push(path2.call(print11, "typeArguments"));
|
|
60214
60214
|
}
|
|
60215
60215
|
var args = n.arguments;
|
|
60216
60216
|
if (args) {
|
|
60217
|
-
parts.push(printArgumentsList(path2, options,
|
|
60217
|
+
parts.push(printArgumentsList(path2, options, print11));
|
|
60218
60218
|
}
|
|
60219
60219
|
return (0, lines_1.concat)(parts);
|
|
60220
60220
|
}
|
|
@@ -60225,7 +60225,7 @@ var require_printer2 = __commonJS({
|
|
|
60225
60225
|
parts.push(n.kind, " ");
|
|
60226
60226
|
var maxLen_1 = 0;
|
|
60227
60227
|
var printed = path2.map(function(childPath) {
|
|
60228
|
-
var lines2 =
|
|
60228
|
+
var lines2 = print11(childPath);
|
|
60229
60229
|
maxLen_1 = Math.max(lines2.length, maxLen_1);
|
|
60230
60230
|
return lines2;
|
|
60231
60231
|
}, "declarations");
|
|
@@ -60244,30 +60244,30 @@ var require_printer2 = __commonJS({
|
|
|
60244
60244
|
}
|
|
60245
60245
|
case "VariableDeclarator":
|
|
60246
60246
|
return n.init ? (0, lines_1.fromString)(" = ").join([
|
|
60247
|
-
path2.call(
|
|
60248
|
-
path2.call(
|
|
60249
|
-
]) : path2.call(
|
|
60247
|
+
path2.call(print11, "id"),
|
|
60248
|
+
path2.call(print11, "init")
|
|
60249
|
+
]) : path2.call(print11, "id");
|
|
60250
60250
|
case "WithStatement":
|
|
60251
60251
|
return (0, lines_1.concat)([
|
|
60252
60252
|
"with (",
|
|
60253
|
-
path2.call(
|
|
60253
|
+
path2.call(print11, "object"),
|
|
60254
60254
|
") ",
|
|
60255
|
-
path2.call(
|
|
60255
|
+
path2.call(print11, "body")
|
|
60256
60256
|
]);
|
|
60257
60257
|
case "IfStatement": {
|
|
60258
|
-
var con = adjustClause(path2.call(
|
|
60259
|
-
parts.push("if (", path2.call(
|
|
60258
|
+
var con = adjustClause(path2.call(print11, "consequent"), options);
|
|
60259
|
+
parts.push("if (", path2.call(print11, "test"), ")", con);
|
|
60260
60260
|
if (n.alternate)
|
|
60261
|
-
parts.push(endsWithBrace(con) ? " else" : "\nelse", adjustClause(path2.call(
|
|
60261
|
+
parts.push(endsWithBrace(con) ? " else" : "\nelse", adjustClause(path2.call(print11, "alternate"), options));
|
|
60262
60262
|
return (0, lines_1.concat)(parts);
|
|
60263
60263
|
}
|
|
60264
60264
|
case "ForStatement": {
|
|
60265
|
-
var init = path2.call(
|
|
60265
|
+
var init = path2.call(print11, "init");
|
|
60266
60266
|
var sep2 = init.length > 1 ? ";\n" : "; ";
|
|
60267
60267
|
var forParen = "for (";
|
|
60268
|
-
var indented = (0, lines_1.fromString)(sep2).join([init, path2.call(
|
|
60268
|
+
var indented = (0, lines_1.fromString)(sep2).join([init, path2.call(print11, "test"), path2.call(print11, "update")]).indentTail(forParen.length);
|
|
60269
60269
|
var head = (0, lines_1.concat)([forParen, indented, ")"]);
|
|
60270
|
-
var clause = adjustClause(path2.call(
|
|
60270
|
+
var clause = adjustClause(path2.call(print11, "body"), options);
|
|
60271
60271
|
parts.push(head);
|
|
60272
60272
|
if (head.length > 1) {
|
|
60273
60273
|
parts.push("\n");
|
|
@@ -60279,18 +60279,18 @@ var require_printer2 = __commonJS({
|
|
|
60279
60279
|
case "WhileStatement":
|
|
60280
60280
|
return (0, lines_1.concat)([
|
|
60281
60281
|
"while (",
|
|
60282
|
-
path2.call(
|
|
60282
|
+
path2.call(print11, "test"),
|
|
60283
60283
|
")",
|
|
60284
|
-
adjustClause(path2.call(
|
|
60284
|
+
adjustClause(path2.call(print11, "body"), options)
|
|
60285
60285
|
]);
|
|
60286
60286
|
case "ForInStatement":
|
|
60287
60287
|
return (0, lines_1.concat)([
|
|
60288
60288
|
n.each ? "for each (" : "for (",
|
|
60289
|
-
path2.call(
|
|
60289
|
+
path2.call(print11, "left"),
|
|
60290
60290
|
" in ",
|
|
60291
|
-
path2.call(
|
|
60291
|
+
path2.call(print11, "right"),
|
|
60292
60292
|
")",
|
|
60293
|
-
adjustClause(path2.call(
|
|
60293
|
+
adjustClause(path2.call(print11, "body"), options)
|
|
60294
60294
|
]);
|
|
60295
60295
|
case "ForOfStatement":
|
|
60296
60296
|
case "ForAwaitStatement":
|
|
@@ -60298,122 +60298,122 @@ var require_printer2 = __commonJS({
|
|
|
60298
60298
|
if (n.await || n.type === "ForAwaitStatement") {
|
|
60299
60299
|
parts.push("await ");
|
|
60300
60300
|
}
|
|
60301
|
-
parts.push("(", path2.call(
|
|
60301
|
+
parts.push("(", path2.call(print11, "left"), " of ", path2.call(print11, "right"), ")", adjustClause(path2.call(print11, "body"), options));
|
|
60302
60302
|
return (0, lines_1.concat)(parts);
|
|
60303
60303
|
case "DoWhileStatement": {
|
|
60304
60304
|
var doBody = (0, lines_1.concat)([
|
|
60305
60305
|
"do",
|
|
60306
|
-
adjustClause(path2.call(
|
|
60306
|
+
adjustClause(path2.call(print11, "body"), options)
|
|
60307
60307
|
]);
|
|
60308
60308
|
parts.push(doBody);
|
|
60309
60309
|
if (endsWithBrace(doBody))
|
|
60310
60310
|
parts.push(" while");
|
|
60311
60311
|
else
|
|
60312
60312
|
parts.push("\nwhile");
|
|
60313
|
-
parts.push(" (", path2.call(
|
|
60313
|
+
parts.push(" (", path2.call(print11, "test"), ");");
|
|
60314
60314
|
return (0, lines_1.concat)(parts);
|
|
60315
60315
|
}
|
|
60316
60316
|
case "DoExpression": {
|
|
60317
60317
|
var statements = path2.call(function(bodyPath) {
|
|
60318
|
-
return printStatementSequence(bodyPath, options,
|
|
60318
|
+
return printStatementSequence(bodyPath, options, print11);
|
|
60319
60319
|
}, "body");
|
|
60320
60320
|
return (0, lines_1.concat)(["do {\n", statements.indent(options.tabWidth), "\n}"]);
|
|
60321
60321
|
}
|
|
60322
60322
|
case "BreakStatement":
|
|
60323
60323
|
parts.push("break");
|
|
60324
60324
|
if (n.label)
|
|
60325
|
-
parts.push(" ", path2.call(
|
|
60325
|
+
parts.push(" ", path2.call(print11, "label"));
|
|
60326
60326
|
parts.push(";");
|
|
60327
60327
|
return (0, lines_1.concat)(parts);
|
|
60328
60328
|
case "ContinueStatement":
|
|
60329
60329
|
parts.push("continue");
|
|
60330
60330
|
if (n.label)
|
|
60331
|
-
parts.push(" ", path2.call(
|
|
60331
|
+
parts.push(" ", path2.call(print11, "label"));
|
|
60332
60332
|
parts.push(";");
|
|
60333
60333
|
return (0, lines_1.concat)(parts);
|
|
60334
60334
|
case "LabeledStatement":
|
|
60335
60335
|
return (0, lines_1.concat)([
|
|
60336
|
-
path2.call(
|
|
60336
|
+
path2.call(print11, "label"),
|
|
60337
60337
|
":\n",
|
|
60338
|
-
path2.call(
|
|
60338
|
+
path2.call(print11, "body")
|
|
60339
60339
|
]);
|
|
60340
60340
|
case "TryStatement":
|
|
60341
|
-
parts.push("try ", path2.call(
|
|
60341
|
+
parts.push("try ", path2.call(print11, "block"));
|
|
60342
60342
|
if (n.handler) {
|
|
60343
|
-
parts.push(" ", path2.call(
|
|
60343
|
+
parts.push(" ", path2.call(print11, "handler"));
|
|
60344
60344
|
} else if (n.handlers) {
|
|
60345
60345
|
path2.each(function(handlerPath) {
|
|
60346
|
-
parts.push(" ",
|
|
60346
|
+
parts.push(" ", print11(handlerPath));
|
|
60347
60347
|
}, "handlers");
|
|
60348
60348
|
}
|
|
60349
60349
|
if (n.finalizer) {
|
|
60350
|
-
parts.push(" finally ", path2.call(
|
|
60350
|
+
parts.push(" finally ", path2.call(print11, "finalizer"));
|
|
60351
60351
|
}
|
|
60352
60352
|
return (0, lines_1.concat)(parts);
|
|
60353
60353
|
case "CatchClause":
|
|
60354
60354
|
parts.push("catch ");
|
|
60355
60355
|
if (n.param) {
|
|
60356
|
-
parts.push("(", path2.call(
|
|
60356
|
+
parts.push("(", path2.call(print11, "param"));
|
|
60357
60357
|
}
|
|
60358
60358
|
if (n.guard) {
|
|
60359
|
-
parts.push(" if ", path2.call(
|
|
60359
|
+
parts.push(" if ", path2.call(print11, "guard"));
|
|
60360
60360
|
}
|
|
60361
60361
|
if (n.param) {
|
|
60362
60362
|
parts.push(") ");
|
|
60363
60363
|
}
|
|
60364
|
-
parts.push(path2.call(
|
|
60364
|
+
parts.push(path2.call(print11, "body"));
|
|
60365
60365
|
return (0, lines_1.concat)(parts);
|
|
60366
60366
|
case "ThrowStatement":
|
|
60367
|
-
return (0, lines_1.concat)(["throw ", path2.call(
|
|
60367
|
+
return (0, lines_1.concat)(["throw ", path2.call(print11, "argument"), ";"]);
|
|
60368
60368
|
case "SwitchStatement":
|
|
60369
60369
|
return (0, lines_1.concat)([
|
|
60370
60370
|
"switch (",
|
|
60371
|
-
path2.call(
|
|
60371
|
+
path2.call(print11, "discriminant"),
|
|
60372
60372
|
") {\n",
|
|
60373
|
-
(0, lines_1.fromString)("\n").join(path2.map(
|
|
60373
|
+
(0, lines_1.fromString)("\n").join(path2.map(print11, "cases")),
|
|
60374
60374
|
"\n}"
|
|
60375
60375
|
]);
|
|
60376
60376
|
case "SwitchCase":
|
|
60377
60377
|
if (n.test)
|
|
60378
|
-
parts.push("case ", path2.call(
|
|
60378
|
+
parts.push("case ", path2.call(print11, "test"), ":");
|
|
60379
60379
|
else
|
|
60380
60380
|
parts.push("default:");
|
|
60381
60381
|
if (n.consequent.length > 0) {
|
|
60382
60382
|
parts.push("\n", path2.call(function(consequentPath) {
|
|
60383
|
-
return printStatementSequence(consequentPath, options,
|
|
60383
|
+
return printStatementSequence(consequentPath, options, print11);
|
|
60384
60384
|
}, "consequent").indent(options.tabWidth));
|
|
60385
60385
|
}
|
|
60386
60386
|
return (0, lines_1.concat)(parts);
|
|
60387
60387
|
case "DebuggerStatement":
|
|
60388
60388
|
return (0, lines_1.fromString)("debugger;");
|
|
60389
60389
|
case "JSXAttribute":
|
|
60390
|
-
parts.push(path2.call(
|
|
60390
|
+
parts.push(path2.call(print11, "name"));
|
|
60391
60391
|
if (n.value)
|
|
60392
|
-
parts.push("=", path2.call(
|
|
60392
|
+
parts.push("=", path2.call(print11, "value"));
|
|
60393
60393
|
return (0, lines_1.concat)(parts);
|
|
60394
60394
|
case "JSXIdentifier":
|
|
60395
60395
|
return (0, lines_1.fromString)(n.name, options);
|
|
60396
60396
|
case "JSXNamespacedName":
|
|
60397
60397
|
return (0, lines_1.fromString)(":").join([
|
|
60398
|
-
path2.call(
|
|
60399
|
-
path2.call(
|
|
60398
|
+
path2.call(print11, "namespace"),
|
|
60399
|
+
path2.call(print11, "name")
|
|
60400
60400
|
]);
|
|
60401
60401
|
case "JSXMemberExpression":
|
|
60402
60402
|
return (0, lines_1.fromString)(".").join([
|
|
60403
|
-
path2.call(
|
|
60404
|
-
path2.call(
|
|
60403
|
+
path2.call(print11, "object"),
|
|
60404
|
+
path2.call(print11, "property")
|
|
60405
60405
|
]);
|
|
60406
60406
|
case "JSXSpreadAttribute":
|
|
60407
|
-
return (0, lines_1.concat)(["{...", path2.call(
|
|
60407
|
+
return (0, lines_1.concat)(["{...", path2.call(print11, "argument"), "}"]);
|
|
60408
60408
|
case "JSXSpreadChild":
|
|
60409
|
-
return (0, lines_1.concat)(["{...", path2.call(
|
|
60409
|
+
return (0, lines_1.concat)(["{...", path2.call(print11, "expression"), "}"]);
|
|
60410
60410
|
case "JSXExpressionContainer":
|
|
60411
|
-
return (0, lines_1.concat)(["{", path2.call(
|
|
60411
|
+
return (0, lines_1.concat)(["{", path2.call(print11, "expression"), "}"]);
|
|
60412
60412
|
case "JSXElement":
|
|
60413
60413
|
case "JSXFragment": {
|
|
60414
60414
|
var openingPropName = "opening" + (n.type === "JSXElement" ? "Element" : "Fragment");
|
|
60415
60415
|
var closingPropName = "closing" + (n.type === "JSXElement" ? "Element" : "Fragment");
|
|
60416
|
-
var openingLines = path2.call(
|
|
60416
|
+
var openingLines = path2.call(print11, openingPropName);
|
|
60417
60417
|
if (n[openingPropName].selfClosing) {
|
|
60418
60418
|
assert_1.default.ok(!n[closingPropName], "unexpected " + closingPropName + " element in self-closing " + n.type);
|
|
60419
60419
|
return openingLines;
|
|
@@ -60427,16 +60427,16 @@ var require_printer2 = __commonJS({
|
|
|
60427
60427
|
return "\n";
|
|
60428
60428
|
}
|
|
60429
60429
|
}
|
|
60430
|
-
return
|
|
60430
|
+
return print11(childPath);
|
|
60431
60431
|
}, "children")).indentTail(options.tabWidth);
|
|
60432
|
-
var closingLines = path2.call(
|
|
60432
|
+
var closingLines = path2.call(print11, closingPropName);
|
|
60433
60433
|
return (0, lines_1.concat)([openingLines, childLines, closingLines]);
|
|
60434
60434
|
}
|
|
60435
60435
|
case "JSXOpeningElement": {
|
|
60436
|
-
parts.push("<", path2.call(
|
|
60436
|
+
parts.push("<", path2.call(print11, "name"));
|
|
60437
60437
|
var attrParts_1 = [];
|
|
60438
60438
|
path2.each(function(attrPath) {
|
|
60439
|
-
attrParts_1.push(" ",
|
|
60439
|
+
attrParts_1.push(" ", print11(attrPath));
|
|
60440
60440
|
}, "attributes");
|
|
60441
60441
|
var attrLines = (0, lines_1.concat)(attrParts_1);
|
|
60442
60442
|
var needLineWrap = attrLines.length > 1 || attrLines.getLineLength(1) > options.wrapColumn;
|
|
@@ -60453,7 +60453,7 @@ var require_printer2 = __commonJS({
|
|
|
60453
60453
|
return (0, lines_1.concat)(parts);
|
|
60454
60454
|
}
|
|
60455
60455
|
case "JSXClosingElement":
|
|
60456
|
-
return (0, lines_1.concat)(["</", path2.call(
|
|
60456
|
+
return (0, lines_1.concat)(["</", path2.call(print11, "name"), ">"]);
|
|
60457
60457
|
case "JSXOpeningFragment":
|
|
60458
60458
|
return (0, lines_1.fromString)("<>");
|
|
60459
60459
|
case "JSXClosingFragment":
|
|
@@ -60464,9 +60464,9 @@ var require_printer2 = __commonJS({
|
|
|
60464
60464
|
return (0, lines_1.fromString)("");
|
|
60465
60465
|
case "TypeAnnotatedIdentifier":
|
|
60466
60466
|
return (0, lines_1.concat)([
|
|
60467
|
-
path2.call(
|
|
60467
|
+
path2.call(print11, "annotation"),
|
|
60468
60468
|
" ",
|
|
60469
|
-
path2.call(
|
|
60469
|
+
path2.call(print11, "identifier")
|
|
60470
60470
|
]);
|
|
60471
60471
|
case "ClassBody":
|
|
60472
60472
|
if (n.body.length === 0) {
|
|
@@ -60475,12 +60475,12 @@ var require_printer2 = __commonJS({
|
|
|
60475
60475
|
return (0, lines_1.concat)([
|
|
60476
60476
|
"{\n",
|
|
60477
60477
|
path2.call(function(bodyPath) {
|
|
60478
|
-
return printStatementSequence(bodyPath, options,
|
|
60478
|
+
return printStatementSequence(bodyPath, options, print11);
|
|
60479
60479
|
}, "body").indent(options.tabWidth),
|
|
60480
60480
|
"\n}"
|
|
60481
60481
|
]);
|
|
60482
60482
|
case "ClassPropertyDefinition":
|
|
60483
|
-
parts.push("static ", path2.call(
|
|
60483
|
+
parts.push("static ", path2.call(print11, "definition"));
|
|
60484
60484
|
if (!namedTypes.MethodDefinition.check(n.definition))
|
|
60485
60485
|
parts.push(";");
|
|
60486
60486
|
return (0, lines_1.concat)(parts);
|
|
@@ -60501,12 +60501,12 @@ var require_printer2 = __commonJS({
|
|
|
60501
60501
|
if (n.readonly) {
|
|
60502
60502
|
parts.push("readonly ");
|
|
60503
60503
|
}
|
|
60504
|
-
var key = path2.call(
|
|
60504
|
+
var key = path2.call(print11, "key");
|
|
60505
60505
|
if (n.computed) {
|
|
60506
60506
|
key = (0, lines_1.concat)(["[", key, "]"]);
|
|
60507
60507
|
}
|
|
60508
60508
|
if (n.variance) {
|
|
60509
|
-
key = (0, lines_1.concat)([printVariance(path2,
|
|
60509
|
+
key = (0, lines_1.concat)([printVariance(path2, print11), key]);
|
|
60510
60510
|
}
|
|
60511
60511
|
parts.push(key);
|
|
60512
60512
|
if (n.optional) {
|
|
@@ -60516,10 +60516,10 @@ var require_printer2 = __commonJS({
|
|
|
60516
60516
|
parts.push("!");
|
|
60517
60517
|
}
|
|
60518
60518
|
if (n.typeAnnotation) {
|
|
60519
|
-
parts.push(path2.call(
|
|
60519
|
+
parts.push(path2.call(print11, "typeAnnotation"));
|
|
60520
60520
|
}
|
|
60521
60521
|
if (n.value) {
|
|
60522
|
-
parts.push(" = ", path2.call(
|
|
60522
|
+
parts.push(" = ", path2.call(print11, "value"));
|
|
60523
60523
|
}
|
|
60524
60524
|
parts.push(";");
|
|
60525
60525
|
return (0, lines_1.concat)(parts);
|
|
@@ -60528,21 +60528,21 @@ var require_printer2 = __commonJS({
|
|
|
60528
60528
|
if (n.static) {
|
|
60529
60529
|
parts.push("static ");
|
|
60530
60530
|
}
|
|
60531
|
-
parts.push(path2.call(
|
|
60531
|
+
parts.push(path2.call(print11, "key"));
|
|
60532
60532
|
if (n.typeAnnotation) {
|
|
60533
|
-
parts.push(path2.call(
|
|
60533
|
+
parts.push(path2.call(print11, "typeAnnotation"));
|
|
60534
60534
|
}
|
|
60535
60535
|
if (n.value) {
|
|
60536
|
-
parts.push(" = ", path2.call(
|
|
60536
|
+
parts.push(" = ", path2.call(print11, "value"));
|
|
60537
60537
|
}
|
|
60538
60538
|
parts.push(";");
|
|
60539
60539
|
return (0, lines_1.concat)(parts);
|
|
60540
60540
|
case "ClassAccessorProperty": {
|
|
60541
60541
|
parts.push.apply(parts, tslib_1.__spreadArray(tslib_1.__spreadArray([], printClassMemberModifiers(n), false), ["accessor "], false));
|
|
60542
60542
|
if (n.computed) {
|
|
60543
|
-
parts.push("[", path2.call(
|
|
60543
|
+
parts.push("[", path2.call(print11, "key"), "]");
|
|
60544
60544
|
} else {
|
|
60545
|
-
parts.push(path2.call(
|
|
60545
|
+
parts.push(path2.call(print11, "key"));
|
|
60546
60546
|
}
|
|
60547
60547
|
if (n.optional) {
|
|
60548
60548
|
parts.push("?");
|
|
@@ -60551,10 +60551,10 @@ var require_printer2 = __commonJS({
|
|
|
60551
60551
|
parts.push("!");
|
|
60552
60552
|
}
|
|
60553
60553
|
if (n.typeAnnotation) {
|
|
60554
|
-
parts.push(path2.call(
|
|
60554
|
+
parts.push(path2.call(print11, "typeAnnotation"));
|
|
60555
60555
|
}
|
|
60556
60556
|
if (n.value) {
|
|
60557
|
-
parts.push(" = ", path2.call(
|
|
60557
|
+
parts.push(" = ", path2.call(print11, "value"));
|
|
60558
60558
|
}
|
|
60559
60559
|
parts.push(";");
|
|
60560
60560
|
return (0, lines_1.concat)(parts);
|
|
@@ -60570,21 +60570,21 @@ var require_printer2 = __commonJS({
|
|
|
60570
60570
|
}
|
|
60571
60571
|
parts.push("class");
|
|
60572
60572
|
if (n.id) {
|
|
60573
|
-
parts.push(" ", path2.call(
|
|
60573
|
+
parts.push(" ", path2.call(print11, "id"));
|
|
60574
60574
|
}
|
|
60575
60575
|
if (n.typeParameters) {
|
|
60576
|
-
parts.push(path2.call(
|
|
60576
|
+
parts.push(path2.call(print11, "typeParameters"));
|
|
60577
60577
|
}
|
|
60578
60578
|
if (n.superClass) {
|
|
60579
|
-
parts.push(" extends ", path2.call(
|
|
60579
|
+
parts.push(" extends ", path2.call(print11, "superClass"), path2.call(print11, "superTypeParameters"));
|
|
60580
60580
|
}
|
|
60581
60581
|
if (n.extends && n.extends.length > 0) {
|
|
60582
|
-
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(
|
|
60582
|
+
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(print11, "extends")));
|
|
60583
60583
|
}
|
|
60584
60584
|
if (n["implements"] && n["implements"].length > 0) {
|
|
60585
|
-
parts.push(" implements ", (0, lines_1.fromString)(", ").join(path2.map(
|
|
60585
|
+
parts.push(" implements ", (0, lines_1.fromString)(", ").join(path2.map(print11, "implements")));
|
|
60586
60586
|
}
|
|
60587
|
-
parts.push(" ", path2.call(
|
|
60587
|
+
parts.push(" ", path2.call(print11, "body"));
|
|
60588
60588
|
if (n.type === "DeclareClass") {
|
|
60589
60589
|
return printFlowDeclaration(path2, parts);
|
|
60590
60590
|
} else {
|
|
@@ -60593,11 +60593,11 @@ var require_printer2 = __commonJS({
|
|
|
60593
60593
|
case "TemplateElement":
|
|
60594
60594
|
return (0, lines_1.fromString)(n.value.raw, options).lockIndentTail();
|
|
60595
60595
|
case "TemplateLiteral": {
|
|
60596
|
-
var expressions_1 = path2.map(
|
|
60596
|
+
var expressions_1 = path2.map(print11, "expressions");
|
|
60597
60597
|
parts.push("`");
|
|
60598
60598
|
path2.each(function(childPath) {
|
|
60599
60599
|
var i2 = childPath.getName();
|
|
60600
|
-
parts.push(
|
|
60600
|
+
parts.push(print11(childPath));
|
|
60601
60601
|
if (i2 < expressions_1.length) {
|
|
60602
60602
|
parts.push("${", expressions_1[i2], "}");
|
|
60603
60603
|
}
|
|
@@ -60606,7 +60606,7 @@ var require_printer2 = __commonJS({
|
|
|
60606
60606
|
return (0, lines_1.concat)(parts).lockIndentTail();
|
|
60607
60607
|
}
|
|
60608
60608
|
case "TaggedTemplateExpression":
|
|
60609
|
-
return (0, lines_1.concat)([path2.call(
|
|
60609
|
+
return (0, lines_1.concat)([path2.call(print11, "tag"), path2.call(print11, "quasi")]);
|
|
60610
60610
|
case "Node":
|
|
60611
60611
|
case "Printable":
|
|
60612
60612
|
case "SourceLocation":
|
|
@@ -60640,7 +60640,7 @@ var require_printer2 = __commonJS({
|
|
|
60640
60640
|
if (n.typeAnnotation.type !== "FunctionTypeAnnotation") {
|
|
60641
60641
|
parts.push(": ");
|
|
60642
60642
|
}
|
|
60643
|
-
parts.push(path2.call(
|
|
60643
|
+
parts.push(path2.call(print11, "typeAnnotation"));
|
|
60644
60644
|
return (0, lines_1.concat)(parts);
|
|
60645
60645
|
}
|
|
60646
60646
|
return (0, lines_1.fromString)("");
|
|
@@ -60654,9 +60654,9 @@ var require_printer2 = __commonJS({
|
|
|
60654
60654
|
case "MixedTypeAnnotation":
|
|
60655
60655
|
return (0, lines_1.fromString)("mixed", options);
|
|
60656
60656
|
case "ArrayTypeAnnotation":
|
|
60657
|
-
return (0, lines_1.concat)([path2.call(
|
|
60657
|
+
return (0, lines_1.concat)([path2.call(print11, "elementType"), "[]"]);
|
|
60658
60658
|
case "TupleTypeAnnotation": {
|
|
60659
|
-
var printed_2 = path2.map(
|
|
60659
|
+
var printed_2 = path2.map(print11, "types");
|
|
60660
60660
|
var joined = (0, lines_1.fromString)(", ").join(printed_2);
|
|
60661
60661
|
var oneLine_3 = joined.getLineLength(1) <= options.wrapColumn;
|
|
60662
60662
|
if (oneLine_3) {
|
|
@@ -60703,38 +60703,38 @@ var require_printer2 = __commonJS({
|
|
|
60703
60703
|
case "InterfaceTypeAnnotation":
|
|
60704
60704
|
parts.push("interface");
|
|
60705
60705
|
if (n.extends && n.extends.length > 0) {
|
|
60706
|
-
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(
|
|
60706
|
+
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(print11, "extends")));
|
|
60707
60707
|
}
|
|
60708
|
-
parts.push(" ", path2.call(
|
|
60708
|
+
parts.push(" ", path2.call(print11, "body"));
|
|
60709
60709
|
return (0, lines_1.concat)(parts);
|
|
60710
60710
|
case "DeclareFunction":
|
|
60711
60711
|
return printFlowDeclaration(path2, [
|
|
60712
60712
|
"function ",
|
|
60713
|
-
path2.call(
|
|
60713
|
+
path2.call(print11, "id"),
|
|
60714
60714
|
";"
|
|
60715
60715
|
]);
|
|
60716
60716
|
case "DeclareModule":
|
|
60717
60717
|
return printFlowDeclaration(path2, [
|
|
60718
60718
|
"module ",
|
|
60719
|
-
path2.call(
|
|
60719
|
+
path2.call(print11, "id"),
|
|
60720
60720
|
" ",
|
|
60721
|
-
path2.call(
|
|
60721
|
+
path2.call(print11, "body")
|
|
60722
60722
|
]);
|
|
60723
60723
|
case "DeclareModuleExports":
|
|
60724
60724
|
return printFlowDeclaration(path2, [
|
|
60725
60725
|
"module.exports",
|
|
60726
|
-
path2.call(
|
|
60726
|
+
path2.call(print11, "typeAnnotation")
|
|
60727
60727
|
]);
|
|
60728
60728
|
case "DeclareVariable":
|
|
60729
|
-
return printFlowDeclaration(path2, ["var ", path2.call(
|
|
60729
|
+
return printFlowDeclaration(path2, ["var ", path2.call(print11, "id"), ";"]);
|
|
60730
60730
|
case "DeclareExportDeclaration":
|
|
60731
60731
|
case "DeclareExportAllDeclaration":
|
|
60732
|
-
return (0, lines_1.concat)(["declare ", printExportDeclaration(path2, options,
|
|
60732
|
+
return (0, lines_1.concat)(["declare ", printExportDeclaration(path2, options, print11)]);
|
|
60733
60733
|
case "EnumDeclaration":
|
|
60734
60734
|
return (0, lines_1.concat)([
|
|
60735
60735
|
"enum ",
|
|
60736
|
-
path2.call(
|
|
60737
|
-
path2.call(
|
|
60736
|
+
path2.call(print11, "id"),
|
|
60737
|
+
path2.call(print11, "body")
|
|
60738
60738
|
]);
|
|
60739
60739
|
case "EnumBooleanBody":
|
|
60740
60740
|
case "EnumNumberBody":
|
|
@@ -60746,24 +60746,24 @@ var require_printer2 = __commonJS({
|
|
|
60746
60746
|
n.type.slice(4, -4).toLowerCase()
|
|
60747
60747
|
);
|
|
60748
60748
|
}
|
|
60749
|
-
parts.push(" {\n", (0, lines_1.fromString)("\n").join(path2.map(
|
|
60749
|
+
parts.push(" {\n", (0, lines_1.fromString)("\n").join(path2.map(print11, "members")).indent(options.tabWidth), "\n}");
|
|
60750
60750
|
return (0, lines_1.concat)(parts);
|
|
60751
60751
|
}
|
|
60752
60752
|
case "EnumDefaultedMember":
|
|
60753
|
-
return (0, lines_1.concat)([path2.call(
|
|
60753
|
+
return (0, lines_1.concat)([path2.call(print11, "id"), ","]);
|
|
60754
60754
|
case "EnumBooleanMember":
|
|
60755
60755
|
case "EnumNumberMember":
|
|
60756
60756
|
case "EnumStringMember":
|
|
60757
60757
|
return (0, lines_1.concat)([
|
|
60758
|
-
path2.call(
|
|
60758
|
+
path2.call(print11, "id"),
|
|
60759
60759
|
" = ",
|
|
60760
|
-
path2.call(
|
|
60760
|
+
path2.call(print11, "init"),
|
|
60761
60761
|
","
|
|
60762
60762
|
]);
|
|
60763
60763
|
case "InferredPredicate":
|
|
60764
60764
|
return (0, lines_1.fromString)("%checks", options);
|
|
60765
60765
|
case "DeclaredPredicate":
|
|
60766
|
-
return (0, lines_1.concat)(["%checks(", path2.call(
|
|
60766
|
+
return (0, lines_1.concat)(["%checks(", path2.call(print11, "value"), ")"]);
|
|
60767
60767
|
case "FunctionTypeAnnotation": {
|
|
60768
60768
|
var parent = path2.getParentNode(0);
|
|
60769
60769
|
var isArrowFunctionTypeAnnotation = !(namedTypes.ObjectTypeCallProperty.check(parent) || namedTypes.ObjectTypeInternalSlot.check(parent) && parent.method || namedTypes.DeclareFunction.check(path2.getParentNode(2)));
|
|
@@ -60773,14 +60773,14 @@ var require_printer2 = __commonJS({
|
|
|
60773
60773
|
}
|
|
60774
60774
|
var hasTypeParameters = !!n.typeParameters;
|
|
60775
60775
|
var needsParens = hasTypeParameters || n.params.length !== 1 || n.params[0].name;
|
|
60776
|
-
parts.push(hasTypeParameters ? path2.call(
|
|
60776
|
+
parts.push(hasTypeParameters ? path2.call(print11, "typeParameters") : "", needsParens ? "(" : "", printFunctionParams(path2, options, print11), needsParens ? ")" : "");
|
|
60777
60777
|
if (n.returnType) {
|
|
60778
|
-
parts.push(isArrowFunctionTypeAnnotation ? " => " : ": ", path2.call(
|
|
60778
|
+
parts.push(isArrowFunctionTypeAnnotation ? " => " : ": ", path2.call(print11, "returnType"));
|
|
60779
60779
|
}
|
|
60780
60780
|
return (0, lines_1.concat)(parts);
|
|
60781
60781
|
}
|
|
60782
60782
|
case "FunctionTypeParam": {
|
|
60783
|
-
var name = path2.call(
|
|
60783
|
+
var name = path2.call(print11, "name");
|
|
60784
60784
|
parts.push(name);
|
|
60785
60785
|
if (n.optional) {
|
|
60786
60786
|
parts.push("?");
|
|
@@ -60788,13 +60788,13 @@ var require_printer2 = __commonJS({
|
|
|
60788
60788
|
if (name.infos[0].line) {
|
|
60789
60789
|
parts.push(": ");
|
|
60790
60790
|
}
|
|
60791
|
-
parts.push(path2.call(
|
|
60791
|
+
parts.push(path2.call(print11, "typeAnnotation"));
|
|
60792
60792
|
return (0, lines_1.concat)(parts);
|
|
60793
60793
|
}
|
|
60794
60794
|
case "GenericTypeAnnotation":
|
|
60795
60795
|
return (0, lines_1.concat)([
|
|
60796
|
-
path2.call(
|
|
60797
|
-
path2.call(
|
|
60796
|
+
path2.call(print11, "id"),
|
|
60797
|
+
path2.call(print11, "typeParameters")
|
|
60798
60798
|
]);
|
|
60799
60799
|
case "DeclareInterface":
|
|
60800
60800
|
parts.push("declare ");
|
|
@@ -60803,24 +60803,24 @@ var require_printer2 = __commonJS({
|
|
|
60803
60803
|
if (n.declare) {
|
|
60804
60804
|
parts.push("declare ");
|
|
60805
60805
|
}
|
|
60806
|
-
parts.push("interface ", path2.call(
|
|
60806
|
+
parts.push("interface ", path2.call(print11, "id"), path2.call(print11, "typeParameters"), " ");
|
|
60807
60807
|
if (n["extends"] && n["extends"].length > 0) {
|
|
60808
|
-
parts.push("extends ", (0, lines_1.fromString)(", ").join(path2.map(
|
|
60808
|
+
parts.push("extends ", (0, lines_1.fromString)(", ").join(path2.map(print11, "extends")), " ");
|
|
60809
60809
|
}
|
|
60810
60810
|
if (n.body) {
|
|
60811
|
-
parts.push(path2.call(
|
|
60811
|
+
parts.push(path2.call(print11, "body"));
|
|
60812
60812
|
}
|
|
60813
60813
|
return (0, lines_1.concat)(parts);
|
|
60814
60814
|
case "ClassImplements":
|
|
60815
60815
|
case "InterfaceExtends":
|
|
60816
60816
|
return (0, lines_1.concat)([
|
|
60817
|
-
path2.call(
|
|
60818
|
-
path2.call(
|
|
60817
|
+
path2.call(print11, "id"),
|
|
60818
|
+
path2.call(print11, "typeParameters")
|
|
60819
60819
|
]);
|
|
60820
60820
|
case "IntersectionTypeAnnotation":
|
|
60821
|
-
return (0, lines_1.fromString)(" & ").join(path2.map(
|
|
60821
|
+
return (0, lines_1.fromString)(" & ").join(path2.map(print11, "types"));
|
|
60822
60822
|
case "NullableTypeAnnotation":
|
|
60823
|
-
return (0, lines_1.concat)(["?", path2.call(
|
|
60823
|
+
return (0, lines_1.concat)(["?", path2.call(print11, "typeAnnotation")]);
|
|
60824
60824
|
case "NullLiteralTypeAnnotation":
|
|
60825
60825
|
return (0, lines_1.fromString)("null", options);
|
|
60826
60826
|
case "ThisTypeAnnotation":
|
|
@@ -60828,40 +60828,40 @@ var require_printer2 = __commonJS({
|
|
|
60828
60828
|
case "NumberTypeAnnotation":
|
|
60829
60829
|
return (0, lines_1.fromString)("number", options);
|
|
60830
60830
|
case "ObjectTypeCallProperty":
|
|
60831
|
-
return path2.call(
|
|
60831
|
+
return path2.call(print11, "value");
|
|
60832
60832
|
case "ObjectTypeIndexer":
|
|
60833
60833
|
if (n.static) {
|
|
60834
60834
|
parts.push("static ");
|
|
60835
60835
|
}
|
|
60836
|
-
parts.push(printVariance(path2,
|
|
60836
|
+
parts.push(printVariance(path2, print11), "[");
|
|
60837
60837
|
if (n.id) {
|
|
60838
|
-
parts.push(path2.call(
|
|
60838
|
+
parts.push(path2.call(print11, "id"), ": ");
|
|
60839
60839
|
}
|
|
60840
|
-
parts.push(path2.call(
|
|
60840
|
+
parts.push(path2.call(print11, "key"), "]: ", path2.call(print11, "value"));
|
|
60841
60841
|
return (0, lines_1.concat)(parts);
|
|
60842
60842
|
case "ObjectTypeProperty":
|
|
60843
60843
|
return (0, lines_1.concat)([
|
|
60844
|
-
printVariance(path2,
|
|
60845
|
-
path2.call(
|
|
60844
|
+
printVariance(path2, print11),
|
|
60845
|
+
path2.call(print11, "key"),
|
|
60846
60846
|
n.optional ? "?" : "",
|
|
60847
60847
|
": ",
|
|
60848
|
-
path2.call(
|
|
60848
|
+
path2.call(print11, "value")
|
|
60849
60849
|
]);
|
|
60850
60850
|
case "ObjectTypeInternalSlot":
|
|
60851
60851
|
return (0, lines_1.concat)([
|
|
60852
60852
|
n.static ? "static " : "",
|
|
60853
60853
|
"[[",
|
|
60854
|
-
path2.call(
|
|
60854
|
+
path2.call(print11, "id"),
|
|
60855
60855
|
"]]",
|
|
60856
60856
|
n.optional ? "?" : "",
|
|
60857
60857
|
n.value.type !== "FunctionTypeAnnotation" ? ": " : "",
|
|
60858
|
-
path2.call(
|
|
60858
|
+
path2.call(print11, "value")
|
|
60859
60859
|
]);
|
|
60860
60860
|
case "QualifiedTypeIdentifier":
|
|
60861
60861
|
return (0, lines_1.concat)([
|
|
60862
|
-
path2.call(
|
|
60862
|
+
path2.call(print11, "qualification"),
|
|
60863
60863
|
".",
|
|
60864
|
-
path2.call(
|
|
60864
|
+
path2.call(print11, "id")
|
|
60865
60865
|
]);
|
|
60866
60866
|
case "StringLiteralTypeAnnotation":
|
|
60867
60867
|
return (0, lines_1.fromString)(nodeStr(n.value, options), options);
|
|
@@ -60878,36 +60878,36 @@ var require_printer2 = __commonJS({
|
|
|
60878
60878
|
case "TypeAlias":
|
|
60879
60879
|
return (0, lines_1.concat)([
|
|
60880
60880
|
"type ",
|
|
60881
|
-
path2.call(
|
|
60882
|
-
path2.call(
|
|
60881
|
+
path2.call(print11, "id"),
|
|
60882
|
+
path2.call(print11, "typeParameters"),
|
|
60883
60883
|
" = ",
|
|
60884
|
-
path2.call(
|
|
60884
|
+
path2.call(print11, "right"),
|
|
60885
60885
|
";"
|
|
60886
60886
|
]);
|
|
60887
60887
|
case "DeclareOpaqueType":
|
|
60888
60888
|
parts.push("declare ");
|
|
60889
60889
|
case "OpaqueType":
|
|
60890
|
-
parts.push("opaque type ", path2.call(
|
|
60890
|
+
parts.push("opaque type ", path2.call(print11, "id"), path2.call(print11, "typeParameters"));
|
|
60891
60891
|
if (n["supertype"]) {
|
|
60892
|
-
parts.push(": ", path2.call(
|
|
60892
|
+
parts.push(": ", path2.call(print11, "supertype"));
|
|
60893
60893
|
}
|
|
60894
60894
|
if (n["impltype"]) {
|
|
60895
|
-
parts.push(" = ", path2.call(
|
|
60895
|
+
parts.push(" = ", path2.call(print11, "impltype"));
|
|
60896
60896
|
}
|
|
60897
60897
|
parts.push(";");
|
|
60898
60898
|
return (0, lines_1.concat)(parts);
|
|
60899
60899
|
case "TypeCastExpression":
|
|
60900
60900
|
return (0, lines_1.concat)([
|
|
60901
60901
|
"(",
|
|
60902
|
-
path2.call(
|
|
60903
|
-
path2.call(
|
|
60902
|
+
path2.call(print11, "expression"),
|
|
60903
|
+
path2.call(print11, "typeAnnotation"),
|
|
60904
60904
|
")"
|
|
60905
60905
|
]);
|
|
60906
60906
|
case "TypeParameterDeclaration":
|
|
60907
60907
|
case "TypeParameterInstantiation":
|
|
60908
60908
|
return (0, lines_1.concat)([
|
|
60909
60909
|
"<",
|
|
60910
|
-
(0, lines_1.fromString)(", ").join(path2.map(
|
|
60910
|
+
(0, lines_1.fromString)(", ").join(path2.map(print11, "params")),
|
|
60911
60911
|
">"
|
|
60912
60912
|
]);
|
|
60913
60913
|
case "Variance":
|
|
@@ -60920,32 +60920,32 @@ var require_printer2 = __commonJS({
|
|
|
60920
60920
|
return (0, lines_1.fromString)("");
|
|
60921
60921
|
case "TypeParameter":
|
|
60922
60922
|
if (n.variance) {
|
|
60923
|
-
parts.push(printVariance(path2,
|
|
60923
|
+
parts.push(printVariance(path2, print11));
|
|
60924
60924
|
}
|
|
60925
|
-
parts.push(path2.call(
|
|
60925
|
+
parts.push(path2.call(print11, "name"));
|
|
60926
60926
|
if (n.bound) {
|
|
60927
|
-
parts.push(path2.call(
|
|
60927
|
+
parts.push(path2.call(print11, "bound"));
|
|
60928
60928
|
}
|
|
60929
60929
|
if (n["default"]) {
|
|
60930
|
-
parts.push("=", path2.call(
|
|
60930
|
+
parts.push("=", path2.call(print11, "default"));
|
|
60931
60931
|
}
|
|
60932
60932
|
return (0, lines_1.concat)(parts);
|
|
60933
60933
|
case "TypeofTypeAnnotation":
|
|
60934
60934
|
return (0, lines_1.concat)([
|
|
60935
60935
|
(0, lines_1.fromString)("typeof ", options),
|
|
60936
|
-
path2.call(
|
|
60936
|
+
path2.call(print11, "argument")
|
|
60937
60937
|
]);
|
|
60938
60938
|
case "IndexedAccessType":
|
|
60939
60939
|
case "OptionalIndexedAccessType":
|
|
60940
60940
|
return (0, lines_1.concat)([
|
|
60941
|
-
path2.call(
|
|
60941
|
+
path2.call(print11, "objectType"),
|
|
60942
60942
|
n.optional ? "?." : "",
|
|
60943
60943
|
"[",
|
|
60944
|
-
path2.call(
|
|
60944
|
+
path2.call(print11, "indexType"),
|
|
60945
60945
|
"]"
|
|
60946
60946
|
]);
|
|
60947
60947
|
case "UnionTypeAnnotation":
|
|
60948
|
-
return (0, lines_1.fromString)(" | ").join(path2.map(
|
|
60948
|
+
return (0, lines_1.fromString)(" | ").join(path2.map(print11, "types"));
|
|
60949
60949
|
case "VoidTypeAnnotation":
|
|
60950
60950
|
return (0, lines_1.fromString)("void", options);
|
|
60951
60951
|
case "NullTypeAnnotation":
|
|
@@ -60985,77 +60985,77 @@ var require_printer2 = __commonJS({
|
|
|
60985
60985
|
case "TSNeverKeyword":
|
|
60986
60986
|
return (0, lines_1.fromString)("never", options);
|
|
60987
60987
|
case "TSArrayType":
|
|
60988
|
-
return (0, lines_1.concat)([path2.call(
|
|
60988
|
+
return (0, lines_1.concat)([path2.call(print11, "elementType"), "[]"]);
|
|
60989
60989
|
case "TSLiteralType":
|
|
60990
|
-
return path2.call(
|
|
60990
|
+
return path2.call(print11, "literal");
|
|
60991
60991
|
case "TSUnionType":
|
|
60992
|
-
return (0, lines_1.fromString)(" | ").join(path2.map(
|
|
60992
|
+
return (0, lines_1.fromString)(" | ").join(path2.map(print11, "types"));
|
|
60993
60993
|
case "TSIntersectionType":
|
|
60994
|
-
return (0, lines_1.fromString)(" & ").join(path2.map(
|
|
60994
|
+
return (0, lines_1.fromString)(" & ").join(path2.map(print11, "types"));
|
|
60995
60995
|
case "TSConditionalType":
|
|
60996
|
-
parts.push(path2.call(
|
|
60996
|
+
parts.push(path2.call(print11, "checkType"), " extends ", path2.call(print11, "extendsType"), " ? ", path2.call(print11, "trueType"), " : ", path2.call(print11, "falseType"));
|
|
60997
60997
|
return (0, lines_1.concat)(parts);
|
|
60998
60998
|
case "TSInferType":
|
|
60999
|
-
parts.push("infer ", path2.call(
|
|
60999
|
+
parts.push("infer ", path2.call(print11, "typeParameter"));
|
|
61000
61000
|
return (0, lines_1.concat)(parts);
|
|
61001
61001
|
case "TSParenthesizedType":
|
|
61002
|
-
return (0, lines_1.concat)(["(", path2.call(
|
|
61002
|
+
return (0, lines_1.concat)(["(", path2.call(print11, "typeAnnotation"), ")"]);
|
|
61003
61003
|
case "TSFunctionType":
|
|
61004
61004
|
return (0, lines_1.concat)([
|
|
61005
|
-
path2.call(
|
|
61005
|
+
path2.call(print11, "typeParameters"),
|
|
61006
61006
|
"(",
|
|
61007
|
-
printFunctionParams(path2, options,
|
|
61007
|
+
printFunctionParams(path2, options, print11),
|
|
61008
61008
|
") => ",
|
|
61009
|
-
path2.call(
|
|
61009
|
+
path2.call(print11, "typeAnnotation", "typeAnnotation")
|
|
61010
61010
|
]);
|
|
61011
61011
|
case "TSConstructorType":
|
|
61012
61012
|
return (0, lines_1.concat)([
|
|
61013
61013
|
"new ",
|
|
61014
|
-
path2.call(
|
|
61014
|
+
path2.call(print11, "typeParameters"),
|
|
61015
61015
|
"(",
|
|
61016
|
-
printFunctionParams(path2, options,
|
|
61016
|
+
printFunctionParams(path2, options, print11),
|
|
61017
61017
|
") => ",
|
|
61018
|
-
path2.call(
|
|
61018
|
+
path2.call(print11, "typeAnnotation", "typeAnnotation")
|
|
61019
61019
|
]);
|
|
61020
61020
|
case "TSMappedType": {
|
|
61021
|
-
parts.push(n.readonly ? "readonly " : "", "[", path2.call(
|
|
61021
|
+
parts.push(n.readonly ? "readonly " : "", "[", path2.call(print11, "typeParameter"), "]", n.optional ? "?" : "");
|
|
61022
61022
|
if (n.typeAnnotation) {
|
|
61023
|
-
parts.push(": ", path2.call(
|
|
61023
|
+
parts.push(": ", path2.call(print11, "typeAnnotation"), ";");
|
|
61024
61024
|
}
|
|
61025
61025
|
return (0, lines_1.concat)(["{\n", (0, lines_1.concat)(parts).indent(options.tabWidth), "\n}"]);
|
|
61026
61026
|
}
|
|
61027
61027
|
case "TSTupleType":
|
|
61028
61028
|
return (0, lines_1.concat)([
|
|
61029
61029
|
"[",
|
|
61030
|
-
(0, lines_1.fromString)(", ").join(path2.map(
|
|
61030
|
+
(0, lines_1.fromString)(", ").join(path2.map(print11, "elementTypes")),
|
|
61031
61031
|
"]"
|
|
61032
61032
|
]);
|
|
61033
61033
|
case "TSNamedTupleMember":
|
|
61034
|
-
parts.push(path2.call(
|
|
61034
|
+
parts.push(path2.call(print11, "label"));
|
|
61035
61035
|
if (n.optional) {
|
|
61036
61036
|
parts.push("?");
|
|
61037
61037
|
}
|
|
61038
|
-
parts.push(": ", path2.call(
|
|
61038
|
+
parts.push(": ", path2.call(print11, "elementType"));
|
|
61039
61039
|
return (0, lines_1.concat)(parts);
|
|
61040
61040
|
case "TSRestType":
|
|
61041
|
-
return (0, lines_1.concat)(["...", path2.call(
|
|
61041
|
+
return (0, lines_1.concat)(["...", path2.call(print11, "typeAnnotation")]);
|
|
61042
61042
|
case "TSOptionalType":
|
|
61043
|
-
return (0, lines_1.concat)([path2.call(
|
|
61043
|
+
return (0, lines_1.concat)([path2.call(print11, "typeAnnotation"), "?"]);
|
|
61044
61044
|
case "TSIndexedAccessType":
|
|
61045
61045
|
return (0, lines_1.concat)([
|
|
61046
|
-
path2.call(
|
|
61046
|
+
path2.call(print11, "objectType"),
|
|
61047
61047
|
"[",
|
|
61048
|
-
path2.call(
|
|
61048
|
+
path2.call(print11, "indexType"),
|
|
61049
61049
|
"]"
|
|
61050
61050
|
]);
|
|
61051
61051
|
case "TSTypeOperator":
|
|
61052
61052
|
return (0, lines_1.concat)([
|
|
61053
|
-
path2.call(
|
|
61053
|
+
path2.call(print11, "operator"),
|
|
61054
61054
|
" ",
|
|
61055
|
-
path2.call(
|
|
61055
|
+
path2.call(print11, "typeAnnotation")
|
|
61056
61056
|
]);
|
|
61057
61057
|
case "TSTypeLiteral": {
|
|
61058
|
-
var members = (0, lines_1.fromString)("\n").join(path2.map(
|
|
61058
|
+
var members = (0, lines_1.fromString)("\n").join(path2.map(print11, "members").map(function(member) {
|
|
61059
61059
|
if (lastNonSpaceCharacter(member) !== ";") {
|
|
61060
61060
|
return member.concat(";");
|
|
61061
61061
|
}
|
|
@@ -61068,13 +61068,13 @@ var require_printer2 = __commonJS({
|
|
|
61068
61068
|
return (0, lines_1.concat)(parts);
|
|
61069
61069
|
}
|
|
61070
61070
|
case "TSEnumMember":
|
|
61071
|
-
parts.push(path2.call(
|
|
61071
|
+
parts.push(path2.call(print11, "id"));
|
|
61072
61072
|
if (n.initializer) {
|
|
61073
|
-
parts.push(" = ", path2.call(
|
|
61073
|
+
parts.push(" = ", path2.call(print11, "initializer"));
|
|
61074
61074
|
}
|
|
61075
61075
|
return (0, lines_1.concat)(parts);
|
|
61076
61076
|
case "TSTypeQuery":
|
|
61077
|
-
return (0, lines_1.concat)(["typeof ", path2.call(
|
|
61077
|
+
return (0, lines_1.concat)(["typeof ", path2.call(print11, "exprName")]);
|
|
61078
61078
|
case "TSParameterProperty":
|
|
61079
61079
|
if (n.accessibility) {
|
|
61080
61080
|
parts.push(n.accessibility, " ");
|
|
@@ -61088,119 +61088,119 @@ var require_printer2 = __commonJS({
|
|
|
61088
61088
|
if (n.readonly) {
|
|
61089
61089
|
parts.push("readonly ");
|
|
61090
61090
|
}
|
|
61091
|
-
parts.push(path2.call(
|
|
61091
|
+
parts.push(path2.call(print11, "parameter"));
|
|
61092
61092
|
return (0, lines_1.concat)(parts);
|
|
61093
61093
|
case "TSTypeReference":
|
|
61094
61094
|
return (0, lines_1.concat)([
|
|
61095
|
-
path2.call(
|
|
61096
|
-
path2.call(
|
|
61095
|
+
path2.call(print11, "typeName"),
|
|
61096
|
+
path2.call(print11, "typeParameters")
|
|
61097
61097
|
]);
|
|
61098
61098
|
case "TSQualifiedName":
|
|
61099
|
-
return (0, lines_1.concat)([path2.call(
|
|
61099
|
+
return (0, lines_1.concat)([path2.call(print11, "left"), ".", path2.call(print11, "right")]);
|
|
61100
61100
|
case "TSAsExpression":
|
|
61101
61101
|
case "TSSatisfiesExpression": {
|
|
61102
|
-
var expression = path2.call(
|
|
61103
|
-
parts.push(expression, n.type === "TSSatisfiesExpression" ? " satisfies " : " as ", path2.call(
|
|
61102
|
+
var expression = path2.call(print11, "expression");
|
|
61103
|
+
parts.push(expression, n.type === "TSSatisfiesExpression" ? " satisfies " : " as ", path2.call(print11, "typeAnnotation"));
|
|
61104
61104
|
return (0, lines_1.concat)(parts);
|
|
61105
61105
|
}
|
|
61106
61106
|
case "TSTypeCastExpression":
|
|
61107
61107
|
return (0, lines_1.concat)([
|
|
61108
|
-
path2.call(
|
|
61109
|
-
path2.call(
|
|
61108
|
+
path2.call(print11, "expression"),
|
|
61109
|
+
path2.call(print11, "typeAnnotation")
|
|
61110
61110
|
]);
|
|
61111
61111
|
case "TSNonNullExpression":
|
|
61112
|
-
return (0, lines_1.concat)([path2.call(
|
|
61112
|
+
return (0, lines_1.concat)([path2.call(print11, "expression"), "!"]);
|
|
61113
61113
|
case "TSTypeAnnotation":
|
|
61114
|
-
return (0, lines_1.concat)([": ", path2.call(
|
|
61114
|
+
return (0, lines_1.concat)([": ", path2.call(print11, "typeAnnotation")]);
|
|
61115
61115
|
case "TSIndexSignature":
|
|
61116
61116
|
return (0, lines_1.concat)([
|
|
61117
61117
|
n.readonly ? "readonly " : "",
|
|
61118
61118
|
"[",
|
|
61119
|
-
path2.map(
|
|
61119
|
+
path2.map(print11, "parameters"),
|
|
61120
61120
|
"]",
|
|
61121
|
-
path2.call(
|
|
61121
|
+
path2.call(print11, "typeAnnotation")
|
|
61122
61122
|
]);
|
|
61123
61123
|
case "TSPropertySignature":
|
|
61124
|
-
parts.push(printVariance(path2,
|
|
61124
|
+
parts.push(printVariance(path2, print11), n.readonly ? "readonly " : "");
|
|
61125
61125
|
if (n.computed) {
|
|
61126
|
-
parts.push("[", path2.call(
|
|
61126
|
+
parts.push("[", path2.call(print11, "key"), "]");
|
|
61127
61127
|
} else {
|
|
61128
|
-
parts.push(path2.call(
|
|
61128
|
+
parts.push(path2.call(print11, "key"));
|
|
61129
61129
|
}
|
|
61130
|
-
parts.push(n.optional ? "?" : "", path2.call(
|
|
61130
|
+
parts.push(n.optional ? "?" : "", path2.call(print11, "typeAnnotation"));
|
|
61131
61131
|
return (0, lines_1.concat)(parts);
|
|
61132
61132
|
case "TSMethodSignature":
|
|
61133
61133
|
if (n.computed) {
|
|
61134
|
-
parts.push("[", path2.call(
|
|
61134
|
+
parts.push("[", path2.call(print11, "key"), "]");
|
|
61135
61135
|
} else {
|
|
61136
|
-
parts.push(path2.call(
|
|
61136
|
+
parts.push(path2.call(print11, "key"));
|
|
61137
61137
|
}
|
|
61138
61138
|
if (n.optional) {
|
|
61139
61139
|
parts.push("?");
|
|
61140
61140
|
}
|
|
61141
|
-
parts.push(path2.call(
|
|
61141
|
+
parts.push(path2.call(print11, "typeParameters"), "(", printFunctionParams(path2, options, print11), ")", path2.call(print11, "typeAnnotation"));
|
|
61142
61142
|
return (0, lines_1.concat)(parts);
|
|
61143
61143
|
case "TSTypePredicate":
|
|
61144
61144
|
if (n.asserts) {
|
|
61145
61145
|
parts.push("asserts ");
|
|
61146
61146
|
}
|
|
61147
|
-
parts.push(path2.call(
|
|
61147
|
+
parts.push(path2.call(print11, "parameterName"));
|
|
61148
61148
|
if (n.typeAnnotation) {
|
|
61149
|
-
parts.push(" is ", path2.call(
|
|
61149
|
+
parts.push(" is ", path2.call(print11, "typeAnnotation", "typeAnnotation"));
|
|
61150
61150
|
}
|
|
61151
61151
|
return (0, lines_1.concat)(parts);
|
|
61152
61152
|
case "TSCallSignatureDeclaration":
|
|
61153
61153
|
return (0, lines_1.concat)([
|
|
61154
|
-
path2.call(
|
|
61154
|
+
path2.call(print11, "typeParameters"),
|
|
61155
61155
|
"(",
|
|
61156
|
-
printFunctionParams(path2, options,
|
|
61156
|
+
printFunctionParams(path2, options, print11),
|
|
61157
61157
|
")",
|
|
61158
|
-
path2.call(
|
|
61158
|
+
path2.call(print11, "typeAnnotation")
|
|
61159
61159
|
]);
|
|
61160
61160
|
case "TSConstructSignatureDeclaration":
|
|
61161
61161
|
if (n.typeParameters) {
|
|
61162
|
-
parts.push("new", path2.call(
|
|
61162
|
+
parts.push("new", path2.call(print11, "typeParameters"));
|
|
61163
61163
|
} else {
|
|
61164
61164
|
parts.push("new ");
|
|
61165
61165
|
}
|
|
61166
|
-
parts.push("(", printFunctionParams(path2, options,
|
|
61166
|
+
parts.push("(", printFunctionParams(path2, options, print11), ")", path2.call(print11, "typeAnnotation"));
|
|
61167
61167
|
return (0, lines_1.concat)(parts);
|
|
61168
61168
|
case "TSTypeAliasDeclaration":
|
|
61169
61169
|
return (0, lines_1.concat)([
|
|
61170
61170
|
n.declare ? "declare " : "",
|
|
61171
61171
|
"type ",
|
|
61172
|
-
path2.call(
|
|
61173
|
-
path2.call(
|
|
61172
|
+
path2.call(print11, "id"),
|
|
61173
|
+
path2.call(print11, "typeParameters"),
|
|
61174
61174
|
" = ",
|
|
61175
|
-
path2.call(
|
|
61175
|
+
path2.call(print11, "typeAnnotation"),
|
|
61176
61176
|
";"
|
|
61177
61177
|
]);
|
|
61178
61178
|
case "TSTypeParameter": {
|
|
61179
|
-
parts.push(path2.call(
|
|
61179
|
+
parts.push(path2.call(print11, "name"));
|
|
61180
61180
|
var parent = path2.getParentNode(0);
|
|
61181
61181
|
var isInMappedType = namedTypes.TSMappedType.check(parent);
|
|
61182
61182
|
if (n.constraint) {
|
|
61183
|
-
parts.push(isInMappedType ? " in " : " extends ", path2.call(
|
|
61183
|
+
parts.push(isInMappedType ? " in " : " extends ", path2.call(print11, "constraint"));
|
|
61184
61184
|
}
|
|
61185
61185
|
if (n["default"]) {
|
|
61186
|
-
parts.push(" = ", path2.call(
|
|
61186
|
+
parts.push(" = ", path2.call(print11, "default"));
|
|
61187
61187
|
}
|
|
61188
61188
|
return (0, lines_1.concat)(parts);
|
|
61189
61189
|
}
|
|
61190
61190
|
case "TSTypeAssertion": {
|
|
61191
|
-
parts.push("<", path2.call(
|
|
61191
|
+
parts.push("<", path2.call(print11, "typeAnnotation"), "> ", path2.call(print11, "expression"));
|
|
61192
61192
|
return (0, lines_1.concat)(parts);
|
|
61193
61193
|
}
|
|
61194
61194
|
case "TSTypeParameterDeclaration":
|
|
61195
61195
|
case "TSTypeParameterInstantiation":
|
|
61196
61196
|
return (0, lines_1.concat)([
|
|
61197
61197
|
"<",
|
|
61198
|
-
(0, lines_1.fromString)(", ").join(path2.map(
|
|
61198
|
+
(0, lines_1.fromString)(", ").join(path2.map(print11, "params")),
|
|
61199
61199
|
">"
|
|
61200
61200
|
]);
|
|
61201
61201
|
case "TSEnumDeclaration": {
|
|
61202
|
-
parts.push(n.declare ? "declare " : "", n.const ? "const " : "", "enum ", path2.call(
|
|
61203
|
-
var memberLines = (0, lines_1.fromString)(",\n").join(path2.map(
|
|
61202
|
+
parts.push(n.declare ? "declare " : "", n.const ? "const " : "", "enum ", path2.call(print11, "id"));
|
|
61203
|
+
var memberLines = (0, lines_1.fromString)(",\n").join(path2.map(print11, "members"));
|
|
61204
61204
|
if (memberLines.isEmpty()) {
|
|
61205
61205
|
parts.push(" {}");
|
|
61206
61206
|
} else {
|
|
@@ -61210,11 +61210,11 @@ var require_printer2 = __commonJS({
|
|
|
61210
61210
|
}
|
|
61211
61211
|
case "TSExpressionWithTypeArguments":
|
|
61212
61212
|
return (0, lines_1.concat)([
|
|
61213
|
-
path2.call(
|
|
61214
|
-
path2.call(
|
|
61213
|
+
path2.call(print11, "expression"),
|
|
61214
|
+
path2.call(print11, "typeParameters")
|
|
61215
61215
|
]);
|
|
61216
61216
|
case "TSInterfaceBody": {
|
|
61217
|
-
var lines = (0, lines_1.fromString)("\n").join(path2.map(
|
|
61217
|
+
var lines = (0, lines_1.fromString)("\n").join(path2.map(print11, "body").map(function(element) {
|
|
61218
61218
|
if (lastNonSpaceCharacter(element) !== ";") {
|
|
61219
61219
|
return element.concat(";");
|
|
61220
61220
|
}
|
|
@@ -61226,22 +61226,22 @@ var require_printer2 = __commonJS({
|
|
|
61226
61226
|
return (0, lines_1.concat)(["{\n", lines.indent(options.tabWidth), "\n}"]);
|
|
61227
61227
|
}
|
|
61228
61228
|
case "TSImportType":
|
|
61229
|
-
parts.push("import(", path2.call(
|
|
61229
|
+
parts.push("import(", path2.call(print11, "argument"), ")");
|
|
61230
61230
|
if (n.qualifier) {
|
|
61231
|
-
parts.push(".", path2.call(
|
|
61231
|
+
parts.push(".", path2.call(print11, "qualifier"));
|
|
61232
61232
|
}
|
|
61233
61233
|
if (n.typeParameters) {
|
|
61234
|
-
parts.push(path2.call(
|
|
61234
|
+
parts.push(path2.call(print11, "typeParameters"));
|
|
61235
61235
|
}
|
|
61236
61236
|
return (0, lines_1.concat)(parts);
|
|
61237
61237
|
case "TSImportEqualsDeclaration":
|
|
61238
61238
|
if (n.isExport) {
|
|
61239
61239
|
parts.push("export ");
|
|
61240
61240
|
}
|
|
61241
|
-
parts.push("import ", path2.call(
|
|
61241
|
+
parts.push("import ", path2.call(print11, "id"), " = ", path2.call(print11, "moduleReference"));
|
|
61242
61242
|
return maybeAddSemicolon((0, lines_1.concat)(parts));
|
|
61243
61243
|
case "TSExternalModuleReference":
|
|
61244
|
-
return (0, lines_1.concat)(["require(", path2.call(
|
|
61244
|
+
return (0, lines_1.concat)(["require(", path2.call(print11, "expression"), ")"]);
|
|
61245
61245
|
case "TSModuleDeclaration": {
|
|
61246
61246
|
var parent = path2.getParentNode();
|
|
61247
61247
|
if (parent.type === "TSModuleDeclaration") {
|
|
@@ -61266,16 +61266,16 @@ var require_printer2 = __commonJS({
|
|
|
61266
61266
|
}
|
|
61267
61267
|
}
|
|
61268
61268
|
}
|
|
61269
|
-
parts.push(path2.call(
|
|
61269
|
+
parts.push(path2.call(print11, "id"));
|
|
61270
61270
|
if (n.body) {
|
|
61271
61271
|
parts.push(" ");
|
|
61272
|
-
parts.push(path2.call(
|
|
61272
|
+
parts.push(path2.call(print11, "body"));
|
|
61273
61273
|
}
|
|
61274
61274
|
return (0, lines_1.concat)(parts);
|
|
61275
61275
|
}
|
|
61276
61276
|
case "TSModuleBlock": {
|
|
61277
61277
|
var naked = path2.call(function(bodyPath) {
|
|
61278
|
-
return printStatementSequence(bodyPath, options,
|
|
61278
|
+
return printStatementSequence(bodyPath, options, print11);
|
|
61279
61279
|
}, "body");
|
|
61280
61280
|
if (naked.isEmpty()) {
|
|
61281
61281
|
parts.push("{}");
|
|
@@ -61285,11 +61285,11 @@ var require_printer2 = __commonJS({
|
|
|
61285
61285
|
return (0, lines_1.concat)(parts);
|
|
61286
61286
|
}
|
|
61287
61287
|
case "TSInstantiationExpression": {
|
|
61288
|
-
parts.push(path2.call(
|
|
61288
|
+
parts.push(path2.call(print11, "expression"), path2.call(print11, "typeParameters"));
|
|
61289
61289
|
return (0, lines_1.concat)(parts);
|
|
61290
61290
|
}
|
|
61291
61291
|
case "V8IntrinsicIdentifier":
|
|
61292
|
-
return (0, lines_1.concat)(["%", path2.call(
|
|
61292
|
+
return (0, lines_1.concat)(["%", path2.call(print11, "name")]);
|
|
61293
61293
|
case "TopicReference":
|
|
61294
61294
|
return (0, lines_1.fromString)("#");
|
|
61295
61295
|
case "ClassHeritage":
|
|
@@ -61339,7 +61339,7 @@ var require_printer2 = __commonJS({
|
|
|
61339
61339
|
}
|
|
61340
61340
|
return (0, lines_1.concat)(parts);
|
|
61341
61341
|
}
|
|
61342
|
-
function printStatementSequence(path2, options,
|
|
61342
|
+
function printStatementSequence(path2, options, print11) {
|
|
61343
61343
|
var filtered = [];
|
|
61344
61344
|
var sawComment = false;
|
|
61345
61345
|
var sawStatement = false;
|
|
@@ -61360,7 +61360,7 @@ var require_printer2 = __commonJS({
|
|
|
61360
61360
|
}
|
|
61361
61361
|
filtered.push({
|
|
61362
61362
|
node: stmt,
|
|
61363
|
-
printed:
|
|
61363
|
+
printed: print11(stmtPath)
|
|
61364
61364
|
});
|
|
61365
61365
|
});
|
|
61366
61366
|
if (sawComment) {
|
|
@@ -61452,7 +61452,7 @@ var require_printer2 = __commonJS({
|
|
|
61452
61452
|
}
|
|
61453
61453
|
return parts;
|
|
61454
61454
|
}
|
|
61455
|
-
function printMethod(path2, options,
|
|
61455
|
+
function printMethod(path2, options, print11) {
|
|
61456
61456
|
var node = path2.getNode();
|
|
61457
61457
|
var kind = node.kind;
|
|
61458
61458
|
var parts = [];
|
|
@@ -61470,7 +61470,7 @@ var require_printer2 = __commonJS({
|
|
|
61470
61470
|
if (kind === "get" || kind === "set") {
|
|
61471
61471
|
parts.push(kind, " ");
|
|
61472
61472
|
}
|
|
61473
|
-
var key = path2.call(
|
|
61473
|
+
var key = path2.call(print11, "key");
|
|
61474
61474
|
if (node.computed) {
|
|
61475
61475
|
key = (0, lines_1.concat)(["[", key, "]"]);
|
|
61476
61476
|
}
|
|
@@ -61479,26 +61479,26 @@ var require_printer2 = __commonJS({
|
|
|
61479
61479
|
parts.push("?");
|
|
61480
61480
|
}
|
|
61481
61481
|
if (node === nodeValue) {
|
|
61482
|
-
parts.push(path2.call(
|
|
61482
|
+
parts.push(path2.call(print11, "typeParameters"), "(", printFunctionParams(path2, options, print11), ")", path2.call(print11, "returnType"));
|
|
61483
61483
|
if (node.body) {
|
|
61484
|
-
parts.push(" ", path2.call(
|
|
61484
|
+
parts.push(" ", path2.call(print11, "body"));
|
|
61485
61485
|
} else {
|
|
61486
61486
|
parts.push(";");
|
|
61487
61487
|
}
|
|
61488
61488
|
} else {
|
|
61489
|
-
parts.push(path2.call(
|
|
61490
|
-
return printFunctionParams(valuePath, options,
|
|
61491
|
-
}, "value"), ")", path2.call(
|
|
61489
|
+
parts.push(path2.call(print11, "value", "typeParameters"), "(", path2.call(function(valuePath) {
|
|
61490
|
+
return printFunctionParams(valuePath, options, print11);
|
|
61491
|
+
}, "value"), ")", path2.call(print11, "value", "returnType"));
|
|
61492
61492
|
if (nodeValue.body) {
|
|
61493
|
-
parts.push(" ", path2.call(
|
|
61493
|
+
parts.push(" ", path2.call(print11, "value", "body"));
|
|
61494
61494
|
} else {
|
|
61495
61495
|
parts.push(";");
|
|
61496
61496
|
}
|
|
61497
61497
|
}
|
|
61498
61498
|
return (0, lines_1.concat)(parts);
|
|
61499
61499
|
}
|
|
61500
|
-
function printArgumentsList(path2, options,
|
|
61501
|
-
var printed = path2.map(
|
|
61500
|
+
function printArgumentsList(path2, options, print11) {
|
|
61501
|
+
var printed = path2.map(print11, "arguments");
|
|
61502
61502
|
var trailingComma = util.isTrailingCommaEnabled(options, "parameters");
|
|
61503
61503
|
var joined = (0, lines_1.fromString)(", ").join(printed);
|
|
61504
61504
|
if (joined.getLineLength(1) > options.wrapColumn) {
|
|
@@ -61511,28 +61511,28 @@ var require_printer2 = __commonJS({
|
|
|
61511
61511
|
}
|
|
61512
61512
|
return (0, lines_1.concat)(["(", joined, ")"]);
|
|
61513
61513
|
}
|
|
61514
|
-
function printFunctionParams(path2, options,
|
|
61514
|
+
function printFunctionParams(path2, options, print11) {
|
|
61515
61515
|
var fun = path2.getValue();
|
|
61516
61516
|
var params;
|
|
61517
61517
|
var printed = [];
|
|
61518
61518
|
if (fun.params) {
|
|
61519
61519
|
params = fun.params;
|
|
61520
|
-
printed = path2.map(
|
|
61520
|
+
printed = path2.map(print11, "params");
|
|
61521
61521
|
} else if (fun.parameters) {
|
|
61522
61522
|
params = fun.parameters;
|
|
61523
|
-
printed = path2.map(
|
|
61523
|
+
printed = path2.map(print11, "parameters");
|
|
61524
61524
|
}
|
|
61525
61525
|
if (fun.defaults) {
|
|
61526
61526
|
path2.each(function(defExprPath) {
|
|
61527
61527
|
var i2 = defExprPath.getName();
|
|
61528
61528
|
var p = printed[i2];
|
|
61529
61529
|
if (p && defExprPath.getValue()) {
|
|
61530
|
-
printed[i2] = (0, lines_1.concat)([p, " = ",
|
|
61530
|
+
printed[i2] = (0, lines_1.concat)([p, " = ", print11(defExprPath)]);
|
|
61531
61531
|
}
|
|
61532
61532
|
}, "defaults");
|
|
61533
61533
|
}
|
|
61534
61534
|
if (fun.rest) {
|
|
61535
|
-
printed.push((0, lines_1.concat)(["...", path2.call(
|
|
61535
|
+
printed.push((0, lines_1.concat)(["...", path2.call(print11, "rest")]));
|
|
61536
61536
|
}
|
|
61537
61537
|
var joined = (0, lines_1.fromString)(", ").join(printed);
|
|
61538
61538
|
if (joined.length > 1 || joined.getLineLength(1) > options.wrapColumn) {
|
|
@@ -61546,11 +61546,11 @@ var require_printer2 = __commonJS({
|
|
|
61546
61546
|
}
|
|
61547
61547
|
return joined;
|
|
61548
61548
|
}
|
|
61549
|
-
function maybePrintImportAssertions(path2, options,
|
|
61549
|
+
function maybePrintImportAssertions(path2, options, print11) {
|
|
61550
61550
|
var n = path2.getValue();
|
|
61551
61551
|
if (n.assertions && n.assertions.length > 0) {
|
|
61552
61552
|
var parts = [" assert {"];
|
|
61553
|
-
var printed = path2.map(
|
|
61553
|
+
var printed = path2.map(print11, "assertions");
|
|
61554
61554
|
var flat = (0, lines_1.fromString)(", ").join(printed);
|
|
61555
61555
|
if (flat.length > 1 || flat.getLineLength(1) > options.wrapColumn) {
|
|
61556
61556
|
parts.push("\n", (0, lines_1.fromString)(",\n").join(printed).indent(options.tabWidth), "\n}");
|
|
@@ -61561,7 +61561,7 @@ var require_printer2 = __commonJS({
|
|
|
61561
61561
|
}
|
|
61562
61562
|
return (0, lines_1.fromString)("");
|
|
61563
61563
|
}
|
|
61564
|
-
function printExportDeclaration(path2, options,
|
|
61564
|
+
function printExportDeclaration(path2, options, print11) {
|
|
61565
61565
|
var decl = path2.getValue();
|
|
61566
61566
|
var parts = ["export "];
|
|
61567
61567
|
if (decl.exportKind && decl.exportKind === "type") {
|
|
@@ -61575,7 +61575,7 @@ var require_printer2 = __commonJS({
|
|
|
61575
61575
|
parts.push("default ");
|
|
61576
61576
|
}
|
|
61577
61577
|
if (decl.declaration) {
|
|
61578
|
-
parts.push(path2.call(
|
|
61578
|
+
parts.push(path2.call(print11, "declaration"));
|
|
61579
61579
|
} else if (decl.specifiers) {
|
|
61580
61580
|
if (decl.specifiers.length === 1 && decl.specifiers[0].type === "ExportBatchSpecifier") {
|
|
61581
61581
|
parts.push("*");
|
|
@@ -61587,9 +61587,9 @@ var require_printer2 = __commonJS({
|
|
|
61587
61587
|
path2.each(function(specifierPath) {
|
|
61588
61588
|
var spec = specifierPath.getValue();
|
|
61589
61589
|
if (spec.type === "ExportDefaultSpecifier") {
|
|
61590
|
-
unbracedSpecifiers_2.push(
|
|
61590
|
+
unbracedSpecifiers_2.push(print11(specifierPath));
|
|
61591
61591
|
} else {
|
|
61592
|
-
bracedSpecifiers_2.push(
|
|
61592
|
+
bracedSpecifiers_2.push(print11(specifierPath));
|
|
61593
61593
|
}
|
|
61594
61594
|
}, "specifiers");
|
|
61595
61595
|
unbracedSpecifiers_2.forEach(function(lines2, i2) {
|
|
@@ -61618,10 +61618,10 @@ var require_printer2 = __commonJS({
|
|
|
61618
61618
|
}
|
|
61619
61619
|
}
|
|
61620
61620
|
} else {
|
|
61621
|
-
parts.push(shouldPrintSpaces ? "{ " : "{", (0, lines_1.fromString)(", ").join(path2.map(
|
|
61621
|
+
parts.push(shouldPrintSpaces ? "{ " : "{", (0, lines_1.fromString)(", ").join(path2.map(print11, "specifiers")), shouldPrintSpaces ? " }" : "}");
|
|
61622
61622
|
}
|
|
61623
61623
|
if (decl.source) {
|
|
61624
|
-
parts.push(" from ", path2.call(
|
|
61624
|
+
parts.push(" from ", path2.call(print11, "source"), maybePrintImportAssertions(path2, options, print11));
|
|
61625
61625
|
}
|
|
61626
61626
|
}
|
|
61627
61627
|
var lines = (0, lines_1.concat)(parts);
|
|
@@ -61639,7 +61639,7 @@ var require_printer2 = __commonJS({
|
|
|
61639
61639
|
}
|
|
61640
61640
|
return (0, lines_1.concat)(parts);
|
|
61641
61641
|
}
|
|
61642
|
-
function printVariance(path2,
|
|
61642
|
+
function printVariance(path2, print11) {
|
|
61643
61643
|
return path2.call(function(variancePath) {
|
|
61644
61644
|
var value = variancePath.getValue();
|
|
61645
61645
|
if (value) {
|
|
@@ -61649,7 +61649,7 @@ var require_printer2 = __commonJS({
|
|
|
61649
61649
|
if (value === "minus") {
|
|
61650
61650
|
return (0, lines_1.fromString)("-");
|
|
61651
61651
|
}
|
|
61652
|
-
return
|
|
61652
|
+
return print11(variancePath);
|
|
61653
61653
|
}
|
|
61654
61654
|
return (0, lines_1.fromString)("");
|
|
61655
61655
|
}, "variance");
|
|
@@ -61736,10 +61736,10 @@ var require_main2 = __commonJS({
|
|
|
61736
61736
|
Object.defineProperty(exports, "visit", { enumerable: true, get: function() {
|
|
61737
61737
|
return ast_types_1.visit;
|
|
61738
61738
|
} });
|
|
61739
|
-
function
|
|
61739
|
+
function print11(node, options) {
|
|
61740
61740
|
return new printer_1.Printer(options).print(node);
|
|
61741
61741
|
}
|
|
61742
|
-
exports.print =
|
|
61742
|
+
exports.print = print11;
|
|
61743
61743
|
function prettyPrint3(node, options) {
|
|
61744
61744
|
return new printer_1.Printer(options).printGenerically(node);
|
|
61745
61745
|
}
|
|
@@ -61763,7 +61763,7 @@ var require_main2 = __commonJS({
|
|
|
61763
61763
|
function runString(code, transformer, options) {
|
|
61764
61764
|
var writeback = options && options.writeback || defaultWriteback;
|
|
61765
61765
|
transformer((0, parser_1.parse)(code, options), function(node) {
|
|
61766
|
-
writeback(
|
|
61766
|
+
writeback(print11(node, options).code);
|
|
61767
61767
|
});
|
|
61768
61768
|
}
|
|
61769
61769
|
}
|
|
@@ -65185,7 +65185,7 @@ function mergeSchemas(config4) {
|
|
|
65185
65185
|
// src/lib/config.ts
|
|
65186
65186
|
var graphql2 = __toESM(require_graphql2(), 1);
|
|
65187
65187
|
var import_minimatch = __toESM(require_minimatch(), 1);
|
|
65188
|
-
var
|
|
65188
|
+
var import_node_url2 = require("node:url");
|
|
65189
65189
|
|
|
65190
65190
|
// src/runtime/lib/config.ts
|
|
65191
65191
|
function defaultConfigValues(file) {
|
|
@@ -65288,10 +65288,10 @@ __export(fs_exports, {
|
|
|
65288
65288
|
writeFile: () => writeFile
|
|
65289
65289
|
});
|
|
65290
65290
|
var import_fs_extra = __toESM(require_lib(), 1);
|
|
65291
|
-
var import_promises = __toESM(require("fs/promises"), 1);
|
|
65292
65291
|
var import_glob = __toESM(require_glob(), 1);
|
|
65293
65292
|
var import_memfs = __toESM(require_lib2(), 1);
|
|
65294
|
-
var
|
|
65293
|
+
var import_promises = __toESM(require("node:fs/promises"), 1);
|
|
65294
|
+
var import_node_util = require("node:util");
|
|
65295
65295
|
|
|
65296
65296
|
// src/lib/path.ts
|
|
65297
65297
|
var path_exports = {};
|
|
@@ -65308,36 +65308,36 @@ __export(path_exports, {
|
|
|
65308
65308
|
resolve: () => resolve,
|
|
65309
65309
|
sep: () => sep
|
|
65310
65310
|
});
|
|
65311
|
-
var
|
|
65312
|
-
var
|
|
65311
|
+
var import_node_os = __toESM(require("node:os"), 1);
|
|
65312
|
+
var import_node_path = __toESM(require("node:path"), 1);
|
|
65313
65313
|
var sep = "/";
|
|
65314
65314
|
function resolve(...parts) {
|
|
65315
|
-
return posixify(
|
|
65315
|
+
return posixify(import_node_path.default.resolve(...parts));
|
|
65316
65316
|
}
|
|
65317
65317
|
function join2(...parts) {
|
|
65318
|
-
return posixify(
|
|
65318
|
+
return posixify(import_node_path.default.join(...parts));
|
|
65319
65319
|
}
|
|
65320
65320
|
function extname(target) {
|
|
65321
|
-
return
|
|
65321
|
+
return import_node_path.default.extname(target);
|
|
65322
65322
|
}
|
|
65323
65323
|
function relative(from, to) {
|
|
65324
|
-
return posixify(
|
|
65324
|
+
return posixify(import_node_path.default.relative(from, to));
|
|
65325
65325
|
}
|
|
65326
65326
|
function basename(target) {
|
|
65327
|
-
return
|
|
65327
|
+
return import_node_path.default.basename(target);
|
|
65328
65328
|
}
|
|
65329
65329
|
function dirname(target) {
|
|
65330
|
-
return
|
|
65330
|
+
return import_node_path.default.dirname(target);
|
|
65331
65331
|
}
|
|
65332
65332
|
function isAbsolute(target) {
|
|
65333
|
-
return
|
|
65333
|
+
return import_node_path.default.isAbsolute(target);
|
|
65334
65334
|
}
|
|
65335
65335
|
function parse2(target) {
|
|
65336
|
-
return
|
|
65336
|
+
return import_node_path.default.parse(target);
|
|
65337
65337
|
}
|
|
65338
65338
|
var posixify = (str) => str.replace(/\\/g, "/");
|
|
65339
65339
|
function importPath(target) {
|
|
65340
|
-
return ["win32", "win64"].includes(
|
|
65340
|
+
return ["win32", "win64"].includes(import_node_os.default.platform()) ? "file:///" + target : target;
|
|
65341
65341
|
}
|
|
65342
65342
|
|
|
65343
65343
|
// src/lib/fs.ts
|
|
@@ -65461,7 +65461,7 @@ async function rmdir(filepath) {
|
|
|
65461
65461
|
recursive: true
|
|
65462
65462
|
});
|
|
65463
65463
|
}
|
|
65464
|
-
return await (0,
|
|
65464
|
+
return await (0, import_node_util.promisify)(import_memfs.fs.rmdir)(filepath);
|
|
65465
65465
|
}
|
|
65466
65466
|
async function stat(filepath) {
|
|
65467
65467
|
if (!houdini_mode.is_testing) {
|
|
@@ -65539,7 +65539,7 @@ async function recursiveCopy(source, target, transforms, notRoot) {
|
|
|
65539
65539
|
}
|
|
65540
65540
|
}
|
|
65541
65541
|
async function glob(pattern) {
|
|
65542
|
-
return await (0,
|
|
65542
|
+
return await (0, import_node_util.promisify)(import_glob.glob)(posixify(pattern));
|
|
65543
65543
|
}
|
|
65544
65544
|
glob.hasMagic = import_glob.glob.hasMagic;
|
|
65545
65545
|
|
|
@@ -65594,7 +65594,7 @@ var dist_default = dataUriToBuffer;
|
|
|
65594
65594
|
|
|
65595
65595
|
// ../../node_modules/.pnpm/node-fetch@3.3.0/node_modules/node-fetch/src/body.js
|
|
65596
65596
|
var import_node_stream = __toESM(require("node:stream"), 1);
|
|
65597
|
-
var
|
|
65597
|
+
var import_node_util2 = require("node:util");
|
|
65598
65598
|
var import_node_buffer = require("node:buffer");
|
|
65599
65599
|
init_fetch_blob();
|
|
65600
65600
|
init_esm_min();
|
|
@@ -65648,7 +65648,7 @@ var isSameProtocol = (destination, original) => {
|
|
|
65648
65648
|
};
|
|
65649
65649
|
|
|
65650
65650
|
// ../../node_modules/.pnpm/node-fetch@3.3.0/node_modules/node-fetch/src/body.js
|
|
65651
|
-
var pipeline = (0,
|
|
65651
|
+
var pipeline = (0, import_node_util2.promisify)(import_node_stream.default.pipeline);
|
|
65652
65652
|
var INTERNALS = Symbol("Body internals");
|
|
65653
65653
|
var Body = class {
|
|
65654
65654
|
constructor(body, {
|
|
@@ -65661,7 +65661,7 @@ var Body = class {
|
|
|
65661
65661
|
body = import_node_buffer.Buffer.from(body.toString());
|
|
65662
65662
|
} else if (isBlob(body)) {
|
|
65663
65663
|
} else if (import_node_buffer.Buffer.isBuffer(body)) {
|
|
65664
|
-
} else if (
|
|
65664
|
+
} else if (import_node_util2.types.isAnyArrayBuffer(body)) {
|
|
65665
65665
|
body = import_node_buffer.Buffer.from(body);
|
|
65666
65666
|
} else if (ArrayBuffer.isView(body)) {
|
|
65667
65667
|
body = import_node_buffer.Buffer.from(body.buffer, body.byteOffset, body.byteLength);
|
|
@@ -65735,7 +65735,7 @@ var Body = class {
|
|
|
65735
65735
|
return consumeBody(this);
|
|
65736
65736
|
}
|
|
65737
65737
|
};
|
|
65738
|
-
Body.prototype.buffer = (0,
|
|
65738
|
+
Body.prototype.buffer = (0, import_node_util2.deprecate)(Body.prototype.buffer, "Please use 'response.arrayBuffer()' instead of 'response.buffer()'", "node-fetch#buffer");
|
|
65739
65739
|
Object.defineProperties(Body.prototype, {
|
|
65740
65740
|
body: { enumerable: true },
|
|
65741
65741
|
bodyUsed: { enumerable: true },
|
|
@@ -65743,7 +65743,7 @@ Object.defineProperties(Body.prototype, {
|
|
|
65743
65743
|
blob: { enumerable: true },
|
|
65744
65744
|
json: { enumerable: true },
|
|
65745
65745
|
text: { enumerable: true },
|
|
65746
|
-
data: { get: (0,
|
|
65746
|
+
data: { get: (0, import_node_util2.deprecate)(
|
|
65747
65747
|
() => {
|
|
65748
65748
|
},
|
|
65749
65749
|
"data doesn't exist, use json(), text(), arrayBuffer(), or body instead",
|
|
@@ -65811,7 +65811,7 @@ var clone = (instance, highWaterMark) => {
|
|
|
65811
65811
|
}
|
|
65812
65812
|
return body;
|
|
65813
65813
|
};
|
|
65814
|
-
var getNonSpecFormDataBoundary = (0,
|
|
65814
|
+
var getNonSpecFormDataBoundary = (0, import_node_util2.deprecate)(
|
|
65815
65815
|
(body) => body.getBoundary(),
|
|
65816
65816
|
"form-data doesn't follow the spec and requires special treatment. Use alternative package",
|
|
65817
65817
|
"https://github.com/node-fetch/node-fetch/issues/1167"
|
|
@@ -65829,7 +65829,7 @@ var extractContentType = (body, request) => {
|
|
|
65829
65829
|
if (isBlob(body)) {
|
|
65830
65830
|
return body.type || null;
|
|
65831
65831
|
}
|
|
65832
|
-
if (import_node_buffer.Buffer.isBuffer(body) ||
|
|
65832
|
+
if (import_node_buffer.Buffer.isBuffer(body) || import_node_util2.types.isAnyArrayBuffer(body) || ArrayBuffer.isView(body)) {
|
|
65833
65833
|
return null;
|
|
65834
65834
|
}
|
|
65835
65835
|
if (body instanceof FormData) {
|
|
@@ -65868,7 +65868,7 @@ var writeToStream = async (dest, { body }) => {
|
|
|
65868
65868
|
};
|
|
65869
65869
|
|
|
65870
65870
|
// ../../node_modules/.pnpm/node-fetch@3.3.0/node_modules/node-fetch/src/headers.js
|
|
65871
|
-
var
|
|
65871
|
+
var import_node_util3 = require("node:util");
|
|
65872
65872
|
var import_node_http = __toESM(require("node:http"), 1);
|
|
65873
65873
|
var validateHeaderName = typeof import_node_http.default.validateHeaderName === "function" ? import_node_http.default.validateHeaderName : (name) => {
|
|
65874
65874
|
if (!/^[\^`\-\w!#$%&'*+.|~]+$/.test(name)) {
|
|
@@ -65893,7 +65893,7 @@ var Headers = class extends URLSearchParams {
|
|
|
65893
65893
|
result.push(...values.map((value) => [name, value]));
|
|
65894
65894
|
}
|
|
65895
65895
|
} else if (init == null) {
|
|
65896
|
-
} else if (typeof init === "object" && !
|
|
65896
|
+
} else if (typeof init === "object" && !import_node_util3.types.isBoxedPrimitive(init)) {
|
|
65897
65897
|
const method = init[Symbol.iterator];
|
|
65898
65898
|
if (method == null) {
|
|
65899
65899
|
result.push(...Object.entries(init));
|
|
@@ -65902,7 +65902,7 @@ var Headers = class extends URLSearchParams {
|
|
|
65902
65902
|
throw new TypeError("Header pairs must be iterable");
|
|
65903
65903
|
}
|
|
65904
65904
|
result = [...init].map((pair) => {
|
|
65905
|
-
if (typeof pair !== "object" ||
|
|
65905
|
+
if (typeof pair !== "object" || import_node_util3.types.isBoxedPrimitive(pair)) {
|
|
65906
65906
|
throw new TypeError("Each header pair must be an iterable object");
|
|
65907
65907
|
}
|
|
65908
65908
|
return [...pair];
|
|
@@ -66149,7 +66149,7 @@ Object.defineProperties(Response.prototype, {
|
|
|
66149
66149
|
|
|
66150
66150
|
// ../../node_modules/.pnpm/node-fetch@3.3.0/node_modules/node-fetch/src/request.js
|
|
66151
66151
|
var import_node_url = require("node:url");
|
|
66152
|
-
var
|
|
66152
|
+
var import_node_util4 = require("node:util");
|
|
66153
66153
|
|
|
66154
66154
|
// ../../node_modules/.pnpm/node-fetch@3.3.0/node_modules/node-fetch/src/utils/get-search.js
|
|
66155
66155
|
var getSearch = (parsedURL) => {
|
|
@@ -66306,7 +66306,7 @@ var INTERNALS3 = Symbol("Request internals");
|
|
|
66306
66306
|
var isRequest = (object) => {
|
|
66307
66307
|
return typeof object === "object" && typeof object[INTERNALS3] === "object";
|
|
66308
66308
|
};
|
|
66309
|
-
var doBadDataWarn = (0,
|
|
66309
|
+
var doBadDataWarn = (0, import_node_util4.deprecate)(
|
|
66310
66310
|
() => {
|
|
66311
66311
|
},
|
|
66312
66312
|
".data is not a valid RequestInit property, use .body instead",
|
|
@@ -66810,7 +66810,7 @@ var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
|
|
|
66810
66810
|
|
|
66811
66811
|
// src/lib/config.ts
|
|
66812
66812
|
var import_meta = {};
|
|
66813
|
-
var currentDir = global.__dirname || dirname((0,
|
|
66813
|
+
var currentDir = global.__dirname || dirname((0, import_node_url2.fileURLToPath)(import_meta.url));
|
|
66814
66814
|
var Config = class {
|
|
66815
66815
|
filepath;
|
|
66816
66816
|
rootDir;
|
|
@@ -67301,13 +67301,16 @@ var pendingConfigPromise = null;
|
|
|
67301
67301
|
async function getConfig({
|
|
67302
67302
|
configPath = DEFAULT_CONFIG_PATH,
|
|
67303
67303
|
noSchema,
|
|
67304
|
+
forceReload,
|
|
67304
67305
|
...extraConfig
|
|
67305
67306
|
} = {}) {
|
|
67306
|
-
if (
|
|
67307
|
-
|
|
67308
|
-
|
|
67309
|
-
|
|
67310
|
-
|
|
67307
|
+
if (!forceReload) {
|
|
67308
|
+
if (_config) {
|
|
67309
|
+
return _config;
|
|
67310
|
+
}
|
|
67311
|
+
if (pendingConfigPromise) {
|
|
67312
|
+
return await pendingConfigPromise;
|
|
67313
|
+
}
|
|
67311
67314
|
}
|
|
67312
67315
|
let resolve2 = () => {
|
|
67313
67316
|
};
|
|
@@ -67325,7 +67328,7 @@ async function getConfig({
|
|
|
67325
67328
|
if (!pluginName.startsWith(".")) {
|
|
67326
67329
|
pluginFile = await pluginPath(pluginName, configPath);
|
|
67327
67330
|
}
|
|
67328
|
-
const { default: pluginInit } = await import((0,
|
|
67331
|
+
const { default: pluginInit } = await import((0, import_node_url2.pathToFileURL)(pluginFile).toString());
|
|
67329
67332
|
if (!pluginInit.plugin || !pluginInit.name) {
|
|
67330
67333
|
throw new HoudiniError({
|
|
67331
67334
|
filepath: pluginFile,
|
|
@@ -67502,8 +67505,8 @@ async function loadSchemaFile(schemaPath) {
|
|
|
67502
67505
|
}
|
|
67503
67506
|
|
|
67504
67507
|
// src/lib/graphql.ts
|
|
67505
|
-
var import_crypto = __toESM(require("crypto"), 1);
|
|
67506
67508
|
var graphql3 = __toESM(require_graphql2(), 1);
|
|
67509
|
+
var import_node_crypto = __toESM(require("node:crypto"), 1);
|
|
67507
67510
|
function getRootType(type) {
|
|
67508
67511
|
if (graphql3.isNonNullType(type)) {
|
|
67509
67512
|
return getRootType(type.ofType);
|
|
@@ -67516,8 +67519,8 @@ function getRootType(type) {
|
|
|
67516
67519
|
function hashDocument({
|
|
67517
67520
|
document
|
|
67518
67521
|
}) {
|
|
67519
|
-
const docString = typeof document === "string" ? document :
|
|
67520
|
-
return
|
|
67522
|
+
const docString = typeof document === "string" ? document : document.artifact?.raw;
|
|
67523
|
+
return import_node_crypto.default.createHash("sha256").update(docString ?? "").digest("hex");
|
|
67521
67524
|
}
|
|
67522
67525
|
function parentTypeFromAncestors(schema, filepath, ancestors) {
|
|
67523
67526
|
const parents = [...ancestors];
|
|
@@ -73175,9 +73178,10 @@ function vite_default(opts) {
|
|
|
73175
73178
|
name: "Houdini",
|
|
73176
73179
|
quiet: true,
|
|
73177
73180
|
async watchFile(filepath) {
|
|
73178
|
-
|
|
73181
|
+
let config4 = await getConfig(opts);
|
|
73179
73182
|
const schemaPath = path_exports.join(path_exports.dirname(config4.filepath), config4.schemaPath);
|
|
73180
73183
|
if ((0, import_minimatch2.default)(filepath, schemaPath)) {
|
|
73184
|
+
config4 = await getConfig({ ...opts, forceReload: true });
|
|
73181
73185
|
return true;
|
|
73182
73186
|
}
|
|
73183
73187
|
return config4.includeFile(filepath, { root: process.cwd() });
|