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/cmd-cjs/index.js
CHANGED
|
@@ -4819,10 +4819,10 @@ var require_printer = __commonJS({
|
|
|
4819
4819
|
Object.defineProperty(exports, "__esModule", {
|
|
4820
4820
|
value: true
|
|
4821
4821
|
});
|
|
4822
|
-
exports.print =
|
|
4822
|
+
exports.print = print11;
|
|
4823
4823
|
var _visitor = require_visitor();
|
|
4824
4824
|
var _blockString = require_blockString();
|
|
4825
|
-
function
|
|
4825
|
+
function print11(ast) {
|
|
4826
4826
|
return (0, _visitor.visit)(ast, {
|
|
4827
4827
|
leave: printDocASTReducer2
|
|
4828
4828
|
});
|
|
@@ -56924,12 +56924,12 @@ var require_comments = __commonJS({
|
|
|
56924
56924
|
comment.trailing = true;
|
|
56925
56925
|
addCommentHelper(node, comment);
|
|
56926
56926
|
}
|
|
56927
|
-
function printLeadingComment(commentPath,
|
|
56927
|
+
function printLeadingComment(commentPath, print11) {
|
|
56928
56928
|
var comment = commentPath.getValue();
|
|
56929
56929
|
n.Comment.assert(comment);
|
|
56930
56930
|
var loc = comment.loc;
|
|
56931
56931
|
var lines = loc && loc.lines;
|
|
56932
|
-
var parts = [
|
|
56932
|
+
var parts = [print11(commentPath)];
|
|
56933
56933
|
if (comment.trailing) {
|
|
56934
56934
|
parts.push("\n");
|
|
56935
56935
|
} else if (lines instanceof lines_1.Lines) {
|
|
@@ -56944,7 +56944,7 @@ var require_comments = __commonJS({
|
|
|
56944
56944
|
}
|
|
56945
56945
|
return (0, lines_1.concat)(parts);
|
|
56946
56946
|
}
|
|
56947
|
-
function printTrailingComment(commentPath,
|
|
56947
|
+
function printTrailingComment(commentPath, print11) {
|
|
56948
56948
|
var comment = commentPath.getValue(commentPath);
|
|
56949
56949
|
n.Comment.assert(comment);
|
|
56950
56950
|
var loc = comment.loc;
|
|
@@ -56959,12 +56959,12 @@ var require_comments = __commonJS({
|
|
|
56959
56959
|
parts.push(new Array(leadingSpace.length).join("\n"));
|
|
56960
56960
|
}
|
|
56961
56961
|
}
|
|
56962
|
-
parts.push(
|
|
56962
|
+
parts.push(print11(commentPath));
|
|
56963
56963
|
return (0, lines_1.concat)(parts);
|
|
56964
56964
|
}
|
|
56965
|
-
function printComments(path2,
|
|
56965
|
+
function printComments(path2, print11) {
|
|
56966
56966
|
var value = path2.getValue();
|
|
56967
|
-
var innerLines =
|
|
56967
|
+
var innerLines = print11(path2);
|
|
56968
56968
|
var comments = n.Node.check(value) && types16.getFieldValue(value, "comments");
|
|
56969
56969
|
if (!comments || comments.length === 0) {
|
|
56970
56970
|
return innerLines;
|
|
@@ -56976,9 +56976,9 @@ var require_comments = __commonJS({
|
|
|
56976
56976
|
var leading = types16.getFieldValue(comment, "leading");
|
|
56977
56977
|
var trailing = types16.getFieldValue(comment, "trailing");
|
|
56978
56978
|
if (leading || trailing && !(n.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
56979
|
-
leadingParts.push(printLeadingComment(commentPath,
|
|
56979
|
+
leadingParts.push(printLeadingComment(commentPath, print11));
|
|
56980
56980
|
} else if (trailing) {
|
|
56981
|
-
trailingParts.push(printTrailingComment(commentPath,
|
|
56981
|
+
trailingParts.push(printTrailingComment(commentPath, print11));
|
|
56982
56982
|
}
|
|
56983
56983
|
}, "comments");
|
|
56984
56984
|
leadingParts.push.apply(leadingParts, trailingParts);
|
|
@@ -57669,7 +57669,7 @@ var require_patcher = __commonJS({
|
|
|
57669
57669
|
};
|
|
57670
57670
|
exports.Patcher = Patcher;
|
|
57671
57671
|
var Pp = Patcher.prototype;
|
|
57672
|
-
Pp.tryToReprintComments = function(newNode, oldNode,
|
|
57672
|
+
Pp.tryToReprintComments = function(newNode, oldNode, print11) {
|
|
57673
57673
|
var patcher = this;
|
|
57674
57674
|
if (!newNode.comments && !oldNode.comments) {
|
|
57675
57675
|
return true;
|
|
@@ -57686,7 +57686,7 @@ var require_patcher = __commonJS({
|
|
|
57686
57686
|
assert_1.default.ok(oldComment.leading || oldComment.trailing);
|
|
57687
57687
|
patcher.replace(
|
|
57688
57688
|
oldComment.loc,
|
|
57689
|
-
|
|
57689
|
+
print11(reprint.newPath).indentTail(oldComment.loc.indent)
|
|
57690
57690
|
);
|
|
57691
57691
|
});
|
|
57692
57692
|
}
|
|
@@ -57733,17 +57733,17 @@ var require_patcher = __commonJS({
|
|
|
57733
57733
|
var reprints = [];
|
|
57734
57734
|
if (!lines || !findReprints(path2, reprints))
|
|
57735
57735
|
return;
|
|
57736
|
-
return function(
|
|
57736
|
+
return function(print11) {
|
|
57737
57737
|
var patcher = new Patcher(lines);
|
|
57738
57738
|
reprints.forEach(function(reprint) {
|
|
57739
57739
|
var newNode = reprint.newPath.getValue();
|
|
57740
57740
|
var oldNode = reprint.oldPath.getValue();
|
|
57741
57741
|
SourceLocation.assert(oldNode.loc, true);
|
|
57742
|
-
var needToPrintNewPathWithComments = !patcher.tryToReprintComments(newNode, oldNode,
|
|
57742
|
+
var needToPrintNewPathWithComments = !patcher.tryToReprintComments(newNode, oldNode, print11);
|
|
57743
57743
|
if (needToPrintNewPathWithComments) {
|
|
57744
57744
|
patcher.deleteComments(oldNode);
|
|
57745
57745
|
}
|
|
57746
|
-
var newLines =
|
|
57746
|
+
var newLines = print11(reprint.newPath, {
|
|
57747
57747
|
includeComments: needToPrintNewPathWithComments,
|
|
57748
57748
|
avoidRootParens: oldNode.type === newNode.type && reprint.oldPath.hasParens()
|
|
57749
57749
|
}).indentTail(oldNode.loc.indent);
|
|
@@ -57960,10 +57960,10 @@ var require_printer2 = __commonJS({
|
|
|
57960
57960
|
function makePrintFunctionWith(options, overrides) {
|
|
57961
57961
|
options = Object.assign({}, options, overrides);
|
|
57962
57962
|
return function(path2) {
|
|
57963
|
-
return
|
|
57963
|
+
return print11(path2, options);
|
|
57964
57964
|
};
|
|
57965
57965
|
}
|
|
57966
|
-
function
|
|
57966
|
+
function print11(path2, options) {
|
|
57967
57967
|
assert_1.default.ok(path2 instanceof fast_path_1.default);
|
|
57968
57968
|
options = options || {};
|
|
57969
57969
|
if (options.includeComments) {
|
|
@@ -57979,7 +57979,7 @@ var require_printer2 = __commonJS({
|
|
|
57979
57979
|
}
|
|
57980
57980
|
}
|
|
57981
57981
|
var reprinter = (0, patcher_1.getReprinter)(path2);
|
|
57982
|
-
var lines = reprinter ? reprinter(
|
|
57982
|
+
var lines = reprinter ? reprinter(print11) : genericPrint(path2, config2, options, makePrintFunctionWith(options, {
|
|
57983
57983
|
includeComments: true,
|
|
57984
57984
|
avoidRootParens: false
|
|
57985
57985
|
}));
|
|
@@ -57990,7 +57990,7 @@ var require_printer2 = __commonJS({
|
|
|
57990
57990
|
if (!ast) {
|
|
57991
57991
|
return emptyPrintResult;
|
|
57992
57992
|
}
|
|
57993
|
-
var lines =
|
|
57993
|
+
var lines = print11(fast_path_1.default.from(ast), {
|
|
57994
57994
|
includeComments: true,
|
|
57995
57995
|
avoidRootParens: false
|
|
57996
57996
|
});
|
|
@@ -58043,7 +58043,7 @@ var require_printer2 = __commonJS({
|
|
|
58043
58043
|
}
|
|
58044
58044
|
return (0, lines_1.concat)(parts);
|
|
58045
58045
|
}
|
|
58046
|
-
function genericPrintNoParens(path2, options,
|
|
58046
|
+
function genericPrintNoParens(path2, options, print11) {
|
|
58047
58047
|
var n = path2.getValue();
|
|
58048
58048
|
if (!n) {
|
|
58049
58049
|
return (0, lines_1.fromString)("");
|
|
@@ -58055,45 +58055,45 @@ var require_printer2 = __commonJS({
|
|
|
58055
58055
|
var parts = [];
|
|
58056
58056
|
switch (n.type) {
|
|
58057
58057
|
case "File":
|
|
58058
|
-
return path2.call(
|
|
58058
|
+
return path2.call(print11, "program");
|
|
58059
58059
|
case "Program":
|
|
58060
58060
|
if (n.directives) {
|
|
58061
58061
|
path2.each(function(childPath) {
|
|
58062
|
-
parts.push(
|
|
58062
|
+
parts.push(print11(childPath), ";\n");
|
|
58063
58063
|
}, "directives");
|
|
58064
58064
|
}
|
|
58065
58065
|
if (n.interpreter) {
|
|
58066
|
-
parts.push(path2.call(
|
|
58066
|
+
parts.push(path2.call(print11, "interpreter"));
|
|
58067
58067
|
}
|
|
58068
58068
|
parts.push(path2.call(function(bodyPath) {
|
|
58069
|
-
return printStatementSequence(bodyPath, options,
|
|
58069
|
+
return printStatementSequence(bodyPath, options, print11);
|
|
58070
58070
|
}, "body"));
|
|
58071
58071
|
return (0, lines_1.concat)(parts);
|
|
58072
58072
|
case "Noop":
|
|
58073
58073
|
case "EmptyStatement":
|
|
58074
58074
|
return (0, lines_1.fromString)("");
|
|
58075
58075
|
case "ExpressionStatement":
|
|
58076
|
-
return (0, lines_1.concat)([path2.call(
|
|
58076
|
+
return (0, lines_1.concat)([path2.call(print11, "expression"), ";"]);
|
|
58077
58077
|
case "ParenthesizedExpression":
|
|
58078
|
-
return (0, lines_1.concat)(["(", path2.call(
|
|
58078
|
+
return (0, lines_1.concat)(["(", path2.call(print11, "expression"), ")"]);
|
|
58079
58079
|
case "BinaryExpression":
|
|
58080
58080
|
case "LogicalExpression":
|
|
58081
58081
|
case "AssignmentExpression":
|
|
58082
58082
|
return (0, lines_1.fromString)(" ").join([
|
|
58083
|
-
path2.call(
|
|
58083
|
+
path2.call(print11, "left"),
|
|
58084
58084
|
n.operator,
|
|
58085
|
-
path2.call(
|
|
58085
|
+
path2.call(print11, "right")
|
|
58086
58086
|
]);
|
|
58087
58087
|
case "AssignmentPattern":
|
|
58088
58088
|
return (0, lines_1.concat)([
|
|
58089
|
-
path2.call(
|
|
58089
|
+
path2.call(print11, "left"),
|
|
58090
58090
|
" = ",
|
|
58091
|
-
path2.call(
|
|
58091
|
+
path2.call(print11, "right")
|
|
58092
58092
|
]);
|
|
58093
58093
|
case "MemberExpression":
|
|
58094
58094
|
case "OptionalMemberExpression": {
|
|
58095
|
-
parts.push(path2.call(
|
|
58096
|
-
var property = path2.call(
|
|
58095
|
+
parts.push(path2.call(print11, "object"));
|
|
58096
|
+
var property = path2.call(print11, "property");
|
|
58097
58097
|
var optional = types16.getFieldValue(n, "optional");
|
|
58098
58098
|
if (n.computed) {
|
|
58099
58099
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
@@ -58103,18 +58103,18 @@ var require_printer2 = __commonJS({
|
|
|
58103
58103
|
return (0, lines_1.concat)(parts);
|
|
58104
58104
|
}
|
|
58105
58105
|
case "ChainExpression":
|
|
58106
|
-
return path2.call(
|
|
58106
|
+
return path2.call(print11, "expression");
|
|
58107
58107
|
case "MetaProperty":
|
|
58108
58108
|
return (0, lines_1.concat)([
|
|
58109
|
-
path2.call(
|
|
58109
|
+
path2.call(print11, "meta"),
|
|
58110
58110
|
".",
|
|
58111
|
-
path2.call(
|
|
58111
|
+
path2.call(print11, "property")
|
|
58112
58112
|
]);
|
|
58113
58113
|
case "BindExpression":
|
|
58114
58114
|
if (n.object) {
|
|
58115
|
-
parts.push(path2.call(
|
|
58115
|
+
parts.push(path2.call(print11, "object"));
|
|
58116
58116
|
}
|
|
58117
|
-
parts.push("::", path2.call(
|
|
58117
|
+
parts.push("::", path2.call(print11, "callee"));
|
|
58118
58118
|
return (0, lines_1.concat)(parts);
|
|
58119
58119
|
case "Path":
|
|
58120
58120
|
return (0, lines_1.fromString)(".").join(n.body);
|
|
@@ -58122,7 +58122,7 @@ var require_printer2 = __commonJS({
|
|
|
58122
58122
|
return (0, lines_1.concat)([
|
|
58123
58123
|
(0, lines_1.fromString)(n.name, options),
|
|
58124
58124
|
n.optional ? "?" : "",
|
|
58125
|
-
path2.call(
|
|
58125
|
+
path2.call(print11, "typeAnnotation")
|
|
58126
58126
|
]);
|
|
58127
58127
|
case "SpreadElement":
|
|
58128
58128
|
case "SpreadElementPattern":
|
|
@@ -58133,8 +58133,8 @@ var require_printer2 = __commonJS({
|
|
|
58133
58133
|
case "RestElement":
|
|
58134
58134
|
return (0, lines_1.concat)([
|
|
58135
58135
|
"...",
|
|
58136
|
-
path2.call(
|
|
58137
|
-
path2.call(
|
|
58136
|
+
path2.call(print11, "argument"),
|
|
58137
|
+
path2.call(print11, "typeAnnotation")
|
|
58138
58138
|
]);
|
|
58139
58139
|
case "FunctionDeclaration":
|
|
58140
58140
|
case "FunctionExpression":
|
|
@@ -58149,15 +58149,15 @@ var require_printer2 = __commonJS({
|
|
|
58149
58149
|
if (n.generator)
|
|
58150
58150
|
parts.push("*");
|
|
58151
58151
|
if (n.id) {
|
|
58152
|
-
parts.push(" ", path2.call(
|
|
58152
|
+
parts.push(" ", path2.call(print11, "id"), path2.call(print11, "typeParameters"));
|
|
58153
58153
|
} else {
|
|
58154
58154
|
if (n.typeParameters) {
|
|
58155
|
-
parts.push(path2.call(
|
|
58155
|
+
parts.push(path2.call(print11, "typeParameters"));
|
|
58156
58156
|
}
|
|
58157
58157
|
}
|
|
58158
|
-
parts.push("(", printFunctionParams(path2, options,
|
|
58158
|
+
parts.push("(", printFunctionParams(path2, options, print11), ")", path2.call(print11, "returnType"));
|
|
58159
58159
|
if (n.body) {
|
|
58160
|
-
parts.push(" ", path2.call(
|
|
58160
|
+
parts.push(" ", path2.call(print11, "body"));
|
|
58161
58161
|
}
|
|
58162
58162
|
return (0, lines_1.concat)(parts);
|
|
58163
58163
|
case "ArrowFunctionExpression":
|
|
@@ -58165,44 +58165,44 @@ var require_printer2 = __commonJS({
|
|
|
58165
58165
|
parts.push("async ");
|
|
58166
58166
|
}
|
|
58167
58167
|
if (n.typeParameters) {
|
|
58168
|
-
parts.push(path2.call(
|
|
58168
|
+
parts.push(path2.call(print11, "typeParameters"));
|
|
58169
58169
|
}
|
|
58170
58170
|
if (!options.arrowParensAlways && n.params.length === 1 && !n.rest && n.params[0].type === "Identifier" && !n.params[0].typeAnnotation && !n.returnType) {
|
|
58171
|
-
parts.push(path2.call(
|
|
58171
|
+
parts.push(path2.call(print11, "params", 0));
|
|
58172
58172
|
} else {
|
|
58173
|
-
parts.push("(", printFunctionParams(path2, options,
|
|
58173
|
+
parts.push("(", printFunctionParams(path2, options, print11), ")", path2.call(print11, "returnType"));
|
|
58174
58174
|
}
|
|
58175
|
-
parts.push(" => ", path2.call(
|
|
58175
|
+
parts.push(" => ", path2.call(print11, "body"));
|
|
58176
58176
|
return (0, lines_1.concat)(parts);
|
|
58177
58177
|
case "MethodDefinition":
|
|
58178
|
-
return printMethod(path2, options,
|
|
58178
|
+
return printMethod(path2, options, print11);
|
|
58179
58179
|
case "YieldExpression":
|
|
58180
58180
|
parts.push("yield");
|
|
58181
58181
|
if (n.delegate)
|
|
58182
58182
|
parts.push("*");
|
|
58183
58183
|
if (n.argument)
|
|
58184
|
-
parts.push(" ", path2.call(
|
|
58184
|
+
parts.push(" ", path2.call(print11, "argument"));
|
|
58185
58185
|
return (0, lines_1.concat)(parts);
|
|
58186
58186
|
case "AwaitExpression":
|
|
58187
58187
|
parts.push("await");
|
|
58188
58188
|
if (n.all)
|
|
58189
58189
|
parts.push("*");
|
|
58190
58190
|
if (n.argument)
|
|
58191
|
-
parts.push(" ", path2.call(
|
|
58191
|
+
parts.push(" ", path2.call(print11, "argument"));
|
|
58192
58192
|
return (0, lines_1.concat)(parts);
|
|
58193
58193
|
case "ModuleExpression":
|
|
58194
58194
|
return (0, lines_1.concat)([
|
|
58195
58195
|
"module {\n",
|
|
58196
|
-
path2.call(
|
|
58196
|
+
path2.call(print11, "body").indent(options.tabWidth),
|
|
58197
58197
|
"\n}"
|
|
58198
58198
|
]);
|
|
58199
58199
|
case "ModuleDeclaration":
|
|
58200
|
-
parts.push("module", path2.call(
|
|
58200
|
+
parts.push("module", path2.call(print11, "id"));
|
|
58201
58201
|
if (n.source) {
|
|
58202
58202
|
assert_1.default.ok(!n.body);
|
|
58203
|
-
parts.push("from", path2.call(
|
|
58203
|
+
parts.push("from", path2.call(print11, "source"));
|
|
58204
58204
|
} else {
|
|
58205
|
-
parts.push(path2.call(
|
|
58205
|
+
parts.push(path2.call(print11, "body"));
|
|
58206
58206
|
}
|
|
58207
58207
|
return (0, lines_1.fromString)(" ").join(parts);
|
|
58208
58208
|
case "ImportSpecifier":
|
|
@@ -58210,27 +58210,27 @@ var require_printer2 = __commonJS({
|
|
|
58210
58210
|
parts.push(n.importKind + " ");
|
|
58211
58211
|
}
|
|
58212
58212
|
if (n.imported) {
|
|
58213
|
-
parts.push(path2.call(
|
|
58213
|
+
parts.push(path2.call(print11, "imported"));
|
|
58214
58214
|
if (n.local && n.local.name !== n.imported.name) {
|
|
58215
|
-
parts.push(" as ", path2.call(
|
|
58215
|
+
parts.push(" as ", path2.call(print11, "local"));
|
|
58216
58216
|
}
|
|
58217
58217
|
} else if (n.id) {
|
|
58218
|
-
parts.push(path2.call(
|
|
58218
|
+
parts.push(path2.call(print11, "id"));
|
|
58219
58219
|
if (n.name) {
|
|
58220
|
-
parts.push(" as ", path2.call(
|
|
58220
|
+
parts.push(" as ", path2.call(print11, "name"));
|
|
58221
58221
|
}
|
|
58222
58222
|
}
|
|
58223
58223
|
return (0, lines_1.concat)(parts);
|
|
58224
58224
|
case "ExportSpecifier":
|
|
58225
58225
|
if (n.local) {
|
|
58226
|
-
parts.push(path2.call(
|
|
58226
|
+
parts.push(path2.call(print11, "local"));
|
|
58227
58227
|
if (n.exported && n.exported.name !== n.local.name) {
|
|
58228
|
-
parts.push(" as ", path2.call(
|
|
58228
|
+
parts.push(" as ", path2.call(print11, "exported"));
|
|
58229
58229
|
}
|
|
58230
58230
|
} else if (n.id) {
|
|
58231
|
-
parts.push(path2.call(
|
|
58231
|
+
parts.push(path2.call(print11, "id"));
|
|
58232
58232
|
if (n.name) {
|
|
58233
|
-
parts.push(" as ", path2.call(
|
|
58233
|
+
parts.push(" as ", path2.call(print11, "name"));
|
|
58234
58234
|
}
|
|
58235
58235
|
}
|
|
58236
58236
|
return (0, lines_1.concat)(parts);
|
|
@@ -58239,40 +58239,40 @@ var require_printer2 = __commonJS({
|
|
|
58239
58239
|
case "ImportNamespaceSpecifier":
|
|
58240
58240
|
parts.push("* as ");
|
|
58241
58241
|
if (n.local) {
|
|
58242
|
-
parts.push(path2.call(
|
|
58242
|
+
parts.push(path2.call(print11, "local"));
|
|
58243
58243
|
} else if (n.id) {
|
|
58244
|
-
parts.push(path2.call(
|
|
58244
|
+
parts.push(path2.call(print11, "id"));
|
|
58245
58245
|
}
|
|
58246
58246
|
return (0, lines_1.concat)(parts);
|
|
58247
58247
|
case "ImportDefaultSpecifier":
|
|
58248
58248
|
if (n.local) {
|
|
58249
|
-
return path2.call(
|
|
58249
|
+
return path2.call(print11, "local");
|
|
58250
58250
|
}
|
|
58251
|
-
return path2.call(
|
|
58251
|
+
return path2.call(print11, "id");
|
|
58252
58252
|
case "TSExportAssignment":
|
|
58253
|
-
return (0, lines_1.concat)(["export = ", path2.call(
|
|
58253
|
+
return (0, lines_1.concat)(["export = ", path2.call(print11, "expression")]);
|
|
58254
58254
|
case "ExportDeclaration":
|
|
58255
58255
|
case "ExportDefaultDeclaration":
|
|
58256
58256
|
case "ExportNamedDeclaration":
|
|
58257
|
-
return printExportDeclaration(path2, options,
|
|
58257
|
+
return printExportDeclaration(path2, options, print11);
|
|
58258
58258
|
case "ExportAllDeclaration":
|
|
58259
58259
|
parts.push("export *");
|
|
58260
58260
|
if (n.exported) {
|
|
58261
|
-
parts.push(" as ", path2.call(
|
|
58261
|
+
parts.push(" as ", path2.call(print11, "exported"));
|
|
58262
58262
|
}
|
|
58263
|
-
parts.push(" from ", path2.call(
|
|
58263
|
+
parts.push(" from ", path2.call(print11, "source"), ";");
|
|
58264
58264
|
return (0, lines_1.concat)(parts);
|
|
58265
58265
|
case "TSNamespaceExportDeclaration":
|
|
58266
|
-
parts.push("export as namespace ", path2.call(
|
|
58266
|
+
parts.push("export as namespace ", path2.call(print11, "id"));
|
|
58267
58267
|
return maybeAddSemicolon((0, lines_1.concat)(parts));
|
|
58268
58268
|
case "ExportNamespaceSpecifier":
|
|
58269
|
-
return (0, lines_1.concat)(["* as ", path2.call(
|
|
58269
|
+
return (0, lines_1.concat)(["* as ", path2.call(print11, "exported")]);
|
|
58270
58270
|
case "ExportDefaultSpecifier":
|
|
58271
|
-
return path2.call(
|
|
58271
|
+
return path2.call(print11, "exported");
|
|
58272
58272
|
case "Import":
|
|
58273
58273
|
return (0, lines_1.fromString)("import", options);
|
|
58274
58274
|
case "ImportExpression":
|
|
58275
|
-
return (0, lines_1.concat)(["import(", path2.call(
|
|
58275
|
+
return (0, lines_1.concat)(["import(", path2.call(print11, "source"), ")"]);
|
|
58276
58276
|
case "ImportDeclaration": {
|
|
58277
58277
|
parts.push("import ");
|
|
58278
58278
|
if (n.importKind && n.importKind !== "value") {
|
|
@@ -58284,9 +58284,9 @@ var require_printer2 = __commonJS({
|
|
|
58284
58284
|
path2.each(function(specifierPath) {
|
|
58285
58285
|
var spec = specifierPath.getValue();
|
|
58286
58286
|
if (spec.type === "ImportSpecifier") {
|
|
58287
|
-
bracedSpecifiers_1.push(
|
|
58287
|
+
bracedSpecifiers_1.push(print11(specifierPath));
|
|
58288
58288
|
} else if (spec.type === "ImportDefaultSpecifier" || spec.type === "ImportNamespaceSpecifier") {
|
|
58289
|
-
unbracedSpecifiers_1.push(
|
|
58289
|
+
unbracedSpecifiers_1.push(print11(specifierPath));
|
|
58290
58290
|
}
|
|
58291
58291
|
}, "specifiers");
|
|
58292
58292
|
unbracedSpecifiers_1.forEach(function(lines2, i2) {
|
|
@@ -58316,16 +58316,16 @@ var require_printer2 = __commonJS({
|
|
|
58316
58316
|
}
|
|
58317
58317
|
parts.push(" from ");
|
|
58318
58318
|
}
|
|
58319
|
-
parts.push(path2.call(
|
|
58319
|
+
parts.push(path2.call(print11, "source"), maybePrintImportAssertions(path2, options, print11), ";");
|
|
58320
58320
|
return (0, lines_1.concat)(parts);
|
|
58321
58321
|
}
|
|
58322
58322
|
case "ImportAttribute":
|
|
58323
|
-
return (0, lines_1.concat)([path2.call(
|
|
58323
|
+
return (0, lines_1.concat)([path2.call(print11, "key"), ": ", path2.call(print11, "value")]);
|
|
58324
58324
|
case "StaticBlock":
|
|
58325
58325
|
parts.push("static ");
|
|
58326
58326
|
case "BlockStatement": {
|
|
58327
58327
|
var naked_1 = path2.call(function(bodyPath) {
|
|
58328
|
-
return printStatementSequence(bodyPath, options,
|
|
58328
|
+
return printStatementSequence(bodyPath, options, print11);
|
|
58329
58329
|
}, "body");
|
|
58330
58330
|
if (naked_1.isEmpty()) {
|
|
58331
58331
|
if (!n.directives || n.directives.length === 0) {
|
|
@@ -58336,7 +58336,7 @@ var require_printer2 = __commonJS({
|
|
|
58336
58336
|
parts.push("{\n");
|
|
58337
58337
|
if (n.directives) {
|
|
58338
58338
|
path2.each(function(childPath) {
|
|
58339
|
-
parts.push(maybeAddSemicolon(
|
|
58339
|
+
parts.push(maybeAddSemicolon(print11(childPath).indent(options.tabWidth)), n.directives.length > 1 || !naked_1.isEmpty() ? "\n" : "");
|
|
58340
58340
|
}, "directives");
|
|
58341
58341
|
}
|
|
58342
58342
|
parts.push(naked_1.indent(options.tabWidth));
|
|
@@ -58346,7 +58346,7 @@ var require_printer2 = __commonJS({
|
|
|
58346
58346
|
case "ReturnStatement": {
|
|
58347
58347
|
parts.push("return");
|
|
58348
58348
|
if (n.argument) {
|
|
58349
|
-
var argLines = path2.call(
|
|
58349
|
+
var argLines = path2.call(print11, "argument");
|
|
58350
58350
|
if (argLines.startsWithComment() || argLines.length > 1 && namedTypes.JSXElement && namedTypes.JSXElement.check(n.argument)) {
|
|
58351
58351
|
parts.push(" (\n", argLines.indent(options.tabWidth), "\n)");
|
|
58352
58352
|
} else {
|
|
@@ -58358,17 +58358,17 @@ var require_printer2 = __commonJS({
|
|
|
58358
58358
|
}
|
|
58359
58359
|
case "CallExpression":
|
|
58360
58360
|
case "OptionalCallExpression":
|
|
58361
|
-
parts.push(path2.call(
|
|
58361
|
+
parts.push(path2.call(print11, "callee"));
|
|
58362
58362
|
if (n.typeParameters) {
|
|
58363
|
-
parts.push(path2.call(
|
|
58363
|
+
parts.push(path2.call(print11, "typeParameters"));
|
|
58364
58364
|
}
|
|
58365
58365
|
if (n.typeArguments) {
|
|
58366
|
-
parts.push(path2.call(
|
|
58366
|
+
parts.push(path2.call(print11, "typeArguments"));
|
|
58367
58367
|
}
|
|
58368
58368
|
if (types16.getFieldValue(n, "optional")) {
|
|
58369
58369
|
parts.push("?.");
|
|
58370
58370
|
}
|
|
58371
|
-
parts.push(printArgumentsList(path2, options,
|
|
58371
|
+
parts.push(printArgumentsList(path2, options, print11));
|
|
58372
58372
|
return (0, lines_1.concat)(parts);
|
|
58373
58373
|
case "RecordExpression":
|
|
58374
58374
|
parts.push("#");
|
|
@@ -58398,7 +58398,7 @@ var require_printer2 = __commonJS({
|
|
|
58398
58398
|
var i_1 = 0;
|
|
58399
58399
|
fields.forEach(function(field) {
|
|
58400
58400
|
path2.each(function(childPath) {
|
|
58401
|
-
var lines2 =
|
|
58401
|
+
var lines2 = print11(childPath);
|
|
58402
58402
|
if (!oneLine_1) {
|
|
58403
58403
|
lines2 = lines2.indent(options.tabWidth);
|
|
58404
58404
|
}
|
|
@@ -58435,32 +58435,32 @@ var require_printer2 = __commonJS({
|
|
|
58435
58435
|
parts[parts.length - 1] = " " + rightBrace;
|
|
58436
58436
|
}
|
|
58437
58437
|
if (n.typeAnnotation) {
|
|
58438
|
-
parts.push(path2.call(
|
|
58438
|
+
parts.push(path2.call(print11, "typeAnnotation"));
|
|
58439
58439
|
}
|
|
58440
58440
|
return (0, lines_1.concat)(parts);
|
|
58441
58441
|
}
|
|
58442
58442
|
case "PropertyPattern":
|
|
58443
58443
|
return (0, lines_1.concat)([
|
|
58444
|
-
path2.call(
|
|
58444
|
+
path2.call(print11, "key"),
|
|
58445
58445
|
": ",
|
|
58446
|
-
path2.call(
|
|
58446
|
+
path2.call(print11, "pattern")
|
|
58447
58447
|
]);
|
|
58448
58448
|
case "ObjectProperty":
|
|
58449
58449
|
case "Property": {
|
|
58450
58450
|
if (n.method || n.kind === "get" || n.kind === "set") {
|
|
58451
|
-
return printMethod(path2, options,
|
|
58451
|
+
return printMethod(path2, options, print11);
|
|
58452
58452
|
}
|
|
58453
58453
|
if (n.shorthand && n.value.type === "AssignmentPattern") {
|
|
58454
|
-
return path2.call(
|
|
58454
|
+
return path2.call(print11, "value");
|
|
58455
58455
|
}
|
|
58456
|
-
var key = path2.call(
|
|
58456
|
+
var key = path2.call(print11, "key");
|
|
58457
58457
|
if (n.computed) {
|
|
58458
58458
|
parts.push("[", key, "]");
|
|
58459
58459
|
} else {
|
|
58460
58460
|
parts.push(key);
|
|
58461
58461
|
}
|
|
58462
58462
|
if (!n.shorthand || n.key.name !== n.value.name) {
|
|
58463
|
-
parts.push(": ", path2.call(
|
|
58463
|
+
parts.push(": ", path2.call(print11, "value"));
|
|
58464
58464
|
}
|
|
58465
58465
|
return (0, lines_1.concat)(parts);
|
|
58466
58466
|
}
|
|
@@ -58468,18 +58468,18 @@ var require_printer2 = __commonJS({
|
|
|
58468
58468
|
case "ObjectMethod":
|
|
58469
58469
|
case "ClassPrivateMethod":
|
|
58470
58470
|
case "TSDeclareMethod":
|
|
58471
|
-
return printMethod(path2, options,
|
|
58471
|
+
return printMethod(path2, options, print11);
|
|
58472
58472
|
case "PrivateName":
|
|
58473
|
-
return (0, lines_1.concat)(["#", path2.call(
|
|
58473
|
+
return (0, lines_1.concat)(["#", path2.call(print11, "id")]);
|
|
58474
58474
|
case "Decorator":
|
|
58475
|
-
return (0, lines_1.concat)(["@", path2.call(
|
|
58475
|
+
return (0, lines_1.concat)(["@", path2.call(print11, "expression")]);
|
|
58476
58476
|
case "TupleExpression":
|
|
58477
58477
|
parts.push("#");
|
|
58478
58478
|
case "ArrayExpression":
|
|
58479
58479
|
case "ArrayPattern": {
|
|
58480
58480
|
var elems = n.elements;
|
|
58481
58481
|
var len_2 = elems.length;
|
|
58482
|
-
var printed_1 = path2.map(
|
|
58482
|
+
var printed_1 = path2.map(print11, "elements");
|
|
58483
58483
|
var joined = (0, lines_1.fromString)(", ").join(printed_1);
|
|
58484
58484
|
var oneLine_2 = joined.getLineLength(1) <= options.wrapColumn;
|
|
58485
58485
|
if (oneLine_2) {
|
|
@@ -58517,12 +58517,12 @@ var require_printer2 = __commonJS({
|
|
|
58517
58517
|
parts.push("]");
|
|
58518
58518
|
}
|
|
58519
58519
|
if (n.typeAnnotation) {
|
|
58520
|
-
parts.push(path2.call(
|
|
58520
|
+
parts.push(path2.call(print11, "typeAnnotation"));
|
|
58521
58521
|
}
|
|
58522
58522
|
return (0, lines_1.concat)(parts);
|
|
58523
58523
|
}
|
|
58524
58524
|
case "SequenceExpression":
|
|
58525
|
-
return (0, lines_1.fromString)(", ").join(path2.map(
|
|
58525
|
+
return (0, lines_1.fromString)(", ").join(path2.map(print11, "expressions"));
|
|
58526
58526
|
case "ThisExpression":
|
|
58527
58527
|
return (0, lines_1.fromString)("this");
|
|
58528
58528
|
case "Super":
|
|
@@ -58543,7 +58543,7 @@ var require_printer2 = __commonJS({
|
|
|
58543
58543
|
case "Literal":
|
|
58544
58544
|
return (0, lines_1.fromString)(getPossibleRaw(n) || (typeof n.value === "string" ? nodeStr(n.value, options) : n.value), options);
|
|
58545
58545
|
case "Directive":
|
|
58546
|
-
return path2.call(
|
|
58546
|
+
return path2.call(print11, "value");
|
|
58547
58547
|
case "DirectiveLiteral":
|
|
58548
58548
|
return (0, lines_1.fromString)(getPossibleRaw(n) || nodeStr(n.value, options), options);
|
|
58549
58549
|
case "InterpreterDirective":
|
|
@@ -58557,32 +58557,32 @@ var require_printer2 = __commonJS({
|
|
|
58557
58557
|
parts.push(n.operator);
|
|
58558
58558
|
if (/[a-z]$/.test(n.operator))
|
|
58559
58559
|
parts.push(" ");
|
|
58560
|
-
parts.push(path2.call(
|
|
58560
|
+
parts.push(path2.call(print11, "argument"));
|
|
58561
58561
|
return (0, lines_1.concat)(parts);
|
|
58562
58562
|
case "UpdateExpression":
|
|
58563
|
-
parts.push(path2.call(
|
|
58563
|
+
parts.push(path2.call(print11, "argument"), n.operator);
|
|
58564
58564
|
if (n.prefix)
|
|
58565
58565
|
parts.reverse();
|
|
58566
58566
|
return (0, lines_1.concat)(parts);
|
|
58567
58567
|
case "ConditionalExpression":
|
|
58568
58568
|
return (0, lines_1.concat)([
|
|
58569
|
-
path2.call(
|
|
58569
|
+
path2.call(print11, "test"),
|
|
58570
58570
|
" ? ",
|
|
58571
|
-
path2.call(
|
|
58571
|
+
path2.call(print11, "consequent"),
|
|
58572
58572
|
" : ",
|
|
58573
|
-
path2.call(
|
|
58573
|
+
path2.call(print11, "alternate")
|
|
58574
58574
|
]);
|
|
58575
58575
|
case "NewExpression": {
|
|
58576
|
-
parts.push("new ", path2.call(
|
|
58576
|
+
parts.push("new ", path2.call(print11, "callee"));
|
|
58577
58577
|
if (n.typeParameters) {
|
|
58578
|
-
parts.push(path2.call(
|
|
58578
|
+
parts.push(path2.call(print11, "typeParameters"));
|
|
58579
58579
|
}
|
|
58580
58580
|
if (n.typeArguments) {
|
|
58581
|
-
parts.push(path2.call(
|
|
58581
|
+
parts.push(path2.call(print11, "typeArguments"));
|
|
58582
58582
|
}
|
|
58583
58583
|
var args = n.arguments;
|
|
58584
58584
|
if (args) {
|
|
58585
|
-
parts.push(printArgumentsList(path2, options,
|
|
58585
|
+
parts.push(printArgumentsList(path2, options, print11));
|
|
58586
58586
|
}
|
|
58587
58587
|
return (0, lines_1.concat)(parts);
|
|
58588
58588
|
}
|
|
@@ -58593,7 +58593,7 @@ var require_printer2 = __commonJS({
|
|
|
58593
58593
|
parts.push(n.kind, " ");
|
|
58594
58594
|
var maxLen_1 = 0;
|
|
58595
58595
|
var printed = path2.map(function(childPath) {
|
|
58596
|
-
var lines2 =
|
|
58596
|
+
var lines2 = print11(childPath);
|
|
58597
58597
|
maxLen_1 = Math.max(lines2.length, maxLen_1);
|
|
58598
58598
|
return lines2;
|
|
58599
58599
|
}, "declarations");
|
|
@@ -58612,30 +58612,30 @@ var require_printer2 = __commonJS({
|
|
|
58612
58612
|
}
|
|
58613
58613
|
case "VariableDeclarator":
|
|
58614
58614
|
return n.init ? (0, lines_1.fromString)(" = ").join([
|
|
58615
|
-
path2.call(
|
|
58616
|
-
path2.call(
|
|
58617
|
-
]) : path2.call(
|
|
58615
|
+
path2.call(print11, "id"),
|
|
58616
|
+
path2.call(print11, "init")
|
|
58617
|
+
]) : path2.call(print11, "id");
|
|
58618
58618
|
case "WithStatement":
|
|
58619
58619
|
return (0, lines_1.concat)([
|
|
58620
58620
|
"with (",
|
|
58621
|
-
path2.call(
|
|
58621
|
+
path2.call(print11, "object"),
|
|
58622
58622
|
") ",
|
|
58623
|
-
path2.call(
|
|
58623
|
+
path2.call(print11, "body")
|
|
58624
58624
|
]);
|
|
58625
58625
|
case "IfStatement": {
|
|
58626
|
-
var con = adjustClause(path2.call(
|
|
58627
|
-
parts.push("if (", path2.call(
|
|
58626
|
+
var con = adjustClause(path2.call(print11, "consequent"), options);
|
|
58627
|
+
parts.push("if (", path2.call(print11, "test"), ")", con);
|
|
58628
58628
|
if (n.alternate)
|
|
58629
|
-
parts.push(endsWithBrace(con) ? " else" : "\nelse", adjustClause(path2.call(
|
|
58629
|
+
parts.push(endsWithBrace(con) ? " else" : "\nelse", adjustClause(path2.call(print11, "alternate"), options));
|
|
58630
58630
|
return (0, lines_1.concat)(parts);
|
|
58631
58631
|
}
|
|
58632
58632
|
case "ForStatement": {
|
|
58633
|
-
var init2 = path2.call(
|
|
58633
|
+
var init2 = path2.call(print11, "init");
|
|
58634
58634
|
var sep2 = init2.length > 1 ? ";\n" : "; ";
|
|
58635
58635
|
var forParen = "for (";
|
|
58636
|
-
var indented = (0, lines_1.fromString)(sep2).join([init2, path2.call(
|
|
58636
|
+
var indented = (0, lines_1.fromString)(sep2).join([init2, path2.call(print11, "test"), path2.call(print11, "update")]).indentTail(forParen.length);
|
|
58637
58637
|
var head = (0, lines_1.concat)([forParen, indented, ")"]);
|
|
58638
|
-
var clause = adjustClause(path2.call(
|
|
58638
|
+
var clause = adjustClause(path2.call(print11, "body"), options);
|
|
58639
58639
|
parts.push(head);
|
|
58640
58640
|
if (head.length > 1) {
|
|
58641
58641
|
parts.push("\n");
|
|
@@ -58647,18 +58647,18 @@ var require_printer2 = __commonJS({
|
|
|
58647
58647
|
case "WhileStatement":
|
|
58648
58648
|
return (0, lines_1.concat)([
|
|
58649
58649
|
"while (",
|
|
58650
|
-
path2.call(
|
|
58650
|
+
path2.call(print11, "test"),
|
|
58651
58651
|
")",
|
|
58652
|
-
adjustClause(path2.call(
|
|
58652
|
+
adjustClause(path2.call(print11, "body"), options)
|
|
58653
58653
|
]);
|
|
58654
58654
|
case "ForInStatement":
|
|
58655
58655
|
return (0, lines_1.concat)([
|
|
58656
58656
|
n.each ? "for each (" : "for (",
|
|
58657
|
-
path2.call(
|
|
58657
|
+
path2.call(print11, "left"),
|
|
58658
58658
|
" in ",
|
|
58659
|
-
path2.call(
|
|
58659
|
+
path2.call(print11, "right"),
|
|
58660
58660
|
")",
|
|
58661
|
-
adjustClause(path2.call(
|
|
58661
|
+
adjustClause(path2.call(print11, "body"), options)
|
|
58662
58662
|
]);
|
|
58663
58663
|
case "ForOfStatement":
|
|
58664
58664
|
case "ForAwaitStatement":
|
|
@@ -58666,122 +58666,122 @@ var require_printer2 = __commonJS({
|
|
|
58666
58666
|
if (n.await || n.type === "ForAwaitStatement") {
|
|
58667
58667
|
parts.push("await ");
|
|
58668
58668
|
}
|
|
58669
|
-
parts.push("(", path2.call(
|
|
58669
|
+
parts.push("(", path2.call(print11, "left"), " of ", path2.call(print11, "right"), ")", adjustClause(path2.call(print11, "body"), options));
|
|
58670
58670
|
return (0, lines_1.concat)(parts);
|
|
58671
58671
|
case "DoWhileStatement": {
|
|
58672
58672
|
var doBody = (0, lines_1.concat)([
|
|
58673
58673
|
"do",
|
|
58674
|
-
adjustClause(path2.call(
|
|
58674
|
+
adjustClause(path2.call(print11, "body"), options)
|
|
58675
58675
|
]);
|
|
58676
58676
|
parts.push(doBody);
|
|
58677
58677
|
if (endsWithBrace(doBody))
|
|
58678
58678
|
parts.push(" while");
|
|
58679
58679
|
else
|
|
58680
58680
|
parts.push("\nwhile");
|
|
58681
|
-
parts.push(" (", path2.call(
|
|
58681
|
+
parts.push(" (", path2.call(print11, "test"), ");");
|
|
58682
58682
|
return (0, lines_1.concat)(parts);
|
|
58683
58683
|
}
|
|
58684
58684
|
case "DoExpression": {
|
|
58685
58685
|
var statements = path2.call(function(bodyPath) {
|
|
58686
|
-
return printStatementSequence(bodyPath, options,
|
|
58686
|
+
return printStatementSequence(bodyPath, options, print11);
|
|
58687
58687
|
}, "body");
|
|
58688
58688
|
return (0, lines_1.concat)(["do {\n", statements.indent(options.tabWidth), "\n}"]);
|
|
58689
58689
|
}
|
|
58690
58690
|
case "BreakStatement":
|
|
58691
58691
|
parts.push("break");
|
|
58692
58692
|
if (n.label)
|
|
58693
|
-
parts.push(" ", path2.call(
|
|
58693
|
+
parts.push(" ", path2.call(print11, "label"));
|
|
58694
58694
|
parts.push(";");
|
|
58695
58695
|
return (0, lines_1.concat)(parts);
|
|
58696
58696
|
case "ContinueStatement":
|
|
58697
58697
|
parts.push("continue");
|
|
58698
58698
|
if (n.label)
|
|
58699
|
-
parts.push(" ", path2.call(
|
|
58699
|
+
parts.push(" ", path2.call(print11, "label"));
|
|
58700
58700
|
parts.push(";");
|
|
58701
58701
|
return (0, lines_1.concat)(parts);
|
|
58702
58702
|
case "LabeledStatement":
|
|
58703
58703
|
return (0, lines_1.concat)([
|
|
58704
|
-
path2.call(
|
|
58704
|
+
path2.call(print11, "label"),
|
|
58705
58705
|
":\n",
|
|
58706
|
-
path2.call(
|
|
58706
|
+
path2.call(print11, "body")
|
|
58707
58707
|
]);
|
|
58708
58708
|
case "TryStatement":
|
|
58709
|
-
parts.push("try ", path2.call(
|
|
58709
|
+
parts.push("try ", path2.call(print11, "block"));
|
|
58710
58710
|
if (n.handler) {
|
|
58711
|
-
parts.push(" ", path2.call(
|
|
58711
|
+
parts.push(" ", path2.call(print11, "handler"));
|
|
58712
58712
|
} else if (n.handlers) {
|
|
58713
58713
|
path2.each(function(handlerPath) {
|
|
58714
|
-
parts.push(" ",
|
|
58714
|
+
parts.push(" ", print11(handlerPath));
|
|
58715
58715
|
}, "handlers");
|
|
58716
58716
|
}
|
|
58717
58717
|
if (n.finalizer) {
|
|
58718
|
-
parts.push(" finally ", path2.call(
|
|
58718
|
+
parts.push(" finally ", path2.call(print11, "finalizer"));
|
|
58719
58719
|
}
|
|
58720
58720
|
return (0, lines_1.concat)(parts);
|
|
58721
58721
|
case "CatchClause":
|
|
58722
58722
|
parts.push("catch ");
|
|
58723
58723
|
if (n.param) {
|
|
58724
|
-
parts.push("(", path2.call(
|
|
58724
|
+
parts.push("(", path2.call(print11, "param"));
|
|
58725
58725
|
}
|
|
58726
58726
|
if (n.guard) {
|
|
58727
|
-
parts.push(" if ", path2.call(
|
|
58727
|
+
parts.push(" if ", path2.call(print11, "guard"));
|
|
58728
58728
|
}
|
|
58729
58729
|
if (n.param) {
|
|
58730
58730
|
parts.push(") ");
|
|
58731
58731
|
}
|
|
58732
|
-
parts.push(path2.call(
|
|
58732
|
+
parts.push(path2.call(print11, "body"));
|
|
58733
58733
|
return (0, lines_1.concat)(parts);
|
|
58734
58734
|
case "ThrowStatement":
|
|
58735
|
-
return (0, lines_1.concat)(["throw ", path2.call(
|
|
58735
|
+
return (0, lines_1.concat)(["throw ", path2.call(print11, "argument"), ";"]);
|
|
58736
58736
|
case "SwitchStatement":
|
|
58737
58737
|
return (0, lines_1.concat)([
|
|
58738
58738
|
"switch (",
|
|
58739
|
-
path2.call(
|
|
58739
|
+
path2.call(print11, "discriminant"),
|
|
58740
58740
|
") {\n",
|
|
58741
|
-
(0, lines_1.fromString)("\n").join(path2.map(
|
|
58741
|
+
(0, lines_1.fromString)("\n").join(path2.map(print11, "cases")),
|
|
58742
58742
|
"\n}"
|
|
58743
58743
|
]);
|
|
58744
58744
|
case "SwitchCase":
|
|
58745
58745
|
if (n.test)
|
|
58746
|
-
parts.push("case ", path2.call(
|
|
58746
|
+
parts.push("case ", path2.call(print11, "test"), ":");
|
|
58747
58747
|
else
|
|
58748
58748
|
parts.push("default:");
|
|
58749
58749
|
if (n.consequent.length > 0) {
|
|
58750
58750
|
parts.push("\n", path2.call(function(consequentPath) {
|
|
58751
|
-
return printStatementSequence(consequentPath, options,
|
|
58751
|
+
return printStatementSequence(consequentPath, options, print11);
|
|
58752
58752
|
}, "consequent").indent(options.tabWidth));
|
|
58753
58753
|
}
|
|
58754
58754
|
return (0, lines_1.concat)(parts);
|
|
58755
58755
|
case "DebuggerStatement":
|
|
58756
58756
|
return (0, lines_1.fromString)("debugger;");
|
|
58757
58757
|
case "JSXAttribute":
|
|
58758
|
-
parts.push(path2.call(
|
|
58758
|
+
parts.push(path2.call(print11, "name"));
|
|
58759
58759
|
if (n.value)
|
|
58760
|
-
parts.push("=", path2.call(
|
|
58760
|
+
parts.push("=", path2.call(print11, "value"));
|
|
58761
58761
|
return (0, lines_1.concat)(parts);
|
|
58762
58762
|
case "JSXIdentifier":
|
|
58763
58763
|
return (0, lines_1.fromString)(n.name, options);
|
|
58764
58764
|
case "JSXNamespacedName":
|
|
58765
58765
|
return (0, lines_1.fromString)(":").join([
|
|
58766
|
-
path2.call(
|
|
58767
|
-
path2.call(
|
|
58766
|
+
path2.call(print11, "namespace"),
|
|
58767
|
+
path2.call(print11, "name")
|
|
58768
58768
|
]);
|
|
58769
58769
|
case "JSXMemberExpression":
|
|
58770
58770
|
return (0, lines_1.fromString)(".").join([
|
|
58771
|
-
path2.call(
|
|
58772
|
-
path2.call(
|
|
58771
|
+
path2.call(print11, "object"),
|
|
58772
|
+
path2.call(print11, "property")
|
|
58773
58773
|
]);
|
|
58774
58774
|
case "JSXSpreadAttribute":
|
|
58775
|
-
return (0, lines_1.concat)(["{...", path2.call(
|
|
58775
|
+
return (0, lines_1.concat)(["{...", path2.call(print11, "argument"), "}"]);
|
|
58776
58776
|
case "JSXSpreadChild":
|
|
58777
|
-
return (0, lines_1.concat)(["{...", path2.call(
|
|
58777
|
+
return (0, lines_1.concat)(["{...", path2.call(print11, "expression"), "}"]);
|
|
58778
58778
|
case "JSXExpressionContainer":
|
|
58779
|
-
return (0, lines_1.concat)(["{", path2.call(
|
|
58779
|
+
return (0, lines_1.concat)(["{", path2.call(print11, "expression"), "}"]);
|
|
58780
58780
|
case "JSXElement":
|
|
58781
58781
|
case "JSXFragment": {
|
|
58782
58782
|
var openingPropName = "opening" + (n.type === "JSXElement" ? "Element" : "Fragment");
|
|
58783
58783
|
var closingPropName = "closing" + (n.type === "JSXElement" ? "Element" : "Fragment");
|
|
58784
|
-
var openingLines = path2.call(
|
|
58784
|
+
var openingLines = path2.call(print11, openingPropName);
|
|
58785
58785
|
if (n[openingPropName].selfClosing) {
|
|
58786
58786
|
assert_1.default.ok(!n[closingPropName], "unexpected " + closingPropName + " element in self-closing " + n.type);
|
|
58787
58787
|
return openingLines;
|
|
@@ -58795,16 +58795,16 @@ var require_printer2 = __commonJS({
|
|
|
58795
58795
|
return "\n";
|
|
58796
58796
|
}
|
|
58797
58797
|
}
|
|
58798
|
-
return
|
|
58798
|
+
return print11(childPath);
|
|
58799
58799
|
}, "children")).indentTail(options.tabWidth);
|
|
58800
|
-
var closingLines = path2.call(
|
|
58800
|
+
var closingLines = path2.call(print11, closingPropName);
|
|
58801
58801
|
return (0, lines_1.concat)([openingLines, childLines, closingLines]);
|
|
58802
58802
|
}
|
|
58803
58803
|
case "JSXOpeningElement": {
|
|
58804
|
-
parts.push("<", path2.call(
|
|
58804
|
+
parts.push("<", path2.call(print11, "name"));
|
|
58805
58805
|
var attrParts_1 = [];
|
|
58806
58806
|
path2.each(function(attrPath) {
|
|
58807
|
-
attrParts_1.push(" ",
|
|
58807
|
+
attrParts_1.push(" ", print11(attrPath));
|
|
58808
58808
|
}, "attributes");
|
|
58809
58809
|
var attrLines = (0, lines_1.concat)(attrParts_1);
|
|
58810
58810
|
var needLineWrap = attrLines.length > 1 || attrLines.getLineLength(1) > options.wrapColumn;
|
|
@@ -58821,7 +58821,7 @@ var require_printer2 = __commonJS({
|
|
|
58821
58821
|
return (0, lines_1.concat)(parts);
|
|
58822
58822
|
}
|
|
58823
58823
|
case "JSXClosingElement":
|
|
58824
|
-
return (0, lines_1.concat)(["</", path2.call(
|
|
58824
|
+
return (0, lines_1.concat)(["</", path2.call(print11, "name"), ">"]);
|
|
58825
58825
|
case "JSXOpeningFragment":
|
|
58826
58826
|
return (0, lines_1.fromString)("<>");
|
|
58827
58827
|
case "JSXClosingFragment":
|
|
@@ -58832,9 +58832,9 @@ var require_printer2 = __commonJS({
|
|
|
58832
58832
|
return (0, lines_1.fromString)("");
|
|
58833
58833
|
case "TypeAnnotatedIdentifier":
|
|
58834
58834
|
return (0, lines_1.concat)([
|
|
58835
|
-
path2.call(
|
|
58835
|
+
path2.call(print11, "annotation"),
|
|
58836
58836
|
" ",
|
|
58837
|
-
path2.call(
|
|
58837
|
+
path2.call(print11, "identifier")
|
|
58838
58838
|
]);
|
|
58839
58839
|
case "ClassBody":
|
|
58840
58840
|
if (n.body.length === 0) {
|
|
@@ -58843,12 +58843,12 @@ var require_printer2 = __commonJS({
|
|
|
58843
58843
|
return (0, lines_1.concat)([
|
|
58844
58844
|
"{\n",
|
|
58845
58845
|
path2.call(function(bodyPath) {
|
|
58846
|
-
return printStatementSequence(bodyPath, options,
|
|
58846
|
+
return printStatementSequence(bodyPath, options, print11);
|
|
58847
58847
|
}, "body").indent(options.tabWidth),
|
|
58848
58848
|
"\n}"
|
|
58849
58849
|
]);
|
|
58850
58850
|
case "ClassPropertyDefinition":
|
|
58851
|
-
parts.push("static ", path2.call(
|
|
58851
|
+
parts.push("static ", path2.call(print11, "definition"));
|
|
58852
58852
|
if (!namedTypes.MethodDefinition.check(n.definition))
|
|
58853
58853
|
parts.push(";");
|
|
58854
58854
|
return (0, lines_1.concat)(parts);
|
|
@@ -58869,12 +58869,12 @@ var require_printer2 = __commonJS({
|
|
|
58869
58869
|
if (n.readonly) {
|
|
58870
58870
|
parts.push("readonly ");
|
|
58871
58871
|
}
|
|
58872
|
-
var key = path2.call(
|
|
58872
|
+
var key = path2.call(print11, "key");
|
|
58873
58873
|
if (n.computed) {
|
|
58874
58874
|
key = (0, lines_1.concat)(["[", key, "]"]);
|
|
58875
58875
|
}
|
|
58876
58876
|
if (n.variance) {
|
|
58877
|
-
key = (0, lines_1.concat)([printVariance(path2,
|
|
58877
|
+
key = (0, lines_1.concat)([printVariance(path2, print11), key]);
|
|
58878
58878
|
}
|
|
58879
58879
|
parts.push(key);
|
|
58880
58880
|
if (n.optional) {
|
|
@@ -58884,10 +58884,10 @@ var require_printer2 = __commonJS({
|
|
|
58884
58884
|
parts.push("!");
|
|
58885
58885
|
}
|
|
58886
58886
|
if (n.typeAnnotation) {
|
|
58887
|
-
parts.push(path2.call(
|
|
58887
|
+
parts.push(path2.call(print11, "typeAnnotation"));
|
|
58888
58888
|
}
|
|
58889
58889
|
if (n.value) {
|
|
58890
|
-
parts.push(" = ", path2.call(
|
|
58890
|
+
parts.push(" = ", path2.call(print11, "value"));
|
|
58891
58891
|
}
|
|
58892
58892
|
parts.push(";");
|
|
58893
58893
|
return (0, lines_1.concat)(parts);
|
|
@@ -58896,21 +58896,21 @@ var require_printer2 = __commonJS({
|
|
|
58896
58896
|
if (n.static) {
|
|
58897
58897
|
parts.push("static ");
|
|
58898
58898
|
}
|
|
58899
|
-
parts.push(path2.call(
|
|
58899
|
+
parts.push(path2.call(print11, "key"));
|
|
58900
58900
|
if (n.typeAnnotation) {
|
|
58901
|
-
parts.push(path2.call(
|
|
58901
|
+
parts.push(path2.call(print11, "typeAnnotation"));
|
|
58902
58902
|
}
|
|
58903
58903
|
if (n.value) {
|
|
58904
|
-
parts.push(" = ", path2.call(
|
|
58904
|
+
parts.push(" = ", path2.call(print11, "value"));
|
|
58905
58905
|
}
|
|
58906
58906
|
parts.push(";");
|
|
58907
58907
|
return (0, lines_1.concat)(parts);
|
|
58908
58908
|
case "ClassAccessorProperty": {
|
|
58909
58909
|
parts.push.apply(parts, tslib_1.__spreadArray(tslib_1.__spreadArray([], printClassMemberModifiers(n), false), ["accessor "], false));
|
|
58910
58910
|
if (n.computed) {
|
|
58911
|
-
parts.push("[", path2.call(
|
|
58911
|
+
parts.push("[", path2.call(print11, "key"), "]");
|
|
58912
58912
|
} else {
|
|
58913
|
-
parts.push(path2.call(
|
|
58913
|
+
parts.push(path2.call(print11, "key"));
|
|
58914
58914
|
}
|
|
58915
58915
|
if (n.optional) {
|
|
58916
58916
|
parts.push("?");
|
|
@@ -58919,10 +58919,10 @@ var require_printer2 = __commonJS({
|
|
|
58919
58919
|
parts.push("!");
|
|
58920
58920
|
}
|
|
58921
58921
|
if (n.typeAnnotation) {
|
|
58922
|
-
parts.push(path2.call(
|
|
58922
|
+
parts.push(path2.call(print11, "typeAnnotation"));
|
|
58923
58923
|
}
|
|
58924
58924
|
if (n.value) {
|
|
58925
|
-
parts.push(" = ", path2.call(
|
|
58925
|
+
parts.push(" = ", path2.call(print11, "value"));
|
|
58926
58926
|
}
|
|
58927
58927
|
parts.push(";");
|
|
58928
58928
|
return (0, lines_1.concat)(parts);
|
|
@@ -58938,21 +58938,21 @@ var require_printer2 = __commonJS({
|
|
|
58938
58938
|
}
|
|
58939
58939
|
parts.push("class");
|
|
58940
58940
|
if (n.id) {
|
|
58941
|
-
parts.push(" ", path2.call(
|
|
58941
|
+
parts.push(" ", path2.call(print11, "id"));
|
|
58942
58942
|
}
|
|
58943
58943
|
if (n.typeParameters) {
|
|
58944
|
-
parts.push(path2.call(
|
|
58944
|
+
parts.push(path2.call(print11, "typeParameters"));
|
|
58945
58945
|
}
|
|
58946
58946
|
if (n.superClass) {
|
|
58947
|
-
parts.push(" extends ", path2.call(
|
|
58947
|
+
parts.push(" extends ", path2.call(print11, "superClass"), path2.call(print11, "superTypeParameters"));
|
|
58948
58948
|
}
|
|
58949
58949
|
if (n.extends && n.extends.length > 0) {
|
|
58950
|
-
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(
|
|
58950
|
+
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(print11, "extends")));
|
|
58951
58951
|
}
|
|
58952
58952
|
if (n["implements"] && n["implements"].length > 0) {
|
|
58953
|
-
parts.push(" implements ", (0, lines_1.fromString)(", ").join(path2.map(
|
|
58953
|
+
parts.push(" implements ", (0, lines_1.fromString)(", ").join(path2.map(print11, "implements")));
|
|
58954
58954
|
}
|
|
58955
|
-
parts.push(" ", path2.call(
|
|
58955
|
+
parts.push(" ", path2.call(print11, "body"));
|
|
58956
58956
|
if (n.type === "DeclareClass") {
|
|
58957
58957
|
return printFlowDeclaration(path2, parts);
|
|
58958
58958
|
} else {
|
|
@@ -58961,11 +58961,11 @@ var require_printer2 = __commonJS({
|
|
|
58961
58961
|
case "TemplateElement":
|
|
58962
58962
|
return (0, lines_1.fromString)(n.value.raw, options).lockIndentTail();
|
|
58963
58963
|
case "TemplateLiteral": {
|
|
58964
|
-
var expressions_1 = path2.map(
|
|
58964
|
+
var expressions_1 = path2.map(print11, "expressions");
|
|
58965
58965
|
parts.push("`");
|
|
58966
58966
|
path2.each(function(childPath) {
|
|
58967
58967
|
var i2 = childPath.getName();
|
|
58968
|
-
parts.push(
|
|
58968
|
+
parts.push(print11(childPath));
|
|
58969
58969
|
if (i2 < expressions_1.length) {
|
|
58970
58970
|
parts.push("${", expressions_1[i2], "}");
|
|
58971
58971
|
}
|
|
@@ -58974,7 +58974,7 @@ var require_printer2 = __commonJS({
|
|
|
58974
58974
|
return (0, lines_1.concat)(parts).lockIndentTail();
|
|
58975
58975
|
}
|
|
58976
58976
|
case "TaggedTemplateExpression":
|
|
58977
|
-
return (0, lines_1.concat)([path2.call(
|
|
58977
|
+
return (0, lines_1.concat)([path2.call(print11, "tag"), path2.call(print11, "quasi")]);
|
|
58978
58978
|
case "Node":
|
|
58979
58979
|
case "Printable":
|
|
58980
58980
|
case "SourceLocation":
|
|
@@ -59008,7 +59008,7 @@ var require_printer2 = __commonJS({
|
|
|
59008
59008
|
if (n.typeAnnotation.type !== "FunctionTypeAnnotation") {
|
|
59009
59009
|
parts.push(": ");
|
|
59010
59010
|
}
|
|
59011
|
-
parts.push(path2.call(
|
|
59011
|
+
parts.push(path2.call(print11, "typeAnnotation"));
|
|
59012
59012
|
return (0, lines_1.concat)(parts);
|
|
59013
59013
|
}
|
|
59014
59014
|
return (0, lines_1.fromString)("");
|
|
@@ -59022,9 +59022,9 @@ var require_printer2 = __commonJS({
|
|
|
59022
59022
|
case "MixedTypeAnnotation":
|
|
59023
59023
|
return (0, lines_1.fromString)("mixed", options);
|
|
59024
59024
|
case "ArrayTypeAnnotation":
|
|
59025
|
-
return (0, lines_1.concat)([path2.call(
|
|
59025
|
+
return (0, lines_1.concat)([path2.call(print11, "elementType"), "[]"]);
|
|
59026
59026
|
case "TupleTypeAnnotation": {
|
|
59027
|
-
var printed_2 = path2.map(
|
|
59027
|
+
var printed_2 = path2.map(print11, "types");
|
|
59028
59028
|
var joined = (0, lines_1.fromString)(", ").join(printed_2);
|
|
59029
59029
|
var oneLine_3 = joined.getLineLength(1) <= options.wrapColumn;
|
|
59030
59030
|
if (oneLine_3) {
|
|
@@ -59071,38 +59071,38 @@ var require_printer2 = __commonJS({
|
|
|
59071
59071
|
case "InterfaceTypeAnnotation":
|
|
59072
59072
|
parts.push("interface");
|
|
59073
59073
|
if (n.extends && n.extends.length > 0) {
|
|
59074
|
-
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(
|
|
59074
|
+
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(print11, "extends")));
|
|
59075
59075
|
}
|
|
59076
|
-
parts.push(" ", path2.call(
|
|
59076
|
+
parts.push(" ", path2.call(print11, "body"));
|
|
59077
59077
|
return (0, lines_1.concat)(parts);
|
|
59078
59078
|
case "DeclareFunction":
|
|
59079
59079
|
return printFlowDeclaration(path2, [
|
|
59080
59080
|
"function ",
|
|
59081
|
-
path2.call(
|
|
59081
|
+
path2.call(print11, "id"),
|
|
59082
59082
|
";"
|
|
59083
59083
|
]);
|
|
59084
59084
|
case "DeclareModule":
|
|
59085
59085
|
return printFlowDeclaration(path2, [
|
|
59086
59086
|
"module ",
|
|
59087
|
-
path2.call(
|
|
59087
|
+
path2.call(print11, "id"),
|
|
59088
59088
|
" ",
|
|
59089
|
-
path2.call(
|
|
59089
|
+
path2.call(print11, "body")
|
|
59090
59090
|
]);
|
|
59091
59091
|
case "DeclareModuleExports":
|
|
59092
59092
|
return printFlowDeclaration(path2, [
|
|
59093
59093
|
"module.exports",
|
|
59094
|
-
path2.call(
|
|
59094
|
+
path2.call(print11, "typeAnnotation")
|
|
59095
59095
|
]);
|
|
59096
59096
|
case "DeclareVariable":
|
|
59097
|
-
return printFlowDeclaration(path2, ["var ", path2.call(
|
|
59097
|
+
return printFlowDeclaration(path2, ["var ", path2.call(print11, "id"), ";"]);
|
|
59098
59098
|
case "DeclareExportDeclaration":
|
|
59099
59099
|
case "DeclareExportAllDeclaration":
|
|
59100
|
-
return (0, lines_1.concat)(["declare ", printExportDeclaration(path2, options,
|
|
59100
|
+
return (0, lines_1.concat)(["declare ", printExportDeclaration(path2, options, print11)]);
|
|
59101
59101
|
case "EnumDeclaration":
|
|
59102
59102
|
return (0, lines_1.concat)([
|
|
59103
59103
|
"enum ",
|
|
59104
|
-
path2.call(
|
|
59105
|
-
path2.call(
|
|
59104
|
+
path2.call(print11, "id"),
|
|
59105
|
+
path2.call(print11, "body")
|
|
59106
59106
|
]);
|
|
59107
59107
|
case "EnumBooleanBody":
|
|
59108
59108
|
case "EnumNumberBody":
|
|
@@ -59114,24 +59114,24 @@ var require_printer2 = __commonJS({
|
|
|
59114
59114
|
n.type.slice(4, -4).toLowerCase()
|
|
59115
59115
|
);
|
|
59116
59116
|
}
|
|
59117
|
-
parts.push(" {\n", (0, lines_1.fromString)("\n").join(path2.map(
|
|
59117
|
+
parts.push(" {\n", (0, lines_1.fromString)("\n").join(path2.map(print11, "members")).indent(options.tabWidth), "\n}");
|
|
59118
59118
|
return (0, lines_1.concat)(parts);
|
|
59119
59119
|
}
|
|
59120
59120
|
case "EnumDefaultedMember":
|
|
59121
|
-
return (0, lines_1.concat)([path2.call(
|
|
59121
|
+
return (0, lines_1.concat)([path2.call(print11, "id"), ","]);
|
|
59122
59122
|
case "EnumBooleanMember":
|
|
59123
59123
|
case "EnumNumberMember":
|
|
59124
59124
|
case "EnumStringMember":
|
|
59125
59125
|
return (0, lines_1.concat)([
|
|
59126
|
-
path2.call(
|
|
59126
|
+
path2.call(print11, "id"),
|
|
59127
59127
|
" = ",
|
|
59128
|
-
path2.call(
|
|
59128
|
+
path2.call(print11, "init"),
|
|
59129
59129
|
","
|
|
59130
59130
|
]);
|
|
59131
59131
|
case "InferredPredicate":
|
|
59132
59132
|
return (0, lines_1.fromString)("%checks", options);
|
|
59133
59133
|
case "DeclaredPredicate":
|
|
59134
|
-
return (0, lines_1.concat)(["%checks(", path2.call(
|
|
59134
|
+
return (0, lines_1.concat)(["%checks(", path2.call(print11, "value"), ")"]);
|
|
59135
59135
|
case "FunctionTypeAnnotation": {
|
|
59136
59136
|
var parent = path2.getParentNode(0);
|
|
59137
59137
|
var isArrowFunctionTypeAnnotation = !(namedTypes.ObjectTypeCallProperty.check(parent) || namedTypes.ObjectTypeInternalSlot.check(parent) && parent.method || namedTypes.DeclareFunction.check(path2.getParentNode(2)));
|
|
@@ -59141,14 +59141,14 @@ var require_printer2 = __commonJS({
|
|
|
59141
59141
|
}
|
|
59142
59142
|
var hasTypeParameters = !!n.typeParameters;
|
|
59143
59143
|
var needsParens = hasTypeParameters || n.params.length !== 1 || n.params[0].name;
|
|
59144
|
-
parts.push(hasTypeParameters ? path2.call(
|
|
59144
|
+
parts.push(hasTypeParameters ? path2.call(print11, "typeParameters") : "", needsParens ? "(" : "", printFunctionParams(path2, options, print11), needsParens ? ")" : "");
|
|
59145
59145
|
if (n.returnType) {
|
|
59146
|
-
parts.push(isArrowFunctionTypeAnnotation ? " => " : ": ", path2.call(
|
|
59146
|
+
parts.push(isArrowFunctionTypeAnnotation ? " => " : ": ", path2.call(print11, "returnType"));
|
|
59147
59147
|
}
|
|
59148
59148
|
return (0, lines_1.concat)(parts);
|
|
59149
59149
|
}
|
|
59150
59150
|
case "FunctionTypeParam": {
|
|
59151
|
-
var name = path2.call(
|
|
59151
|
+
var name = path2.call(print11, "name");
|
|
59152
59152
|
parts.push(name);
|
|
59153
59153
|
if (n.optional) {
|
|
59154
59154
|
parts.push("?");
|
|
@@ -59156,13 +59156,13 @@ var require_printer2 = __commonJS({
|
|
|
59156
59156
|
if (name.infos[0].line) {
|
|
59157
59157
|
parts.push(": ");
|
|
59158
59158
|
}
|
|
59159
|
-
parts.push(path2.call(
|
|
59159
|
+
parts.push(path2.call(print11, "typeAnnotation"));
|
|
59160
59160
|
return (0, lines_1.concat)(parts);
|
|
59161
59161
|
}
|
|
59162
59162
|
case "GenericTypeAnnotation":
|
|
59163
59163
|
return (0, lines_1.concat)([
|
|
59164
|
-
path2.call(
|
|
59165
|
-
path2.call(
|
|
59164
|
+
path2.call(print11, "id"),
|
|
59165
|
+
path2.call(print11, "typeParameters")
|
|
59166
59166
|
]);
|
|
59167
59167
|
case "DeclareInterface":
|
|
59168
59168
|
parts.push("declare ");
|
|
@@ -59171,24 +59171,24 @@ var require_printer2 = __commonJS({
|
|
|
59171
59171
|
if (n.declare) {
|
|
59172
59172
|
parts.push("declare ");
|
|
59173
59173
|
}
|
|
59174
|
-
parts.push("interface ", path2.call(
|
|
59174
|
+
parts.push("interface ", path2.call(print11, "id"), path2.call(print11, "typeParameters"), " ");
|
|
59175
59175
|
if (n["extends"] && n["extends"].length > 0) {
|
|
59176
|
-
parts.push("extends ", (0, lines_1.fromString)(", ").join(path2.map(
|
|
59176
|
+
parts.push("extends ", (0, lines_1.fromString)(", ").join(path2.map(print11, "extends")), " ");
|
|
59177
59177
|
}
|
|
59178
59178
|
if (n.body) {
|
|
59179
|
-
parts.push(path2.call(
|
|
59179
|
+
parts.push(path2.call(print11, "body"));
|
|
59180
59180
|
}
|
|
59181
59181
|
return (0, lines_1.concat)(parts);
|
|
59182
59182
|
case "ClassImplements":
|
|
59183
59183
|
case "InterfaceExtends":
|
|
59184
59184
|
return (0, lines_1.concat)([
|
|
59185
|
-
path2.call(
|
|
59186
|
-
path2.call(
|
|
59185
|
+
path2.call(print11, "id"),
|
|
59186
|
+
path2.call(print11, "typeParameters")
|
|
59187
59187
|
]);
|
|
59188
59188
|
case "IntersectionTypeAnnotation":
|
|
59189
|
-
return (0, lines_1.fromString)(" & ").join(path2.map(
|
|
59189
|
+
return (0, lines_1.fromString)(" & ").join(path2.map(print11, "types"));
|
|
59190
59190
|
case "NullableTypeAnnotation":
|
|
59191
|
-
return (0, lines_1.concat)(["?", path2.call(
|
|
59191
|
+
return (0, lines_1.concat)(["?", path2.call(print11, "typeAnnotation")]);
|
|
59192
59192
|
case "NullLiteralTypeAnnotation":
|
|
59193
59193
|
return (0, lines_1.fromString)("null", options);
|
|
59194
59194
|
case "ThisTypeAnnotation":
|
|
@@ -59196,40 +59196,40 @@ var require_printer2 = __commonJS({
|
|
|
59196
59196
|
case "NumberTypeAnnotation":
|
|
59197
59197
|
return (0, lines_1.fromString)("number", options);
|
|
59198
59198
|
case "ObjectTypeCallProperty":
|
|
59199
|
-
return path2.call(
|
|
59199
|
+
return path2.call(print11, "value");
|
|
59200
59200
|
case "ObjectTypeIndexer":
|
|
59201
59201
|
if (n.static) {
|
|
59202
59202
|
parts.push("static ");
|
|
59203
59203
|
}
|
|
59204
|
-
parts.push(printVariance(path2,
|
|
59204
|
+
parts.push(printVariance(path2, print11), "[");
|
|
59205
59205
|
if (n.id) {
|
|
59206
|
-
parts.push(path2.call(
|
|
59206
|
+
parts.push(path2.call(print11, "id"), ": ");
|
|
59207
59207
|
}
|
|
59208
|
-
parts.push(path2.call(
|
|
59208
|
+
parts.push(path2.call(print11, "key"), "]: ", path2.call(print11, "value"));
|
|
59209
59209
|
return (0, lines_1.concat)(parts);
|
|
59210
59210
|
case "ObjectTypeProperty":
|
|
59211
59211
|
return (0, lines_1.concat)([
|
|
59212
|
-
printVariance(path2,
|
|
59213
|
-
path2.call(
|
|
59212
|
+
printVariance(path2, print11),
|
|
59213
|
+
path2.call(print11, "key"),
|
|
59214
59214
|
n.optional ? "?" : "",
|
|
59215
59215
|
": ",
|
|
59216
|
-
path2.call(
|
|
59216
|
+
path2.call(print11, "value")
|
|
59217
59217
|
]);
|
|
59218
59218
|
case "ObjectTypeInternalSlot":
|
|
59219
59219
|
return (0, lines_1.concat)([
|
|
59220
59220
|
n.static ? "static " : "",
|
|
59221
59221
|
"[[",
|
|
59222
|
-
path2.call(
|
|
59222
|
+
path2.call(print11, "id"),
|
|
59223
59223
|
"]]",
|
|
59224
59224
|
n.optional ? "?" : "",
|
|
59225
59225
|
n.value.type !== "FunctionTypeAnnotation" ? ": " : "",
|
|
59226
|
-
path2.call(
|
|
59226
|
+
path2.call(print11, "value")
|
|
59227
59227
|
]);
|
|
59228
59228
|
case "QualifiedTypeIdentifier":
|
|
59229
59229
|
return (0, lines_1.concat)([
|
|
59230
|
-
path2.call(
|
|
59230
|
+
path2.call(print11, "qualification"),
|
|
59231
59231
|
".",
|
|
59232
|
-
path2.call(
|
|
59232
|
+
path2.call(print11, "id")
|
|
59233
59233
|
]);
|
|
59234
59234
|
case "StringLiteralTypeAnnotation":
|
|
59235
59235
|
return (0, lines_1.fromString)(nodeStr(n.value, options), options);
|
|
@@ -59246,36 +59246,36 @@ var require_printer2 = __commonJS({
|
|
|
59246
59246
|
case "TypeAlias":
|
|
59247
59247
|
return (0, lines_1.concat)([
|
|
59248
59248
|
"type ",
|
|
59249
|
-
path2.call(
|
|
59250
|
-
path2.call(
|
|
59249
|
+
path2.call(print11, "id"),
|
|
59250
|
+
path2.call(print11, "typeParameters"),
|
|
59251
59251
|
" = ",
|
|
59252
|
-
path2.call(
|
|
59252
|
+
path2.call(print11, "right"),
|
|
59253
59253
|
";"
|
|
59254
59254
|
]);
|
|
59255
59255
|
case "DeclareOpaqueType":
|
|
59256
59256
|
parts.push("declare ");
|
|
59257
59257
|
case "OpaqueType":
|
|
59258
|
-
parts.push("opaque type ", path2.call(
|
|
59258
|
+
parts.push("opaque type ", path2.call(print11, "id"), path2.call(print11, "typeParameters"));
|
|
59259
59259
|
if (n["supertype"]) {
|
|
59260
|
-
parts.push(": ", path2.call(
|
|
59260
|
+
parts.push(": ", path2.call(print11, "supertype"));
|
|
59261
59261
|
}
|
|
59262
59262
|
if (n["impltype"]) {
|
|
59263
|
-
parts.push(" = ", path2.call(
|
|
59263
|
+
parts.push(" = ", path2.call(print11, "impltype"));
|
|
59264
59264
|
}
|
|
59265
59265
|
parts.push(";");
|
|
59266
59266
|
return (0, lines_1.concat)(parts);
|
|
59267
59267
|
case "TypeCastExpression":
|
|
59268
59268
|
return (0, lines_1.concat)([
|
|
59269
59269
|
"(",
|
|
59270
|
-
path2.call(
|
|
59271
|
-
path2.call(
|
|
59270
|
+
path2.call(print11, "expression"),
|
|
59271
|
+
path2.call(print11, "typeAnnotation"),
|
|
59272
59272
|
")"
|
|
59273
59273
|
]);
|
|
59274
59274
|
case "TypeParameterDeclaration":
|
|
59275
59275
|
case "TypeParameterInstantiation":
|
|
59276
59276
|
return (0, lines_1.concat)([
|
|
59277
59277
|
"<",
|
|
59278
|
-
(0, lines_1.fromString)(", ").join(path2.map(
|
|
59278
|
+
(0, lines_1.fromString)(", ").join(path2.map(print11, "params")),
|
|
59279
59279
|
">"
|
|
59280
59280
|
]);
|
|
59281
59281
|
case "Variance":
|
|
@@ -59288,32 +59288,32 @@ var require_printer2 = __commonJS({
|
|
|
59288
59288
|
return (0, lines_1.fromString)("");
|
|
59289
59289
|
case "TypeParameter":
|
|
59290
59290
|
if (n.variance) {
|
|
59291
|
-
parts.push(printVariance(path2,
|
|
59291
|
+
parts.push(printVariance(path2, print11));
|
|
59292
59292
|
}
|
|
59293
|
-
parts.push(path2.call(
|
|
59293
|
+
parts.push(path2.call(print11, "name"));
|
|
59294
59294
|
if (n.bound) {
|
|
59295
|
-
parts.push(path2.call(
|
|
59295
|
+
parts.push(path2.call(print11, "bound"));
|
|
59296
59296
|
}
|
|
59297
59297
|
if (n["default"]) {
|
|
59298
|
-
parts.push("=", path2.call(
|
|
59298
|
+
parts.push("=", path2.call(print11, "default"));
|
|
59299
59299
|
}
|
|
59300
59300
|
return (0, lines_1.concat)(parts);
|
|
59301
59301
|
case "TypeofTypeAnnotation":
|
|
59302
59302
|
return (0, lines_1.concat)([
|
|
59303
59303
|
(0, lines_1.fromString)("typeof ", options),
|
|
59304
|
-
path2.call(
|
|
59304
|
+
path2.call(print11, "argument")
|
|
59305
59305
|
]);
|
|
59306
59306
|
case "IndexedAccessType":
|
|
59307
59307
|
case "OptionalIndexedAccessType":
|
|
59308
59308
|
return (0, lines_1.concat)([
|
|
59309
|
-
path2.call(
|
|
59309
|
+
path2.call(print11, "objectType"),
|
|
59310
59310
|
n.optional ? "?." : "",
|
|
59311
59311
|
"[",
|
|
59312
|
-
path2.call(
|
|
59312
|
+
path2.call(print11, "indexType"),
|
|
59313
59313
|
"]"
|
|
59314
59314
|
]);
|
|
59315
59315
|
case "UnionTypeAnnotation":
|
|
59316
|
-
return (0, lines_1.fromString)(" | ").join(path2.map(
|
|
59316
|
+
return (0, lines_1.fromString)(" | ").join(path2.map(print11, "types"));
|
|
59317
59317
|
case "VoidTypeAnnotation":
|
|
59318
59318
|
return (0, lines_1.fromString)("void", options);
|
|
59319
59319
|
case "NullTypeAnnotation":
|
|
@@ -59353,77 +59353,77 @@ var require_printer2 = __commonJS({
|
|
|
59353
59353
|
case "TSNeverKeyword":
|
|
59354
59354
|
return (0, lines_1.fromString)("never", options);
|
|
59355
59355
|
case "TSArrayType":
|
|
59356
|
-
return (0, lines_1.concat)([path2.call(
|
|
59356
|
+
return (0, lines_1.concat)([path2.call(print11, "elementType"), "[]"]);
|
|
59357
59357
|
case "TSLiteralType":
|
|
59358
|
-
return path2.call(
|
|
59358
|
+
return path2.call(print11, "literal");
|
|
59359
59359
|
case "TSUnionType":
|
|
59360
|
-
return (0, lines_1.fromString)(" | ").join(path2.map(
|
|
59360
|
+
return (0, lines_1.fromString)(" | ").join(path2.map(print11, "types"));
|
|
59361
59361
|
case "TSIntersectionType":
|
|
59362
|
-
return (0, lines_1.fromString)(" & ").join(path2.map(
|
|
59362
|
+
return (0, lines_1.fromString)(" & ").join(path2.map(print11, "types"));
|
|
59363
59363
|
case "TSConditionalType":
|
|
59364
|
-
parts.push(path2.call(
|
|
59364
|
+
parts.push(path2.call(print11, "checkType"), " extends ", path2.call(print11, "extendsType"), " ? ", path2.call(print11, "trueType"), " : ", path2.call(print11, "falseType"));
|
|
59365
59365
|
return (0, lines_1.concat)(parts);
|
|
59366
59366
|
case "TSInferType":
|
|
59367
|
-
parts.push("infer ", path2.call(
|
|
59367
|
+
parts.push("infer ", path2.call(print11, "typeParameter"));
|
|
59368
59368
|
return (0, lines_1.concat)(parts);
|
|
59369
59369
|
case "TSParenthesizedType":
|
|
59370
|
-
return (0, lines_1.concat)(["(", path2.call(
|
|
59370
|
+
return (0, lines_1.concat)(["(", path2.call(print11, "typeAnnotation"), ")"]);
|
|
59371
59371
|
case "TSFunctionType":
|
|
59372
59372
|
return (0, lines_1.concat)([
|
|
59373
|
-
path2.call(
|
|
59373
|
+
path2.call(print11, "typeParameters"),
|
|
59374
59374
|
"(",
|
|
59375
|
-
printFunctionParams(path2, options,
|
|
59375
|
+
printFunctionParams(path2, options, print11),
|
|
59376
59376
|
") => ",
|
|
59377
|
-
path2.call(
|
|
59377
|
+
path2.call(print11, "typeAnnotation", "typeAnnotation")
|
|
59378
59378
|
]);
|
|
59379
59379
|
case "TSConstructorType":
|
|
59380
59380
|
return (0, lines_1.concat)([
|
|
59381
59381
|
"new ",
|
|
59382
|
-
path2.call(
|
|
59382
|
+
path2.call(print11, "typeParameters"),
|
|
59383
59383
|
"(",
|
|
59384
|
-
printFunctionParams(path2, options,
|
|
59384
|
+
printFunctionParams(path2, options, print11),
|
|
59385
59385
|
") => ",
|
|
59386
|
-
path2.call(
|
|
59386
|
+
path2.call(print11, "typeAnnotation", "typeAnnotation")
|
|
59387
59387
|
]);
|
|
59388
59388
|
case "TSMappedType": {
|
|
59389
|
-
parts.push(n.readonly ? "readonly " : "", "[", path2.call(
|
|
59389
|
+
parts.push(n.readonly ? "readonly " : "", "[", path2.call(print11, "typeParameter"), "]", n.optional ? "?" : "");
|
|
59390
59390
|
if (n.typeAnnotation) {
|
|
59391
|
-
parts.push(": ", path2.call(
|
|
59391
|
+
parts.push(": ", path2.call(print11, "typeAnnotation"), ";");
|
|
59392
59392
|
}
|
|
59393
59393
|
return (0, lines_1.concat)(["{\n", (0, lines_1.concat)(parts).indent(options.tabWidth), "\n}"]);
|
|
59394
59394
|
}
|
|
59395
59395
|
case "TSTupleType":
|
|
59396
59396
|
return (0, lines_1.concat)([
|
|
59397
59397
|
"[",
|
|
59398
|
-
(0, lines_1.fromString)(", ").join(path2.map(
|
|
59398
|
+
(0, lines_1.fromString)(", ").join(path2.map(print11, "elementTypes")),
|
|
59399
59399
|
"]"
|
|
59400
59400
|
]);
|
|
59401
59401
|
case "TSNamedTupleMember":
|
|
59402
|
-
parts.push(path2.call(
|
|
59402
|
+
parts.push(path2.call(print11, "label"));
|
|
59403
59403
|
if (n.optional) {
|
|
59404
59404
|
parts.push("?");
|
|
59405
59405
|
}
|
|
59406
|
-
parts.push(": ", path2.call(
|
|
59406
|
+
parts.push(": ", path2.call(print11, "elementType"));
|
|
59407
59407
|
return (0, lines_1.concat)(parts);
|
|
59408
59408
|
case "TSRestType":
|
|
59409
|
-
return (0, lines_1.concat)(["...", path2.call(
|
|
59409
|
+
return (0, lines_1.concat)(["...", path2.call(print11, "typeAnnotation")]);
|
|
59410
59410
|
case "TSOptionalType":
|
|
59411
|
-
return (0, lines_1.concat)([path2.call(
|
|
59411
|
+
return (0, lines_1.concat)([path2.call(print11, "typeAnnotation"), "?"]);
|
|
59412
59412
|
case "TSIndexedAccessType":
|
|
59413
59413
|
return (0, lines_1.concat)([
|
|
59414
|
-
path2.call(
|
|
59414
|
+
path2.call(print11, "objectType"),
|
|
59415
59415
|
"[",
|
|
59416
|
-
path2.call(
|
|
59416
|
+
path2.call(print11, "indexType"),
|
|
59417
59417
|
"]"
|
|
59418
59418
|
]);
|
|
59419
59419
|
case "TSTypeOperator":
|
|
59420
59420
|
return (0, lines_1.concat)([
|
|
59421
|
-
path2.call(
|
|
59421
|
+
path2.call(print11, "operator"),
|
|
59422
59422
|
" ",
|
|
59423
|
-
path2.call(
|
|
59423
|
+
path2.call(print11, "typeAnnotation")
|
|
59424
59424
|
]);
|
|
59425
59425
|
case "TSTypeLiteral": {
|
|
59426
|
-
var members = (0, lines_1.fromString)("\n").join(path2.map(
|
|
59426
|
+
var members = (0, lines_1.fromString)("\n").join(path2.map(print11, "members").map(function(member) {
|
|
59427
59427
|
if (lastNonSpaceCharacter(member) !== ";") {
|
|
59428
59428
|
return member.concat(";");
|
|
59429
59429
|
}
|
|
@@ -59436,13 +59436,13 @@ var require_printer2 = __commonJS({
|
|
|
59436
59436
|
return (0, lines_1.concat)(parts);
|
|
59437
59437
|
}
|
|
59438
59438
|
case "TSEnumMember":
|
|
59439
|
-
parts.push(path2.call(
|
|
59439
|
+
parts.push(path2.call(print11, "id"));
|
|
59440
59440
|
if (n.initializer) {
|
|
59441
|
-
parts.push(" = ", path2.call(
|
|
59441
|
+
parts.push(" = ", path2.call(print11, "initializer"));
|
|
59442
59442
|
}
|
|
59443
59443
|
return (0, lines_1.concat)(parts);
|
|
59444
59444
|
case "TSTypeQuery":
|
|
59445
|
-
return (0, lines_1.concat)(["typeof ", path2.call(
|
|
59445
|
+
return (0, lines_1.concat)(["typeof ", path2.call(print11, "exprName")]);
|
|
59446
59446
|
case "TSParameterProperty":
|
|
59447
59447
|
if (n.accessibility) {
|
|
59448
59448
|
parts.push(n.accessibility, " ");
|
|
@@ -59456,119 +59456,119 @@ var require_printer2 = __commonJS({
|
|
|
59456
59456
|
if (n.readonly) {
|
|
59457
59457
|
parts.push("readonly ");
|
|
59458
59458
|
}
|
|
59459
|
-
parts.push(path2.call(
|
|
59459
|
+
parts.push(path2.call(print11, "parameter"));
|
|
59460
59460
|
return (0, lines_1.concat)(parts);
|
|
59461
59461
|
case "TSTypeReference":
|
|
59462
59462
|
return (0, lines_1.concat)([
|
|
59463
|
-
path2.call(
|
|
59464
|
-
path2.call(
|
|
59463
|
+
path2.call(print11, "typeName"),
|
|
59464
|
+
path2.call(print11, "typeParameters")
|
|
59465
59465
|
]);
|
|
59466
59466
|
case "TSQualifiedName":
|
|
59467
|
-
return (0, lines_1.concat)([path2.call(
|
|
59467
|
+
return (0, lines_1.concat)([path2.call(print11, "left"), ".", path2.call(print11, "right")]);
|
|
59468
59468
|
case "TSAsExpression":
|
|
59469
59469
|
case "TSSatisfiesExpression": {
|
|
59470
|
-
var expression = path2.call(
|
|
59471
|
-
parts.push(expression, n.type === "TSSatisfiesExpression" ? " satisfies " : " as ", path2.call(
|
|
59470
|
+
var expression = path2.call(print11, "expression");
|
|
59471
|
+
parts.push(expression, n.type === "TSSatisfiesExpression" ? " satisfies " : " as ", path2.call(print11, "typeAnnotation"));
|
|
59472
59472
|
return (0, lines_1.concat)(parts);
|
|
59473
59473
|
}
|
|
59474
59474
|
case "TSTypeCastExpression":
|
|
59475
59475
|
return (0, lines_1.concat)([
|
|
59476
|
-
path2.call(
|
|
59477
|
-
path2.call(
|
|
59476
|
+
path2.call(print11, "expression"),
|
|
59477
|
+
path2.call(print11, "typeAnnotation")
|
|
59478
59478
|
]);
|
|
59479
59479
|
case "TSNonNullExpression":
|
|
59480
|
-
return (0, lines_1.concat)([path2.call(
|
|
59480
|
+
return (0, lines_1.concat)([path2.call(print11, "expression"), "!"]);
|
|
59481
59481
|
case "TSTypeAnnotation":
|
|
59482
|
-
return (0, lines_1.concat)([": ", path2.call(
|
|
59482
|
+
return (0, lines_1.concat)([": ", path2.call(print11, "typeAnnotation")]);
|
|
59483
59483
|
case "TSIndexSignature":
|
|
59484
59484
|
return (0, lines_1.concat)([
|
|
59485
59485
|
n.readonly ? "readonly " : "",
|
|
59486
59486
|
"[",
|
|
59487
|
-
path2.map(
|
|
59487
|
+
path2.map(print11, "parameters"),
|
|
59488
59488
|
"]",
|
|
59489
|
-
path2.call(
|
|
59489
|
+
path2.call(print11, "typeAnnotation")
|
|
59490
59490
|
]);
|
|
59491
59491
|
case "TSPropertySignature":
|
|
59492
|
-
parts.push(printVariance(path2,
|
|
59492
|
+
parts.push(printVariance(path2, print11), n.readonly ? "readonly " : "");
|
|
59493
59493
|
if (n.computed) {
|
|
59494
|
-
parts.push("[", path2.call(
|
|
59494
|
+
parts.push("[", path2.call(print11, "key"), "]");
|
|
59495
59495
|
} else {
|
|
59496
|
-
parts.push(path2.call(
|
|
59496
|
+
parts.push(path2.call(print11, "key"));
|
|
59497
59497
|
}
|
|
59498
|
-
parts.push(n.optional ? "?" : "", path2.call(
|
|
59498
|
+
parts.push(n.optional ? "?" : "", path2.call(print11, "typeAnnotation"));
|
|
59499
59499
|
return (0, lines_1.concat)(parts);
|
|
59500
59500
|
case "TSMethodSignature":
|
|
59501
59501
|
if (n.computed) {
|
|
59502
|
-
parts.push("[", path2.call(
|
|
59502
|
+
parts.push("[", path2.call(print11, "key"), "]");
|
|
59503
59503
|
} else {
|
|
59504
|
-
parts.push(path2.call(
|
|
59504
|
+
parts.push(path2.call(print11, "key"));
|
|
59505
59505
|
}
|
|
59506
59506
|
if (n.optional) {
|
|
59507
59507
|
parts.push("?");
|
|
59508
59508
|
}
|
|
59509
|
-
parts.push(path2.call(
|
|
59509
|
+
parts.push(path2.call(print11, "typeParameters"), "(", printFunctionParams(path2, options, print11), ")", path2.call(print11, "typeAnnotation"));
|
|
59510
59510
|
return (0, lines_1.concat)(parts);
|
|
59511
59511
|
case "TSTypePredicate":
|
|
59512
59512
|
if (n.asserts) {
|
|
59513
59513
|
parts.push("asserts ");
|
|
59514
59514
|
}
|
|
59515
|
-
parts.push(path2.call(
|
|
59515
|
+
parts.push(path2.call(print11, "parameterName"));
|
|
59516
59516
|
if (n.typeAnnotation) {
|
|
59517
|
-
parts.push(" is ", path2.call(
|
|
59517
|
+
parts.push(" is ", path2.call(print11, "typeAnnotation", "typeAnnotation"));
|
|
59518
59518
|
}
|
|
59519
59519
|
return (0, lines_1.concat)(parts);
|
|
59520
59520
|
case "TSCallSignatureDeclaration":
|
|
59521
59521
|
return (0, lines_1.concat)([
|
|
59522
|
-
path2.call(
|
|
59522
|
+
path2.call(print11, "typeParameters"),
|
|
59523
59523
|
"(",
|
|
59524
|
-
printFunctionParams(path2, options,
|
|
59524
|
+
printFunctionParams(path2, options, print11),
|
|
59525
59525
|
")",
|
|
59526
|
-
path2.call(
|
|
59526
|
+
path2.call(print11, "typeAnnotation")
|
|
59527
59527
|
]);
|
|
59528
59528
|
case "TSConstructSignatureDeclaration":
|
|
59529
59529
|
if (n.typeParameters) {
|
|
59530
|
-
parts.push("new", path2.call(
|
|
59530
|
+
parts.push("new", path2.call(print11, "typeParameters"));
|
|
59531
59531
|
} else {
|
|
59532
59532
|
parts.push("new ");
|
|
59533
59533
|
}
|
|
59534
|
-
parts.push("(", printFunctionParams(path2, options,
|
|
59534
|
+
parts.push("(", printFunctionParams(path2, options, print11), ")", path2.call(print11, "typeAnnotation"));
|
|
59535
59535
|
return (0, lines_1.concat)(parts);
|
|
59536
59536
|
case "TSTypeAliasDeclaration":
|
|
59537
59537
|
return (0, lines_1.concat)([
|
|
59538
59538
|
n.declare ? "declare " : "",
|
|
59539
59539
|
"type ",
|
|
59540
|
-
path2.call(
|
|
59541
|
-
path2.call(
|
|
59540
|
+
path2.call(print11, "id"),
|
|
59541
|
+
path2.call(print11, "typeParameters"),
|
|
59542
59542
|
" = ",
|
|
59543
|
-
path2.call(
|
|
59543
|
+
path2.call(print11, "typeAnnotation"),
|
|
59544
59544
|
";"
|
|
59545
59545
|
]);
|
|
59546
59546
|
case "TSTypeParameter": {
|
|
59547
|
-
parts.push(path2.call(
|
|
59547
|
+
parts.push(path2.call(print11, "name"));
|
|
59548
59548
|
var parent = path2.getParentNode(0);
|
|
59549
59549
|
var isInMappedType = namedTypes.TSMappedType.check(parent);
|
|
59550
59550
|
if (n.constraint) {
|
|
59551
|
-
parts.push(isInMappedType ? " in " : " extends ", path2.call(
|
|
59551
|
+
parts.push(isInMappedType ? " in " : " extends ", path2.call(print11, "constraint"));
|
|
59552
59552
|
}
|
|
59553
59553
|
if (n["default"]) {
|
|
59554
|
-
parts.push(" = ", path2.call(
|
|
59554
|
+
parts.push(" = ", path2.call(print11, "default"));
|
|
59555
59555
|
}
|
|
59556
59556
|
return (0, lines_1.concat)(parts);
|
|
59557
59557
|
}
|
|
59558
59558
|
case "TSTypeAssertion": {
|
|
59559
|
-
parts.push("<", path2.call(
|
|
59559
|
+
parts.push("<", path2.call(print11, "typeAnnotation"), "> ", path2.call(print11, "expression"));
|
|
59560
59560
|
return (0, lines_1.concat)(parts);
|
|
59561
59561
|
}
|
|
59562
59562
|
case "TSTypeParameterDeclaration":
|
|
59563
59563
|
case "TSTypeParameterInstantiation":
|
|
59564
59564
|
return (0, lines_1.concat)([
|
|
59565
59565
|
"<",
|
|
59566
|
-
(0, lines_1.fromString)(", ").join(path2.map(
|
|
59566
|
+
(0, lines_1.fromString)(", ").join(path2.map(print11, "params")),
|
|
59567
59567
|
">"
|
|
59568
59568
|
]);
|
|
59569
59569
|
case "TSEnumDeclaration": {
|
|
59570
|
-
parts.push(n.declare ? "declare " : "", n.const ? "const " : "", "enum ", path2.call(
|
|
59571
|
-
var memberLines = (0, lines_1.fromString)(",\n").join(path2.map(
|
|
59570
|
+
parts.push(n.declare ? "declare " : "", n.const ? "const " : "", "enum ", path2.call(print11, "id"));
|
|
59571
|
+
var memberLines = (0, lines_1.fromString)(",\n").join(path2.map(print11, "members"));
|
|
59572
59572
|
if (memberLines.isEmpty()) {
|
|
59573
59573
|
parts.push(" {}");
|
|
59574
59574
|
} else {
|
|
@@ -59578,11 +59578,11 @@ var require_printer2 = __commonJS({
|
|
|
59578
59578
|
}
|
|
59579
59579
|
case "TSExpressionWithTypeArguments":
|
|
59580
59580
|
return (0, lines_1.concat)([
|
|
59581
|
-
path2.call(
|
|
59582
|
-
path2.call(
|
|
59581
|
+
path2.call(print11, "expression"),
|
|
59582
|
+
path2.call(print11, "typeParameters")
|
|
59583
59583
|
]);
|
|
59584
59584
|
case "TSInterfaceBody": {
|
|
59585
|
-
var lines = (0, lines_1.fromString)("\n").join(path2.map(
|
|
59585
|
+
var lines = (0, lines_1.fromString)("\n").join(path2.map(print11, "body").map(function(element) {
|
|
59586
59586
|
if (lastNonSpaceCharacter(element) !== ";") {
|
|
59587
59587
|
return element.concat(";");
|
|
59588
59588
|
}
|
|
@@ -59594,22 +59594,22 @@ var require_printer2 = __commonJS({
|
|
|
59594
59594
|
return (0, lines_1.concat)(["{\n", lines.indent(options.tabWidth), "\n}"]);
|
|
59595
59595
|
}
|
|
59596
59596
|
case "TSImportType":
|
|
59597
|
-
parts.push("import(", path2.call(
|
|
59597
|
+
parts.push("import(", path2.call(print11, "argument"), ")");
|
|
59598
59598
|
if (n.qualifier) {
|
|
59599
|
-
parts.push(".", path2.call(
|
|
59599
|
+
parts.push(".", path2.call(print11, "qualifier"));
|
|
59600
59600
|
}
|
|
59601
59601
|
if (n.typeParameters) {
|
|
59602
|
-
parts.push(path2.call(
|
|
59602
|
+
parts.push(path2.call(print11, "typeParameters"));
|
|
59603
59603
|
}
|
|
59604
59604
|
return (0, lines_1.concat)(parts);
|
|
59605
59605
|
case "TSImportEqualsDeclaration":
|
|
59606
59606
|
if (n.isExport) {
|
|
59607
59607
|
parts.push("export ");
|
|
59608
59608
|
}
|
|
59609
|
-
parts.push("import ", path2.call(
|
|
59609
|
+
parts.push("import ", path2.call(print11, "id"), " = ", path2.call(print11, "moduleReference"));
|
|
59610
59610
|
return maybeAddSemicolon((0, lines_1.concat)(parts));
|
|
59611
59611
|
case "TSExternalModuleReference":
|
|
59612
|
-
return (0, lines_1.concat)(["require(", path2.call(
|
|
59612
|
+
return (0, lines_1.concat)(["require(", path2.call(print11, "expression"), ")"]);
|
|
59613
59613
|
case "TSModuleDeclaration": {
|
|
59614
59614
|
var parent = path2.getParentNode();
|
|
59615
59615
|
if (parent.type === "TSModuleDeclaration") {
|
|
@@ -59634,16 +59634,16 @@ var require_printer2 = __commonJS({
|
|
|
59634
59634
|
}
|
|
59635
59635
|
}
|
|
59636
59636
|
}
|
|
59637
|
-
parts.push(path2.call(
|
|
59637
|
+
parts.push(path2.call(print11, "id"));
|
|
59638
59638
|
if (n.body) {
|
|
59639
59639
|
parts.push(" ");
|
|
59640
|
-
parts.push(path2.call(
|
|
59640
|
+
parts.push(path2.call(print11, "body"));
|
|
59641
59641
|
}
|
|
59642
59642
|
return (0, lines_1.concat)(parts);
|
|
59643
59643
|
}
|
|
59644
59644
|
case "TSModuleBlock": {
|
|
59645
59645
|
var naked = path2.call(function(bodyPath) {
|
|
59646
|
-
return printStatementSequence(bodyPath, options,
|
|
59646
|
+
return printStatementSequence(bodyPath, options, print11);
|
|
59647
59647
|
}, "body");
|
|
59648
59648
|
if (naked.isEmpty()) {
|
|
59649
59649
|
parts.push("{}");
|
|
@@ -59653,11 +59653,11 @@ var require_printer2 = __commonJS({
|
|
|
59653
59653
|
return (0, lines_1.concat)(parts);
|
|
59654
59654
|
}
|
|
59655
59655
|
case "TSInstantiationExpression": {
|
|
59656
|
-
parts.push(path2.call(
|
|
59656
|
+
parts.push(path2.call(print11, "expression"), path2.call(print11, "typeParameters"));
|
|
59657
59657
|
return (0, lines_1.concat)(parts);
|
|
59658
59658
|
}
|
|
59659
59659
|
case "V8IntrinsicIdentifier":
|
|
59660
|
-
return (0, lines_1.concat)(["%", path2.call(
|
|
59660
|
+
return (0, lines_1.concat)(["%", path2.call(print11, "name")]);
|
|
59661
59661
|
case "TopicReference":
|
|
59662
59662
|
return (0, lines_1.fromString)("#");
|
|
59663
59663
|
case "ClassHeritage":
|
|
@@ -59707,7 +59707,7 @@ var require_printer2 = __commonJS({
|
|
|
59707
59707
|
}
|
|
59708
59708
|
return (0, lines_1.concat)(parts);
|
|
59709
59709
|
}
|
|
59710
|
-
function printStatementSequence(path2, options,
|
|
59710
|
+
function printStatementSequence(path2, options, print11) {
|
|
59711
59711
|
var filtered = [];
|
|
59712
59712
|
var sawComment = false;
|
|
59713
59713
|
var sawStatement = false;
|
|
@@ -59728,7 +59728,7 @@ var require_printer2 = __commonJS({
|
|
|
59728
59728
|
}
|
|
59729
59729
|
filtered.push({
|
|
59730
59730
|
node: stmt,
|
|
59731
|
-
printed:
|
|
59731
|
+
printed: print11(stmtPath)
|
|
59732
59732
|
});
|
|
59733
59733
|
});
|
|
59734
59734
|
if (sawComment) {
|
|
@@ -59820,7 +59820,7 @@ var require_printer2 = __commonJS({
|
|
|
59820
59820
|
}
|
|
59821
59821
|
return parts;
|
|
59822
59822
|
}
|
|
59823
|
-
function printMethod(path2, options,
|
|
59823
|
+
function printMethod(path2, options, print11) {
|
|
59824
59824
|
var node = path2.getNode();
|
|
59825
59825
|
var kind = node.kind;
|
|
59826
59826
|
var parts = [];
|
|
@@ -59838,7 +59838,7 @@ var require_printer2 = __commonJS({
|
|
|
59838
59838
|
if (kind === "get" || kind === "set") {
|
|
59839
59839
|
parts.push(kind, " ");
|
|
59840
59840
|
}
|
|
59841
|
-
var key = path2.call(
|
|
59841
|
+
var key = path2.call(print11, "key");
|
|
59842
59842
|
if (node.computed) {
|
|
59843
59843
|
key = (0, lines_1.concat)(["[", key, "]"]);
|
|
59844
59844
|
}
|
|
@@ -59847,26 +59847,26 @@ var require_printer2 = __commonJS({
|
|
|
59847
59847
|
parts.push("?");
|
|
59848
59848
|
}
|
|
59849
59849
|
if (node === nodeValue) {
|
|
59850
|
-
parts.push(path2.call(
|
|
59850
|
+
parts.push(path2.call(print11, "typeParameters"), "(", printFunctionParams(path2, options, print11), ")", path2.call(print11, "returnType"));
|
|
59851
59851
|
if (node.body) {
|
|
59852
|
-
parts.push(" ", path2.call(
|
|
59852
|
+
parts.push(" ", path2.call(print11, "body"));
|
|
59853
59853
|
} else {
|
|
59854
59854
|
parts.push(";");
|
|
59855
59855
|
}
|
|
59856
59856
|
} else {
|
|
59857
|
-
parts.push(path2.call(
|
|
59858
|
-
return printFunctionParams(valuePath, options,
|
|
59859
|
-
}, "value"), ")", path2.call(
|
|
59857
|
+
parts.push(path2.call(print11, "value", "typeParameters"), "(", path2.call(function(valuePath) {
|
|
59858
|
+
return printFunctionParams(valuePath, options, print11);
|
|
59859
|
+
}, "value"), ")", path2.call(print11, "value", "returnType"));
|
|
59860
59860
|
if (nodeValue.body) {
|
|
59861
|
-
parts.push(" ", path2.call(
|
|
59861
|
+
parts.push(" ", path2.call(print11, "value", "body"));
|
|
59862
59862
|
} else {
|
|
59863
59863
|
parts.push(";");
|
|
59864
59864
|
}
|
|
59865
59865
|
}
|
|
59866
59866
|
return (0, lines_1.concat)(parts);
|
|
59867
59867
|
}
|
|
59868
|
-
function printArgumentsList(path2, options,
|
|
59869
|
-
var printed = path2.map(
|
|
59868
|
+
function printArgumentsList(path2, options, print11) {
|
|
59869
|
+
var printed = path2.map(print11, "arguments");
|
|
59870
59870
|
var trailingComma = util.isTrailingCommaEnabled(options, "parameters");
|
|
59871
59871
|
var joined = (0, lines_1.fromString)(", ").join(printed);
|
|
59872
59872
|
if (joined.getLineLength(1) > options.wrapColumn) {
|
|
@@ -59879,28 +59879,28 @@ var require_printer2 = __commonJS({
|
|
|
59879
59879
|
}
|
|
59880
59880
|
return (0, lines_1.concat)(["(", joined, ")"]);
|
|
59881
59881
|
}
|
|
59882
|
-
function printFunctionParams(path2, options,
|
|
59882
|
+
function printFunctionParams(path2, options, print11) {
|
|
59883
59883
|
var fun = path2.getValue();
|
|
59884
59884
|
var params;
|
|
59885
59885
|
var printed = [];
|
|
59886
59886
|
if (fun.params) {
|
|
59887
59887
|
params = fun.params;
|
|
59888
|
-
printed = path2.map(
|
|
59888
|
+
printed = path2.map(print11, "params");
|
|
59889
59889
|
} else if (fun.parameters) {
|
|
59890
59890
|
params = fun.parameters;
|
|
59891
|
-
printed = path2.map(
|
|
59891
|
+
printed = path2.map(print11, "parameters");
|
|
59892
59892
|
}
|
|
59893
59893
|
if (fun.defaults) {
|
|
59894
59894
|
path2.each(function(defExprPath) {
|
|
59895
59895
|
var i2 = defExprPath.getName();
|
|
59896
59896
|
var p = printed[i2];
|
|
59897
59897
|
if (p && defExprPath.getValue()) {
|
|
59898
|
-
printed[i2] = (0, lines_1.concat)([p, " = ",
|
|
59898
|
+
printed[i2] = (0, lines_1.concat)([p, " = ", print11(defExprPath)]);
|
|
59899
59899
|
}
|
|
59900
59900
|
}, "defaults");
|
|
59901
59901
|
}
|
|
59902
59902
|
if (fun.rest) {
|
|
59903
|
-
printed.push((0, lines_1.concat)(["...", path2.call(
|
|
59903
|
+
printed.push((0, lines_1.concat)(["...", path2.call(print11, "rest")]));
|
|
59904
59904
|
}
|
|
59905
59905
|
var joined = (0, lines_1.fromString)(", ").join(printed);
|
|
59906
59906
|
if (joined.length > 1 || joined.getLineLength(1) > options.wrapColumn) {
|
|
@@ -59914,11 +59914,11 @@ var require_printer2 = __commonJS({
|
|
|
59914
59914
|
}
|
|
59915
59915
|
return joined;
|
|
59916
59916
|
}
|
|
59917
|
-
function maybePrintImportAssertions(path2, options,
|
|
59917
|
+
function maybePrintImportAssertions(path2, options, print11) {
|
|
59918
59918
|
var n = path2.getValue();
|
|
59919
59919
|
if (n.assertions && n.assertions.length > 0) {
|
|
59920
59920
|
var parts = [" assert {"];
|
|
59921
|
-
var printed = path2.map(
|
|
59921
|
+
var printed = path2.map(print11, "assertions");
|
|
59922
59922
|
var flat = (0, lines_1.fromString)(", ").join(printed);
|
|
59923
59923
|
if (flat.length > 1 || flat.getLineLength(1) > options.wrapColumn) {
|
|
59924
59924
|
parts.push("\n", (0, lines_1.fromString)(",\n").join(printed).indent(options.tabWidth), "\n}");
|
|
@@ -59929,7 +59929,7 @@ var require_printer2 = __commonJS({
|
|
|
59929
59929
|
}
|
|
59930
59930
|
return (0, lines_1.fromString)("");
|
|
59931
59931
|
}
|
|
59932
|
-
function printExportDeclaration(path2, options,
|
|
59932
|
+
function printExportDeclaration(path2, options, print11) {
|
|
59933
59933
|
var decl = path2.getValue();
|
|
59934
59934
|
var parts = ["export "];
|
|
59935
59935
|
if (decl.exportKind && decl.exportKind === "type") {
|
|
@@ -59943,7 +59943,7 @@ var require_printer2 = __commonJS({
|
|
|
59943
59943
|
parts.push("default ");
|
|
59944
59944
|
}
|
|
59945
59945
|
if (decl.declaration) {
|
|
59946
|
-
parts.push(path2.call(
|
|
59946
|
+
parts.push(path2.call(print11, "declaration"));
|
|
59947
59947
|
} else if (decl.specifiers) {
|
|
59948
59948
|
if (decl.specifiers.length === 1 && decl.specifiers[0].type === "ExportBatchSpecifier") {
|
|
59949
59949
|
parts.push("*");
|
|
@@ -59955,9 +59955,9 @@ var require_printer2 = __commonJS({
|
|
|
59955
59955
|
path2.each(function(specifierPath) {
|
|
59956
59956
|
var spec = specifierPath.getValue();
|
|
59957
59957
|
if (spec.type === "ExportDefaultSpecifier") {
|
|
59958
|
-
unbracedSpecifiers_2.push(
|
|
59958
|
+
unbracedSpecifiers_2.push(print11(specifierPath));
|
|
59959
59959
|
} else {
|
|
59960
|
-
bracedSpecifiers_2.push(
|
|
59960
|
+
bracedSpecifiers_2.push(print11(specifierPath));
|
|
59961
59961
|
}
|
|
59962
59962
|
}, "specifiers");
|
|
59963
59963
|
unbracedSpecifiers_2.forEach(function(lines2, i2) {
|
|
@@ -59986,10 +59986,10 @@ var require_printer2 = __commonJS({
|
|
|
59986
59986
|
}
|
|
59987
59987
|
}
|
|
59988
59988
|
} else {
|
|
59989
|
-
parts.push(shouldPrintSpaces ? "{ " : "{", (0, lines_1.fromString)(", ").join(path2.map(
|
|
59989
|
+
parts.push(shouldPrintSpaces ? "{ " : "{", (0, lines_1.fromString)(", ").join(path2.map(print11, "specifiers")), shouldPrintSpaces ? " }" : "}");
|
|
59990
59990
|
}
|
|
59991
59991
|
if (decl.source) {
|
|
59992
|
-
parts.push(" from ", path2.call(
|
|
59992
|
+
parts.push(" from ", path2.call(print11, "source"), maybePrintImportAssertions(path2, options, print11));
|
|
59993
59993
|
}
|
|
59994
59994
|
}
|
|
59995
59995
|
var lines = (0, lines_1.concat)(parts);
|
|
@@ -60007,7 +60007,7 @@ var require_printer2 = __commonJS({
|
|
|
60007
60007
|
}
|
|
60008
60008
|
return (0, lines_1.concat)(parts);
|
|
60009
60009
|
}
|
|
60010
|
-
function printVariance(path2,
|
|
60010
|
+
function printVariance(path2, print11) {
|
|
60011
60011
|
return path2.call(function(variancePath) {
|
|
60012
60012
|
var value = variancePath.getValue();
|
|
60013
60013
|
if (value) {
|
|
@@ -60017,7 +60017,7 @@ var require_printer2 = __commonJS({
|
|
|
60017
60017
|
if (value === "minus") {
|
|
60018
60018
|
return (0, lines_1.fromString)("-");
|
|
60019
60019
|
}
|
|
60020
|
-
return
|
|
60020
|
+
return print11(variancePath);
|
|
60021
60021
|
}
|
|
60022
60022
|
return (0, lines_1.fromString)("");
|
|
60023
60023
|
}, "variance");
|
|
@@ -60104,10 +60104,10 @@ var require_main2 = __commonJS({
|
|
|
60104
60104
|
Object.defineProperty(exports, "visit", { enumerable: true, get: function() {
|
|
60105
60105
|
return ast_types_1.visit;
|
|
60106
60106
|
} });
|
|
60107
|
-
function
|
|
60107
|
+
function print11(node, options) {
|
|
60108
60108
|
return new printer_1.Printer(options).print(node);
|
|
60109
60109
|
}
|
|
60110
|
-
exports.print =
|
|
60110
|
+
exports.print = print11;
|
|
60111
60111
|
function prettyPrint3(node, options) {
|
|
60112
60112
|
return new printer_1.Printer(options).printGenerically(node);
|
|
60113
60113
|
}
|
|
@@ -60131,7 +60131,7 @@ var require_main2 = __commonJS({
|
|
|
60131
60131
|
function runString(code, transformer, options) {
|
|
60132
60132
|
var writeback = options && options.writeback || defaultWriteback;
|
|
60133
60133
|
transformer((0, parser_1.parse)(code, options), function(node) {
|
|
60134
|
-
writeback(
|
|
60134
|
+
writeback(print11(node, options).code);
|
|
60135
60135
|
});
|
|
60136
60136
|
}
|
|
60137
60137
|
}
|
|
@@ -68320,7 +68320,7 @@ function mergeSchemas(config2) {
|
|
|
68320
68320
|
// src/lib/config.ts
|
|
68321
68321
|
var graphql2 = __toESM(require_graphql2(), 1);
|
|
68322
68322
|
var import_minimatch = __toESM(require_minimatch(), 1);
|
|
68323
|
-
var
|
|
68323
|
+
var import_node_url2 = require("node:url");
|
|
68324
68324
|
|
|
68325
68325
|
// src/runtime/lib/config.ts
|
|
68326
68326
|
function defaultConfigValues(file) {
|
|
@@ -68423,10 +68423,10 @@ __export(fs_exports, {
|
|
|
68423
68423
|
writeFile: () => writeFile
|
|
68424
68424
|
});
|
|
68425
68425
|
var import_fs_extra = __toESM(require_lib(), 1);
|
|
68426
|
-
var import_promises = __toESM(require("fs/promises"), 1);
|
|
68427
68426
|
var import_glob = __toESM(require_glob(), 1);
|
|
68428
68427
|
var import_memfs = __toESM(require_lib2(), 1);
|
|
68429
|
-
var
|
|
68428
|
+
var import_promises = __toESM(require("node:fs/promises"), 1);
|
|
68429
|
+
var import_node_util = require("node:util");
|
|
68430
68430
|
|
|
68431
68431
|
// src/lib/path.ts
|
|
68432
68432
|
var path_exports = {};
|
|
@@ -68443,36 +68443,36 @@ __export(path_exports, {
|
|
|
68443
68443
|
resolve: () => resolve,
|
|
68444
68444
|
sep: () => sep
|
|
68445
68445
|
});
|
|
68446
|
-
var
|
|
68447
|
-
var
|
|
68446
|
+
var import_node_os = __toESM(require("node:os"), 1);
|
|
68447
|
+
var import_node_path = __toESM(require("node:path"), 1);
|
|
68448
68448
|
var sep = "/";
|
|
68449
68449
|
function resolve(...parts) {
|
|
68450
|
-
return posixify(
|
|
68450
|
+
return posixify(import_node_path.default.resolve(...parts));
|
|
68451
68451
|
}
|
|
68452
68452
|
function join2(...parts) {
|
|
68453
|
-
return posixify(
|
|
68453
|
+
return posixify(import_node_path.default.join(...parts));
|
|
68454
68454
|
}
|
|
68455
68455
|
function extname(target) {
|
|
68456
|
-
return
|
|
68456
|
+
return import_node_path.default.extname(target);
|
|
68457
68457
|
}
|
|
68458
68458
|
function relative(from, to) {
|
|
68459
|
-
return posixify(
|
|
68459
|
+
return posixify(import_node_path.default.relative(from, to));
|
|
68460
68460
|
}
|
|
68461
68461
|
function basename(target) {
|
|
68462
|
-
return
|
|
68462
|
+
return import_node_path.default.basename(target);
|
|
68463
68463
|
}
|
|
68464
68464
|
function dirname(target) {
|
|
68465
|
-
return
|
|
68465
|
+
return import_node_path.default.dirname(target);
|
|
68466
68466
|
}
|
|
68467
68467
|
function isAbsolute(target) {
|
|
68468
|
-
return
|
|
68468
|
+
return import_node_path.default.isAbsolute(target);
|
|
68469
68469
|
}
|
|
68470
68470
|
function parse2(target) {
|
|
68471
|
-
return
|
|
68471
|
+
return import_node_path.default.parse(target);
|
|
68472
68472
|
}
|
|
68473
68473
|
var posixify = (str) => str.replace(/\\/g, "/");
|
|
68474
68474
|
function importPath(target) {
|
|
68475
|
-
return ["win32", "win64"].includes(
|
|
68475
|
+
return ["win32", "win64"].includes(import_node_os.default.platform()) ? "file:///" + target : target;
|
|
68476
68476
|
}
|
|
68477
68477
|
|
|
68478
68478
|
// src/lib/fs.ts
|
|
@@ -68596,7 +68596,7 @@ async function rmdir(filepath) {
|
|
|
68596
68596
|
recursive: true
|
|
68597
68597
|
});
|
|
68598
68598
|
}
|
|
68599
|
-
return await (0,
|
|
68599
|
+
return await (0, import_node_util.promisify)(import_memfs.fs.rmdir)(filepath);
|
|
68600
68600
|
}
|
|
68601
68601
|
async function stat(filepath) {
|
|
68602
68602
|
if (!houdini_mode.is_testing) {
|
|
@@ -68674,7 +68674,7 @@ async function recursiveCopy(source, target, transforms, notRoot) {
|
|
|
68674
68674
|
}
|
|
68675
68675
|
}
|
|
68676
68676
|
async function glob(pattern) {
|
|
68677
|
-
return await (0,
|
|
68677
|
+
return await (0, import_node_util.promisify)(import_glob.glob)(posixify(pattern));
|
|
68678
68678
|
}
|
|
68679
68679
|
glob.hasMagic = import_glob.glob.hasMagic;
|
|
68680
68680
|
|
|
@@ -68729,7 +68729,7 @@ var dist_default = dataUriToBuffer;
|
|
|
68729
68729
|
|
|
68730
68730
|
// ../../node_modules/.pnpm/node-fetch@3.3.0/node_modules/node-fetch/src/body.js
|
|
68731
68731
|
var import_node_stream = __toESM(require("node:stream"), 1);
|
|
68732
|
-
var
|
|
68732
|
+
var import_node_util2 = require("node:util");
|
|
68733
68733
|
var import_node_buffer = require("node:buffer");
|
|
68734
68734
|
init_fetch_blob();
|
|
68735
68735
|
init_esm_min();
|
|
@@ -68783,7 +68783,7 @@ var isSameProtocol = (destination, original) => {
|
|
|
68783
68783
|
};
|
|
68784
68784
|
|
|
68785
68785
|
// ../../node_modules/.pnpm/node-fetch@3.3.0/node_modules/node-fetch/src/body.js
|
|
68786
|
-
var pipeline = (0,
|
|
68786
|
+
var pipeline = (0, import_node_util2.promisify)(import_node_stream.default.pipeline);
|
|
68787
68787
|
var INTERNALS = Symbol("Body internals");
|
|
68788
68788
|
var Body = class {
|
|
68789
68789
|
constructor(body, {
|
|
@@ -68796,7 +68796,7 @@ var Body = class {
|
|
|
68796
68796
|
body = import_node_buffer.Buffer.from(body.toString());
|
|
68797
68797
|
} else if (isBlob(body)) {
|
|
68798
68798
|
} else if (import_node_buffer.Buffer.isBuffer(body)) {
|
|
68799
|
-
} else if (
|
|
68799
|
+
} else if (import_node_util2.types.isAnyArrayBuffer(body)) {
|
|
68800
68800
|
body = import_node_buffer.Buffer.from(body);
|
|
68801
68801
|
} else if (ArrayBuffer.isView(body)) {
|
|
68802
68802
|
body = import_node_buffer.Buffer.from(body.buffer, body.byteOffset, body.byteLength);
|
|
@@ -68870,7 +68870,7 @@ var Body = class {
|
|
|
68870
68870
|
return consumeBody(this);
|
|
68871
68871
|
}
|
|
68872
68872
|
};
|
|
68873
|
-
Body.prototype.buffer = (0,
|
|
68873
|
+
Body.prototype.buffer = (0, import_node_util2.deprecate)(Body.prototype.buffer, "Please use 'response.arrayBuffer()' instead of 'response.buffer()'", "node-fetch#buffer");
|
|
68874
68874
|
Object.defineProperties(Body.prototype, {
|
|
68875
68875
|
body: { enumerable: true },
|
|
68876
68876
|
bodyUsed: { enumerable: true },
|
|
@@ -68878,7 +68878,7 @@ Object.defineProperties(Body.prototype, {
|
|
|
68878
68878
|
blob: { enumerable: true },
|
|
68879
68879
|
json: { enumerable: true },
|
|
68880
68880
|
text: { enumerable: true },
|
|
68881
|
-
data: { get: (0,
|
|
68881
|
+
data: { get: (0, import_node_util2.deprecate)(
|
|
68882
68882
|
() => {
|
|
68883
68883
|
},
|
|
68884
68884
|
"data doesn't exist, use json(), text(), arrayBuffer(), or body instead",
|
|
@@ -68946,7 +68946,7 @@ var clone = (instance, highWaterMark) => {
|
|
|
68946
68946
|
}
|
|
68947
68947
|
return body;
|
|
68948
68948
|
};
|
|
68949
|
-
var getNonSpecFormDataBoundary = (0,
|
|
68949
|
+
var getNonSpecFormDataBoundary = (0, import_node_util2.deprecate)(
|
|
68950
68950
|
(body) => body.getBoundary(),
|
|
68951
68951
|
"form-data doesn't follow the spec and requires special treatment. Use alternative package",
|
|
68952
68952
|
"https://github.com/node-fetch/node-fetch/issues/1167"
|
|
@@ -68964,7 +68964,7 @@ var extractContentType = (body, request) => {
|
|
|
68964
68964
|
if (isBlob(body)) {
|
|
68965
68965
|
return body.type || null;
|
|
68966
68966
|
}
|
|
68967
|
-
if (import_node_buffer.Buffer.isBuffer(body) ||
|
|
68967
|
+
if (import_node_buffer.Buffer.isBuffer(body) || import_node_util2.types.isAnyArrayBuffer(body) || ArrayBuffer.isView(body)) {
|
|
68968
68968
|
return null;
|
|
68969
68969
|
}
|
|
68970
68970
|
if (body instanceof FormData) {
|
|
@@ -69003,7 +69003,7 @@ var writeToStream = async (dest, { body }) => {
|
|
|
69003
69003
|
};
|
|
69004
69004
|
|
|
69005
69005
|
// ../../node_modules/.pnpm/node-fetch@3.3.0/node_modules/node-fetch/src/headers.js
|
|
69006
|
-
var
|
|
69006
|
+
var import_node_util3 = require("node:util");
|
|
69007
69007
|
var import_node_http = __toESM(require("node:http"), 1);
|
|
69008
69008
|
var validateHeaderName = typeof import_node_http.default.validateHeaderName === "function" ? import_node_http.default.validateHeaderName : (name) => {
|
|
69009
69009
|
if (!/^[\^`\-\w!#$%&'*+.|~]+$/.test(name)) {
|
|
@@ -69028,7 +69028,7 @@ var Headers = class extends URLSearchParams {
|
|
|
69028
69028
|
result.push(...values.map((value) => [name, value]));
|
|
69029
69029
|
}
|
|
69030
69030
|
} else if (init2 == null) {
|
|
69031
|
-
} else if (typeof init2 === "object" && !
|
|
69031
|
+
} else if (typeof init2 === "object" && !import_node_util3.types.isBoxedPrimitive(init2)) {
|
|
69032
69032
|
const method = init2[Symbol.iterator];
|
|
69033
69033
|
if (method == null) {
|
|
69034
69034
|
result.push(...Object.entries(init2));
|
|
@@ -69037,7 +69037,7 @@ var Headers = class extends URLSearchParams {
|
|
|
69037
69037
|
throw new TypeError("Header pairs must be iterable");
|
|
69038
69038
|
}
|
|
69039
69039
|
result = [...init2].map((pair) => {
|
|
69040
|
-
if (typeof pair !== "object" ||
|
|
69040
|
+
if (typeof pair !== "object" || import_node_util3.types.isBoxedPrimitive(pair)) {
|
|
69041
69041
|
throw new TypeError("Each header pair must be an iterable object");
|
|
69042
69042
|
}
|
|
69043
69043
|
return [...pair];
|
|
@@ -69284,7 +69284,7 @@ Object.defineProperties(Response.prototype, {
|
|
|
69284
69284
|
|
|
69285
69285
|
// ../../node_modules/.pnpm/node-fetch@3.3.0/node_modules/node-fetch/src/request.js
|
|
69286
69286
|
var import_node_url = require("node:url");
|
|
69287
|
-
var
|
|
69287
|
+
var import_node_util4 = require("node:util");
|
|
69288
69288
|
|
|
69289
69289
|
// ../../node_modules/.pnpm/node-fetch@3.3.0/node_modules/node-fetch/src/utils/get-search.js
|
|
69290
69290
|
var getSearch = (parsedURL) => {
|
|
@@ -69441,7 +69441,7 @@ var INTERNALS3 = Symbol("Request internals");
|
|
|
69441
69441
|
var isRequest = (object) => {
|
|
69442
69442
|
return typeof object === "object" && typeof object[INTERNALS3] === "object";
|
|
69443
69443
|
};
|
|
69444
|
-
var doBadDataWarn = (0,
|
|
69444
|
+
var doBadDataWarn = (0, import_node_util4.deprecate)(
|
|
69445
69445
|
() => {
|
|
69446
69446
|
},
|
|
69447
69447
|
".data is not a valid RequestInit property, use .body instead",
|
|
@@ -69945,7 +69945,7 @@ var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
|
|
|
69945
69945
|
|
|
69946
69946
|
// src/lib/config.ts
|
|
69947
69947
|
var import_meta = {};
|
|
69948
|
-
var currentDir = global.__dirname || dirname((0,
|
|
69948
|
+
var currentDir = global.__dirname || dirname((0, import_node_url2.fileURLToPath)(import_meta.url));
|
|
69949
69949
|
var Config = class {
|
|
69950
69950
|
filepath;
|
|
69951
69951
|
rootDir;
|
|
@@ -70436,13 +70436,16 @@ var pendingConfigPromise = null;
|
|
|
70436
70436
|
async function getConfig({
|
|
70437
70437
|
configPath = DEFAULT_CONFIG_PATH,
|
|
70438
70438
|
noSchema,
|
|
70439
|
+
forceReload,
|
|
70439
70440
|
...extraConfig
|
|
70440
70441
|
} = {}) {
|
|
70441
|
-
if (
|
|
70442
|
-
|
|
70443
|
-
|
|
70444
|
-
|
|
70445
|
-
|
|
70442
|
+
if (!forceReload) {
|
|
70443
|
+
if (_config) {
|
|
70444
|
+
return _config;
|
|
70445
|
+
}
|
|
70446
|
+
if (pendingConfigPromise) {
|
|
70447
|
+
return await pendingConfigPromise;
|
|
70448
|
+
}
|
|
70446
70449
|
}
|
|
70447
70450
|
let resolve2 = () => {
|
|
70448
70451
|
};
|
|
@@ -70460,7 +70463,7 @@ async function getConfig({
|
|
|
70460
70463
|
if (!pluginName.startsWith(".")) {
|
|
70461
70464
|
pluginFile = await pluginPath(pluginName, configPath);
|
|
70462
70465
|
}
|
|
70463
|
-
const { default: pluginInit } = await import((0,
|
|
70466
|
+
const { default: pluginInit } = await import((0, import_node_url2.pathToFileURL)(pluginFile).toString());
|
|
70464
70467
|
if (!pluginInit.plugin || !pluginInit.name) {
|
|
70465
70468
|
throw new HoudiniError({
|
|
70466
70469
|
filepath: pluginFile,
|
|
@@ -70637,8 +70640,8 @@ async function loadSchemaFile(schemaPath) {
|
|
|
70637
70640
|
}
|
|
70638
70641
|
|
|
70639
70642
|
// src/lib/graphql.ts
|
|
70640
|
-
var import_crypto = __toESM(require("crypto"), 1);
|
|
70641
70643
|
var graphql3 = __toESM(require_graphql2(), 1);
|
|
70644
|
+
var import_node_crypto = __toESM(require("node:crypto"), 1);
|
|
70642
70645
|
function getRootType(type) {
|
|
70643
70646
|
if (graphql3.isNonNullType(type)) {
|
|
70644
70647
|
return getRootType(type.ofType);
|
|
@@ -70651,8 +70654,8 @@ function getRootType(type) {
|
|
|
70651
70654
|
function hashDocument({
|
|
70652
70655
|
document
|
|
70653
70656
|
}) {
|
|
70654
|
-
const docString = typeof document === "string" ? document :
|
|
70655
|
-
return
|
|
70657
|
+
const docString = typeof document === "string" ? document : document.artifact?.raw;
|
|
70658
|
+
return import_node_crypto.default.createHash("sha256").update(docString ?? "").digest("hex");
|
|
70656
70659
|
}
|
|
70657
70660
|
function parentTypeFromAncestors(schema, filepath, ancestors) {
|
|
70658
70661
|
const parents = [...ancestors];
|
|
@@ -76070,11 +76073,7 @@ async function pullSchema_default(args) {
|
|
|
76070
76073
|
};
|
|
76071
76074
|
}, headers);
|
|
76072
76075
|
}
|
|
76073
|
-
await pullSchema(
|
|
76074
|
-
apiURL,
|
|
76075
|
-
config2.schemaPath ? config2.schemaPath : path_exports.resolve(targetPath, "schema.json"),
|
|
76076
|
-
headers
|
|
76077
|
-
);
|
|
76076
|
+
await pullSchema(apiURL, config2.schemaPath ?? path_exports.resolve(targetPath, "schema.json"), headers);
|
|
76078
76077
|
}
|
|
76079
76078
|
|
|
76080
76079
|
// src/cmd/generate.ts
|
|
@@ -76107,8 +76106,8 @@ async function generate(args = {
|
|
|
76107
76106
|
}
|
|
76108
76107
|
|
|
76109
76108
|
// src/cmd/init.ts
|
|
76110
|
-
var import_child_process = require("child_process");
|
|
76111
76109
|
var import_graphql31 = __toESM(require_graphql2(), 1);
|
|
76110
|
+
var import_node_child_process = require("node:child_process");
|
|
76112
76111
|
var import_prompts = __toESM(require_prompts3(), 1);
|
|
76113
76112
|
async function init(_path, args) {
|
|
76114
76113
|
const force_remote_endpoint = args.force_remote_endpoint || false;
|
|
@@ -76140,7 +76139,7 @@ async function init(_path, args) {
|
|
|
76140
76139
|
}
|
|
76141
76140
|
} while (dir !== (dir = path_exports.dirname(dir)));
|
|
76142
76141
|
if (use_git) {
|
|
76143
|
-
const status = (0,
|
|
76142
|
+
const status = (0, import_node_child_process.execSync)("git status --porcelain", { stdio: "pipe" }).toString();
|
|
76144
76143
|
if (status) {
|
|
76145
76144
|
const message = "Your git working directory is dirty \u2014 we recommend committing your changes before running this migration.\n";
|
|
76146
76145
|
console.error(message);
|
|
@@ -76480,8 +76479,8 @@ async function updatePackageJSON(targetPath) {
|
|
|
76480
76479
|
}
|
|
76481
76480
|
packageJSON.devDependencies = {
|
|
76482
76481
|
...packageJSON.devDependencies,
|
|
76483
|
-
houdini: "^1.0.0-next.
|
|
76484
|
-
"houdini-svelte": "^1.0.0-next.
|
|
76482
|
+
houdini: "^1.0.0-next.8",
|
|
76483
|
+
"houdini-svelte": "^1.0.0-next.8"
|
|
76485
76484
|
};
|
|
76486
76485
|
await fs_exports.writeFile(packagePath, JSON.stringify(packageJSON, null, 4));
|
|
76487
76486
|
}
|