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/test-esm/index.js
CHANGED
|
@@ -3071,10 +3071,10 @@ var require_printer = __commonJS({
|
|
|
3071
3071
|
Object.defineProperty(exports, "__esModule", {
|
|
3072
3072
|
value: true
|
|
3073
3073
|
});
|
|
3074
|
-
exports.print =
|
|
3074
|
+
exports.print = print9;
|
|
3075
3075
|
var _visitor = require_visitor();
|
|
3076
3076
|
var _blockString = require_blockString();
|
|
3077
|
-
function
|
|
3077
|
+
function print9(ast) {
|
|
3078
3078
|
return (0, _visitor.visit)(ast, {
|
|
3079
3079
|
leave: printDocASTReducer
|
|
3080
3080
|
});
|
|
@@ -50827,12 +50827,12 @@ var require_comments = __commonJS({
|
|
|
50827
50827
|
comment.trailing = true;
|
|
50828
50828
|
addCommentHelper(node, comment);
|
|
50829
50829
|
}
|
|
50830
|
-
function printLeadingComment(commentPath,
|
|
50830
|
+
function printLeadingComment(commentPath, print9) {
|
|
50831
50831
|
var comment = commentPath.getValue();
|
|
50832
50832
|
n.Comment.assert(comment);
|
|
50833
50833
|
var loc = comment.loc;
|
|
50834
50834
|
var lines = loc && loc.lines;
|
|
50835
|
-
var parts = [
|
|
50835
|
+
var parts = [print9(commentPath)];
|
|
50836
50836
|
if (comment.trailing) {
|
|
50837
50837
|
parts.push("\n");
|
|
50838
50838
|
} else if (lines instanceof lines_1.Lines) {
|
|
@@ -50847,7 +50847,7 @@ var require_comments = __commonJS({
|
|
|
50847
50847
|
}
|
|
50848
50848
|
return (0, lines_1.concat)(parts);
|
|
50849
50849
|
}
|
|
50850
|
-
function printTrailingComment(commentPath,
|
|
50850
|
+
function printTrailingComment(commentPath, print9) {
|
|
50851
50851
|
var comment = commentPath.getValue(commentPath);
|
|
50852
50852
|
n.Comment.assert(comment);
|
|
50853
50853
|
var loc = comment.loc;
|
|
@@ -50862,12 +50862,12 @@ var require_comments = __commonJS({
|
|
|
50862
50862
|
parts.push(new Array(leadingSpace.length).join("\n"));
|
|
50863
50863
|
}
|
|
50864
50864
|
}
|
|
50865
|
-
parts.push(
|
|
50865
|
+
parts.push(print9(commentPath));
|
|
50866
50866
|
return (0, lines_1.concat)(parts);
|
|
50867
50867
|
}
|
|
50868
|
-
function printComments(path2,
|
|
50868
|
+
function printComments(path2, print9) {
|
|
50869
50869
|
var value = path2.getValue();
|
|
50870
|
-
var innerLines =
|
|
50870
|
+
var innerLines = print9(path2);
|
|
50871
50871
|
var comments = n.Node.check(value) && types14.getFieldValue(value, "comments");
|
|
50872
50872
|
if (!comments || comments.length === 0) {
|
|
50873
50873
|
return innerLines;
|
|
@@ -50879,9 +50879,9 @@ var require_comments = __commonJS({
|
|
|
50879
50879
|
var leading = types14.getFieldValue(comment, "leading");
|
|
50880
50880
|
var trailing = types14.getFieldValue(comment, "trailing");
|
|
50881
50881
|
if (leading || trailing && !(n.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
50882
|
-
leadingParts.push(printLeadingComment(commentPath,
|
|
50882
|
+
leadingParts.push(printLeadingComment(commentPath, print9));
|
|
50883
50883
|
} else if (trailing) {
|
|
50884
|
-
trailingParts.push(printTrailingComment(commentPath,
|
|
50884
|
+
trailingParts.push(printTrailingComment(commentPath, print9));
|
|
50885
50885
|
}
|
|
50886
50886
|
}, "comments");
|
|
50887
50887
|
leadingParts.push.apply(leadingParts, trailingParts);
|
|
@@ -51572,7 +51572,7 @@ var require_patcher = __commonJS({
|
|
|
51572
51572
|
};
|
|
51573
51573
|
exports.Patcher = Patcher;
|
|
51574
51574
|
var Pp = Patcher.prototype;
|
|
51575
|
-
Pp.tryToReprintComments = function(newNode, oldNode,
|
|
51575
|
+
Pp.tryToReprintComments = function(newNode, oldNode, print9) {
|
|
51576
51576
|
var patcher = this;
|
|
51577
51577
|
if (!newNode.comments && !oldNode.comments) {
|
|
51578
51578
|
return true;
|
|
@@ -51589,7 +51589,7 @@ var require_patcher = __commonJS({
|
|
|
51589
51589
|
assert_1.default.ok(oldComment.leading || oldComment.trailing);
|
|
51590
51590
|
patcher.replace(
|
|
51591
51591
|
oldComment.loc,
|
|
51592
|
-
|
|
51592
|
+
print9(reprint.newPath).indentTail(oldComment.loc.indent)
|
|
51593
51593
|
);
|
|
51594
51594
|
});
|
|
51595
51595
|
}
|
|
@@ -51636,17 +51636,17 @@ var require_patcher = __commonJS({
|
|
|
51636
51636
|
var reprints = [];
|
|
51637
51637
|
if (!lines || !findReprints(path2, reprints))
|
|
51638
51638
|
return;
|
|
51639
|
-
return function(
|
|
51639
|
+
return function(print9) {
|
|
51640
51640
|
var patcher = new Patcher(lines);
|
|
51641
51641
|
reprints.forEach(function(reprint) {
|
|
51642
51642
|
var newNode = reprint.newPath.getValue();
|
|
51643
51643
|
var oldNode = reprint.oldPath.getValue();
|
|
51644
51644
|
SourceLocation.assert(oldNode.loc, true);
|
|
51645
|
-
var needToPrintNewPathWithComments = !patcher.tryToReprintComments(newNode, oldNode,
|
|
51645
|
+
var needToPrintNewPathWithComments = !patcher.tryToReprintComments(newNode, oldNode, print9);
|
|
51646
51646
|
if (needToPrintNewPathWithComments) {
|
|
51647
51647
|
patcher.deleteComments(oldNode);
|
|
51648
51648
|
}
|
|
51649
|
-
var newLines =
|
|
51649
|
+
var newLines = print9(reprint.newPath, {
|
|
51650
51650
|
includeComments: needToPrintNewPathWithComments,
|
|
51651
51651
|
avoidRootParens: oldNode.type === newNode.type && reprint.oldPath.hasParens()
|
|
51652
51652
|
}).indentTail(oldNode.loc.indent);
|
|
@@ -51863,10 +51863,10 @@ var require_printer2 = __commonJS({
|
|
|
51863
51863
|
function makePrintFunctionWith(options, overrides) {
|
|
51864
51864
|
options = Object.assign({}, options, overrides);
|
|
51865
51865
|
return function(path2) {
|
|
51866
|
-
return
|
|
51866
|
+
return print9(path2, options);
|
|
51867
51867
|
};
|
|
51868
51868
|
}
|
|
51869
|
-
function
|
|
51869
|
+
function print9(path2, options) {
|
|
51870
51870
|
assert_1.default.ok(path2 instanceof fast_path_1.default);
|
|
51871
51871
|
options = options || {};
|
|
51872
51872
|
if (options.includeComments) {
|
|
@@ -51882,7 +51882,7 @@ var require_printer2 = __commonJS({
|
|
|
51882
51882
|
}
|
|
51883
51883
|
}
|
|
51884
51884
|
var reprinter = (0, patcher_1.getReprinter)(path2);
|
|
51885
|
-
var lines = reprinter ? reprinter(
|
|
51885
|
+
var lines = reprinter ? reprinter(print9) : genericPrint(path2, config2, options, makePrintFunctionWith(options, {
|
|
51886
51886
|
includeComments: true,
|
|
51887
51887
|
avoidRootParens: false
|
|
51888
51888
|
}));
|
|
@@ -51893,7 +51893,7 @@ var require_printer2 = __commonJS({
|
|
|
51893
51893
|
if (!ast) {
|
|
51894
51894
|
return emptyPrintResult;
|
|
51895
51895
|
}
|
|
51896
|
-
var lines =
|
|
51896
|
+
var lines = print9(fast_path_1.default.from(ast), {
|
|
51897
51897
|
includeComments: true,
|
|
51898
51898
|
avoidRootParens: false
|
|
51899
51899
|
});
|
|
@@ -51946,7 +51946,7 @@ var require_printer2 = __commonJS({
|
|
|
51946
51946
|
}
|
|
51947
51947
|
return (0, lines_1.concat)(parts);
|
|
51948
51948
|
}
|
|
51949
|
-
function genericPrintNoParens(path2, options,
|
|
51949
|
+
function genericPrintNoParens(path2, options, print9) {
|
|
51950
51950
|
var n = path2.getValue();
|
|
51951
51951
|
if (!n) {
|
|
51952
51952
|
return (0, lines_1.fromString)("");
|
|
@@ -51958,45 +51958,45 @@ var require_printer2 = __commonJS({
|
|
|
51958
51958
|
var parts = [];
|
|
51959
51959
|
switch (n.type) {
|
|
51960
51960
|
case "File":
|
|
51961
|
-
return path2.call(
|
|
51961
|
+
return path2.call(print9, "program");
|
|
51962
51962
|
case "Program":
|
|
51963
51963
|
if (n.directives) {
|
|
51964
51964
|
path2.each(function(childPath) {
|
|
51965
|
-
parts.push(
|
|
51965
|
+
parts.push(print9(childPath), ";\n");
|
|
51966
51966
|
}, "directives");
|
|
51967
51967
|
}
|
|
51968
51968
|
if (n.interpreter) {
|
|
51969
|
-
parts.push(path2.call(
|
|
51969
|
+
parts.push(path2.call(print9, "interpreter"));
|
|
51970
51970
|
}
|
|
51971
51971
|
parts.push(path2.call(function(bodyPath) {
|
|
51972
|
-
return printStatementSequence(bodyPath, options,
|
|
51972
|
+
return printStatementSequence(bodyPath, options, print9);
|
|
51973
51973
|
}, "body"));
|
|
51974
51974
|
return (0, lines_1.concat)(parts);
|
|
51975
51975
|
case "Noop":
|
|
51976
51976
|
case "EmptyStatement":
|
|
51977
51977
|
return (0, lines_1.fromString)("");
|
|
51978
51978
|
case "ExpressionStatement":
|
|
51979
|
-
return (0, lines_1.concat)([path2.call(
|
|
51979
|
+
return (0, lines_1.concat)([path2.call(print9, "expression"), ";"]);
|
|
51980
51980
|
case "ParenthesizedExpression":
|
|
51981
|
-
return (0, lines_1.concat)(["(", path2.call(
|
|
51981
|
+
return (0, lines_1.concat)(["(", path2.call(print9, "expression"), ")"]);
|
|
51982
51982
|
case "BinaryExpression":
|
|
51983
51983
|
case "LogicalExpression":
|
|
51984
51984
|
case "AssignmentExpression":
|
|
51985
51985
|
return (0, lines_1.fromString)(" ").join([
|
|
51986
|
-
path2.call(
|
|
51986
|
+
path2.call(print9, "left"),
|
|
51987
51987
|
n.operator,
|
|
51988
|
-
path2.call(
|
|
51988
|
+
path2.call(print9, "right")
|
|
51989
51989
|
]);
|
|
51990
51990
|
case "AssignmentPattern":
|
|
51991
51991
|
return (0, lines_1.concat)([
|
|
51992
|
-
path2.call(
|
|
51992
|
+
path2.call(print9, "left"),
|
|
51993
51993
|
" = ",
|
|
51994
|
-
path2.call(
|
|
51994
|
+
path2.call(print9, "right")
|
|
51995
51995
|
]);
|
|
51996
51996
|
case "MemberExpression":
|
|
51997
51997
|
case "OptionalMemberExpression": {
|
|
51998
|
-
parts.push(path2.call(
|
|
51999
|
-
var property = path2.call(
|
|
51998
|
+
parts.push(path2.call(print9, "object"));
|
|
51999
|
+
var property = path2.call(print9, "property");
|
|
52000
52000
|
var optional = types14.getFieldValue(n, "optional");
|
|
52001
52001
|
if (n.computed) {
|
|
52002
52002
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
@@ -52006,18 +52006,18 @@ var require_printer2 = __commonJS({
|
|
|
52006
52006
|
return (0, lines_1.concat)(parts);
|
|
52007
52007
|
}
|
|
52008
52008
|
case "ChainExpression":
|
|
52009
|
-
return path2.call(
|
|
52009
|
+
return path2.call(print9, "expression");
|
|
52010
52010
|
case "MetaProperty":
|
|
52011
52011
|
return (0, lines_1.concat)([
|
|
52012
|
-
path2.call(
|
|
52012
|
+
path2.call(print9, "meta"),
|
|
52013
52013
|
".",
|
|
52014
|
-
path2.call(
|
|
52014
|
+
path2.call(print9, "property")
|
|
52015
52015
|
]);
|
|
52016
52016
|
case "BindExpression":
|
|
52017
52017
|
if (n.object) {
|
|
52018
|
-
parts.push(path2.call(
|
|
52018
|
+
parts.push(path2.call(print9, "object"));
|
|
52019
52019
|
}
|
|
52020
|
-
parts.push("::", path2.call(
|
|
52020
|
+
parts.push("::", path2.call(print9, "callee"));
|
|
52021
52021
|
return (0, lines_1.concat)(parts);
|
|
52022
52022
|
case "Path":
|
|
52023
52023
|
return (0, lines_1.fromString)(".").join(n.body);
|
|
@@ -52025,7 +52025,7 @@ var require_printer2 = __commonJS({
|
|
|
52025
52025
|
return (0, lines_1.concat)([
|
|
52026
52026
|
(0, lines_1.fromString)(n.name, options),
|
|
52027
52027
|
n.optional ? "?" : "",
|
|
52028
|
-
path2.call(
|
|
52028
|
+
path2.call(print9, "typeAnnotation")
|
|
52029
52029
|
]);
|
|
52030
52030
|
case "SpreadElement":
|
|
52031
52031
|
case "SpreadElementPattern":
|
|
@@ -52036,8 +52036,8 @@ var require_printer2 = __commonJS({
|
|
|
52036
52036
|
case "RestElement":
|
|
52037
52037
|
return (0, lines_1.concat)([
|
|
52038
52038
|
"...",
|
|
52039
|
-
path2.call(
|
|
52040
|
-
path2.call(
|
|
52039
|
+
path2.call(print9, "argument"),
|
|
52040
|
+
path2.call(print9, "typeAnnotation")
|
|
52041
52041
|
]);
|
|
52042
52042
|
case "FunctionDeclaration":
|
|
52043
52043
|
case "FunctionExpression":
|
|
@@ -52052,15 +52052,15 @@ var require_printer2 = __commonJS({
|
|
|
52052
52052
|
if (n.generator)
|
|
52053
52053
|
parts.push("*");
|
|
52054
52054
|
if (n.id) {
|
|
52055
|
-
parts.push(" ", path2.call(
|
|
52055
|
+
parts.push(" ", path2.call(print9, "id"), path2.call(print9, "typeParameters"));
|
|
52056
52056
|
} else {
|
|
52057
52057
|
if (n.typeParameters) {
|
|
52058
|
-
parts.push(path2.call(
|
|
52058
|
+
parts.push(path2.call(print9, "typeParameters"));
|
|
52059
52059
|
}
|
|
52060
52060
|
}
|
|
52061
|
-
parts.push("(", printFunctionParams(path2, options,
|
|
52061
|
+
parts.push("(", printFunctionParams(path2, options, print9), ")", path2.call(print9, "returnType"));
|
|
52062
52062
|
if (n.body) {
|
|
52063
|
-
parts.push(" ", path2.call(
|
|
52063
|
+
parts.push(" ", path2.call(print9, "body"));
|
|
52064
52064
|
}
|
|
52065
52065
|
return (0, lines_1.concat)(parts);
|
|
52066
52066
|
case "ArrowFunctionExpression":
|
|
@@ -52068,44 +52068,44 @@ var require_printer2 = __commonJS({
|
|
|
52068
52068
|
parts.push("async ");
|
|
52069
52069
|
}
|
|
52070
52070
|
if (n.typeParameters) {
|
|
52071
|
-
parts.push(path2.call(
|
|
52071
|
+
parts.push(path2.call(print9, "typeParameters"));
|
|
52072
52072
|
}
|
|
52073
52073
|
if (!options.arrowParensAlways && n.params.length === 1 && !n.rest && n.params[0].type === "Identifier" && !n.params[0].typeAnnotation && !n.returnType) {
|
|
52074
|
-
parts.push(path2.call(
|
|
52074
|
+
parts.push(path2.call(print9, "params", 0));
|
|
52075
52075
|
} else {
|
|
52076
|
-
parts.push("(", printFunctionParams(path2, options,
|
|
52076
|
+
parts.push("(", printFunctionParams(path2, options, print9), ")", path2.call(print9, "returnType"));
|
|
52077
52077
|
}
|
|
52078
|
-
parts.push(" => ", path2.call(
|
|
52078
|
+
parts.push(" => ", path2.call(print9, "body"));
|
|
52079
52079
|
return (0, lines_1.concat)(parts);
|
|
52080
52080
|
case "MethodDefinition":
|
|
52081
|
-
return printMethod(path2, options,
|
|
52081
|
+
return printMethod(path2, options, print9);
|
|
52082
52082
|
case "YieldExpression":
|
|
52083
52083
|
parts.push("yield");
|
|
52084
52084
|
if (n.delegate)
|
|
52085
52085
|
parts.push("*");
|
|
52086
52086
|
if (n.argument)
|
|
52087
|
-
parts.push(" ", path2.call(
|
|
52087
|
+
parts.push(" ", path2.call(print9, "argument"));
|
|
52088
52088
|
return (0, lines_1.concat)(parts);
|
|
52089
52089
|
case "AwaitExpression":
|
|
52090
52090
|
parts.push("await");
|
|
52091
52091
|
if (n.all)
|
|
52092
52092
|
parts.push("*");
|
|
52093
52093
|
if (n.argument)
|
|
52094
|
-
parts.push(" ", path2.call(
|
|
52094
|
+
parts.push(" ", path2.call(print9, "argument"));
|
|
52095
52095
|
return (0, lines_1.concat)(parts);
|
|
52096
52096
|
case "ModuleExpression":
|
|
52097
52097
|
return (0, lines_1.concat)([
|
|
52098
52098
|
"module {\n",
|
|
52099
|
-
path2.call(
|
|
52099
|
+
path2.call(print9, "body").indent(options.tabWidth),
|
|
52100
52100
|
"\n}"
|
|
52101
52101
|
]);
|
|
52102
52102
|
case "ModuleDeclaration":
|
|
52103
|
-
parts.push("module", path2.call(
|
|
52103
|
+
parts.push("module", path2.call(print9, "id"));
|
|
52104
52104
|
if (n.source) {
|
|
52105
52105
|
assert_1.default.ok(!n.body);
|
|
52106
|
-
parts.push("from", path2.call(
|
|
52106
|
+
parts.push("from", path2.call(print9, "source"));
|
|
52107
52107
|
} else {
|
|
52108
|
-
parts.push(path2.call(
|
|
52108
|
+
parts.push(path2.call(print9, "body"));
|
|
52109
52109
|
}
|
|
52110
52110
|
return (0, lines_1.fromString)(" ").join(parts);
|
|
52111
52111
|
case "ImportSpecifier":
|
|
@@ -52113,27 +52113,27 @@ var require_printer2 = __commonJS({
|
|
|
52113
52113
|
parts.push(n.importKind + " ");
|
|
52114
52114
|
}
|
|
52115
52115
|
if (n.imported) {
|
|
52116
|
-
parts.push(path2.call(
|
|
52116
|
+
parts.push(path2.call(print9, "imported"));
|
|
52117
52117
|
if (n.local && n.local.name !== n.imported.name) {
|
|
52118
|
-
parts.push(" as ", path2.call(
|
|
52118
|
+
parts.push(" as ", path2.call(print9, "local"));
|
|
52119
52119
|
}
|
|
52120
52120
|
} else if (n.id) {
|
|
52121
|
-
parts.push(path2.call(
|
|
52121
|
+
parts.push(path2.call(print9, "id"));
|
|
52122
52122
|
if (n.name) {
|
|
52123
|
-
parts.push(" as ", path2.call(
|
|
52123
|
+
parts.push(" as ", path2.call(print9, "name"));
|
|
52124
52124
|
}
|
|
52125
52125
|
}
|
|
52126
52126
|
return (0, lines_1.concat)(parts);
|
|
52127
52127
|
case "ExportSpecifier":
|
|
52128
52128
|
if (n.local) {
|
|
52129
|
-
parts.push(path2.call(
|
|
52129
|
+
parts.push(path2.call(print9, "local"));
|
|
52130
52130
|
if (n.exported && n.exported.name !== n.local.name) {
|
|
52131
|
-
parts.push(" as ", path2.call(
|
|
52131
|
+
parts.push(" as ", path2.call(print9, "exported"));
|
|
52132
52132
|
}
|
|
52133
52133
|
} else if (n.id) {
|
|
52134
|
-
parts.push(path2.call(
|
|
52134
|
+
parts.push(path2.call(print9, "id"));
|
|
52135
52135
|
if (n.name) {
|
|
52136
|
-
parts.push(" as ", path2.call(
|
|
52136
|
+
parts.push(" as ", path2.call(print9, "name"));
|
|
52137
52137
|
}
|
|
52138
52138
|
}
|
|
52139
52139
|
return (0, lines_1.concat)(parts);
|
|
@@ -52142,40 +52142,40 @@ var require_printer2 = __commonJS({
|
|
|
52142
52142
|
case "ImportNamespaceSpecifier":
|
|
52143
52143
|
parts.push("* as ");
|
|
52144
52144
|
if (n.local) {
|
|
52145
|
-
parts.push(path2.call(
|
|
52145
|
+
parts.push(path2.call(print9, "local"));
|
|
52146
52146
|
} else if (n.id) {
|
|
52147
|
-
parts.push(path2.call(
|
|
52147
|
+
parts.push(path2.call(print9, "id"));
|
|
52148
52148
|
}
|
|
52149
52149
|
return (0, lines_1.concat)(parts);
|
|
52150
52150
|
case "ImportDefaultSpecifier":
|
|
52151
52151
|
if (n.local) {
|
|
52152
|
-
return path2.call(
|
|
52152
|
+
return path2.call(print9, "local");
|
|
52153
52153
|
}
|
|
52154
|
-
return path2.call(
|
|
52154
|
+
return path2.call(print9, "id");
|
|
52155
52155
|
case "TSExportAssignment":
|
|
52156
|
-
return (0, lines_1.concat)(["export = ", path2.call(
|
|
52156
|
+
return (0, lines_1.concat)(["export = ", path2.call(print9, "expression")]);
|
|
52157
52157
|
case "ExportDeclaration":
|
|
52158
52158
|
case "ExportDefaultDeclaration":
|
|
52159
52159
|
case "ExportNamedDeclaration":
|
|
52160
|
-
return printExportDeclaration(path2, options,
|
|
52160
|
+
return printExportDeclaration(path2, options, print9);
|
|
52161
52161
|
case "ExportAllDeclaration":
|
|
52162
52162
|
parts.push("export *");
|
|
52163
52163
|
if (n.exported) {
|
|
52164
|
-
parts.push(" as ", path2.call(
|
|
52164
|
+
parts.push(" as ", path2.call(print9, "exported"));
|
|
52165
52165
|
}
|
|
52166
|
-
parts.push(" from ", path2.call(
|
|
52166
|
+
parts.push(" from ", path2.call(print9, "source"), ";");
|
|
52167
52167
|
return (0, lines_1.concat)(parts);
|
|
52168
52168
|
case "TSNamespaceExportDeclaration":
|
|
52169
|
-
parts.push("export as namespace ", path2.call(
|
|
52169
|
+
parts.push("export as namespace ", path2.call(print9, "id"));
|
|
52170
52170
|
return maybeAddSemicolon((0, lines_1.concat)(parts));
|
|
52171
52171
|
case "ExportNamespaceSpecifier":
|
|
52172
|
-
return (0, lines_1.concat)(["* as ", path2.call(
|
|
52172
|
+
return (0, lines_1.concat)(["* as ", path2.call(print9, "exported")]);
|
|
52173
52173
|
case "ExportDefaultSpecifier":
|
|
52174
|
-
return path2.call(
|
|
52174
|
+
return path2.call(print9, "exported");
|
|
52175
52175
|
case "Import":
|
|
52176
52176
|
return (0, lines_1.fromString)("import", options);
|
|
52177
52177
|
case "ImportExpression":
|
|
52178
|
-
return (0, lines_1.concat)(["import(", path2.call(
|
|
52178
|
+
return (0, lines_1.concat)(["import(", path2.call(print9, "source"), ")"]);
|
|
52179
52179
|
case "ImportDeclaration": {
|
|
52180
52180
|
parts.push("import ");
|
|
52181
52181
|
if (n.importKind && n.importKind !== "value") {
|
|
@@ -52187,9 +52187,9 @@ var require_printer2 = __commonJS({
|
|
|
52187
52187
|
path2.each(function(specifierPath) {
|
|
52188
52188
|
var spec = specifierPath.getValue();
|
|
52189
52189
|
if (spec.type === "ImportSpecifier") {
|
|
52190
|
-
bracedSpecifiers_1.push(
|
|
52190
|
+
bracedSpecifiers_1.push(print9(specifierPath));
|
|
52191
52191
|
} else if (spec.type === "ImportDefaultSpecifier" || spec.type === "ImportNamespaceSpecifier") {
|
|
52192
|
-
unbracedSpecifiers_1.push(
|
|
52192
|
+
unbracedSpecifiers_1.push(print9(specifierPath));
|
|
52193
52193
|
}
|
|
52194
52194
|
}, "specifiers");
|
|
52195
52195
|
unbracedSpecifiers_1.forEach(function(lines2, i) {
|
|
@@ -52219,16 +52219,16 @@ var require_printer2 = __commonJS({
|
|
|
52219
52219
|
}
|
|
52220
52220
|
parts.push(" from ");
|
|
52221
52221
|
}
|
|
52222
|
-
parts.push(path2.call(
|
|
52222
|
+
parts.push(path2.call(print9, "source"), maybePrintImportAssertions(path2, options, print9), ";");
|
|
52223
52223
|
return (0, lines_1.concat)(parts);
|
|
52224
52224
|
}
|
|
52225
52225
|
case "ImportAttribute":
|
|
52226
|
-
return (0, lines_1.concat)([path2.call(
|
|
52226
|
+
return (0, lines_1.concat)([path2.call(print9, "key"), ": ", path2.call(print9, "value")]);
|
|
52227
52227
|
case "StaticBlock":
|
|
52228
52228
|
parts.push("static ");
|
|
52229
52229
|
case "BlockStatement": {
|
|
52230
52230
|
var naked_1 = path2.call(function(bodyPath) {
|
|
52231
|
-
return printStatementSequence(bodyPath, options,
|
|
52231
|
+
return printStatementSequence(bodyPath, options, print9);
|
|
52232
52232
|
}, "body");
|
|
52233
52233
|
if (naked_1.isEmpty()) {
|
|
52234
52234
|
if (!n.directives || n.directives.length === 0) {
|
|
@@ -52239,7 +52239,7 @@ var require_printer2 = __commonJS({
|
|
|
52239
52239
|
parts.push("{\n");
|
|
52240
52240
|
if (n.directives) {
|
|
52241
52241
|
path2.each(function(childPath) {
|
|
52242
|
-
parts.push(maybeAddSemicolon(
|
|
52242
|
+
parts.push(maybeAddSemicolon(print9(childPath).indent(options.tabWidth)), n.directives.length > 1 || !naked_1.isEmpty() ? "\n" : "");
|
|
52243
52243
|
}, "directives");
|
|
52244
52244
|
}
|
|
52245
52245
|
parts.push(naked_1.indent(options.tabWidth));
|
|
@@ -52249,7 +52249,7 @@ var require_printer2 = __commonJS({
|
|
|
52249
52249
|
case "ReturnStatement": {
|
|
52250
52250
|
parts.push("return");
|
|
52251
52251
|
if (n.argument) {
|
|
52252
|
-
var argLines = path2.call(
|
|
52252
|
+
var argLines = path2.call(print9, "argument");
|
|
52253
52253
|
if (argLines.startsWithComment() || argLines.length > 1 && namedTypes.JSXElement && namedTypes.JSXElement.check(n.argument)) {
|
|
52254
52254
|
parts.push(" (\n", argLines.indent(options.tabWidth), "\n)");
|
|
52255
52255
|
} else {
|
|
@@ -52261,17 +52261,17 @@ var require_printer2 = __commonJS({
|
|
|
52261
52261
|
}
|
|
52262
52262
|
case "CallExpression":
|
|
52263
52263
|
case "OptionalCallExpression":
|
|
52264
|
-
parts.push(path2.call(
|
|
52264
|
+
parts.push(path2.call(print9, "callee"));
|
|
52265
52265
|
if (n.typeParameters) {
|
|
52266
|
-
parts.push(path2.call(
|
|
52266
|
+
parts.push(path2.call(print9, "typeParameters"));
|
|
52267
52267
|
}
|
|
52268
52268
|
if (n.typeArguments) {
|
|
52269
|
-
parts.push(path2.call(
|
|
52269
|
+
parts.push(path2.call(print9, "typeArguments"));
|
|
52270
52270
|
}
|
|
52271
52271
|
if (types14.getFieldValue(n, "optional")) {
|
|
52272
52272
|
parts.push("?.");
|
|
52273
52273
|
}
|
|
52274
|
-
parts.push(printArgumentsList(path2, options,
|
|
52274
|
+
parts.push(printArgumentsList(path2, options, print9));
|
|
52275
52275
|
return (0, lines_1.concat)(parts);
|
|
52276
52276
|
case "RecordExpression":
|
|
52277
52277
|
parts.push("#");
|
|
@@ -52301,7 +52301,7 @@ var require_printer2 = __commonJS({
|
|
|
52301
52301
|
var i_1 = 0;
|
|
52302
52302
|
fields.forEach(function(field) {
|
|
52303
52303
|
path2.each(function(childPath) {
|
|
52304
|
-
var lines2 =
|
|
52304
|
+
var lines2 = print9(childPath);
|
|
52305
52305
|
if (!oneLine_1) {
|
|
52306
52306
|
lines2 = lines2.indent(options.tabWidth);
|
|
52307
52307
|
}
|
|
@@ -52338,32 +52338,32 @@ var require_printer2 = __commonJS({
|
|
|
52338
52338
|
parts[parts.length - 1] = " " + rightBrace;
|
|
52339
52339
|
}
|
|
52340
52340
|
if (n.typeAnnotation) {
|
|
52341
|
-
parts.push(path2.call(
|
|
52341
|
+
parts.push(path2.call(print9, "typeAnnotation"));
|
|
52342
52342
|
}
|
|
52343
52343
|
return (0, lines_1.concat)(parts);
|
|
52344
52344
|
}
|
|
52345
52345
|
case "PropertyPattern":
|
|
52346
52346
|
return (0, lines_1.concat)([
|
|
52347
|
-
path2.call(
|
|
52347
|
+
path2.call(print9, "key"),
|
|
52348
52348
|
": ",
|
|
52349
|
-
path2.call(
|
|
52349
|
+
path2.call(print9, "pattern")
|
|
52350
52350
|
]);
|
|
52351
52351
|
case "ObjectProperty":
|
|
52352
52352
|
case "Property": {
|
|
52353
52353
|
if (n.method || n.kind === "get" || n.kind === "set") {
|
|
52354
|
-
return printMethod(path2, options,
|
|
52354
|
+
return printMethod(path2, options, print9);
|
|
52355
52355
|
}
|
|
52356
52356
|
if (n.shorthand && n.value.type === "AssignmentPattern") {
|
|
52357
|
-
return path2.call(
|
|
52357
|
+
return path2.call(print9, "value");
|
|
52358
52358
|
}
|
|
52359
|
-
var key = path2.call(
|
|
52359
|
+
var key = path2.call(print9, "key");
|
|
52360
52360
|
if (n.computed) {
|
|
52361
52361
|
parts.push("[", key, "]");
|
|
52362
52362
|
} else {
|
|
52363
52363
|
parts.push(key);
|
|
52364
52364
|
}
|
|
52365
52365
|
if (!n.shorthand || n.key.name !== n.value.name) {
|
|
52366
|
-
parts.push(": ", path2.call(
|
|
52366
|
+
parts.push(": ", path2.call(print9, "value"));
|
|
52367
52367
|
}
|
|
52368
52368
|
return (0, lines_1.concat)(parts);
|
|
52369
52369
|
}
|
|
@@ -52371,18 +52371,18 @@ var require_printer2 = __commonJS({
|
|
|
52371
52371
|
case "ObjectMethod":
|
|
52372
52372
|
case "ClassPrivateMethod":
|
|
52373
52373
|
case "TSDeclareMethod":
|
|
52374
|
-
return printMethod(path2, options,
|
|
52374
|
+
return printMethod(path2, options, print9);
|
|
52375
52375
|
case "PrivateName":
|
|
52376
|
-
return (0, lines_1.concat)(["#", path2.call(
|
|
52376
|
+
return (0, lines_1.concat)(["#", path2.call(print9, "id")]);
|
|
52377
52377
|
case "Decorator":
|
|
52378
|
-
return (0, lines_1.concat)(["@", path2.call(
|
|
52378
|
+
return (0, lines_1.concat)(["@", path2.call(print9, "expression")]);
|
|
52379
52379
|
case "TupleExpression":
|
|
52380
52380
|
parts.push("#");
|
|
52381
52381
|
case "ArrayExpression":
|
|
52382
52382
|
case "ArrayPattern": {
|
|
52383
52383
|
var elems = n.elements;
|
|
52384
52384
|
var len_2 = elems.length;
|
|
52385
|
-
var printed_1 = path2.map(
|
|
52385
|
+
var printed_1 = path2.map(print9, "elements");
|
|
52386
52386
|
var joined = (0, lines_1.fromString)(", ").join(printed_1);
|
|
52387
52387
|
var oneLine_2 = joined.getLineLength(1) <= options.wrapColumn;
|
|
52388
52388
|
if (oneLine_2) {
|
|
@@ -52420,12 +52420,12 @@ var require_printer2 = __commonJS({
|
|
|
52420
52420
|
parts.push("]");
|
|
52421
52421
|
}
|
|
52422
52422
|
if (n.typeAnnotation) {
|
|
52423
|
-
parts.push(path2.call(
|
|
52423
|
+
parts.push(path2.call(print9, "typeAnnotation"));
|
|
52424
52424
|
}
|
|
52425
52425
|
return (0, lines_1.concat)(parts);
|
|
52426
52426
|
}
|
|
52427
52427
|
case "SequenceExpression":
|
|
52428
|
-
return (0, lines_1.fromString)(", ").join(path2.map(
|
|
52428
|
+
return (0, lines_1.fromString)(", ").join(path2.map(print9, "expressions"));
|
|
52429
52429
|
case "ThisExpression":
|
|
52430
52430
|
return (0, lines_1.fromString)("this");
|
|
52431
52431
|
case "Super":
|
|
@@ -52446,7 +52446,7 @@ var require_printer2 = __commonJS({
|
|
|
52446
52446
|
case "Literal":
|
|
52447
52447
|
return (0, lines_1.fromString)(getPossibleRaw(n) || (typeof n.value === "string" ? nodeStr(n.value, options) : n.value), options);
|
|
52448
52448
|
case "Directive":
|
|
52449
|
-
return path2.call(
|
|
52449
|
+
return path2.call(print9, "value");
|
|
52450
52450
|
case "DirectiveLiteral":
|
|
52451
52451
|
return (0, lines_1.fromString)(getPossibleRaw(n) || nodeStr(n.value, options), options);
|
|
52452
52452
|
case "InterpreterDirective":
|
|
@@ -52460,32 +52460,32 @@ var require_printer2 = __commonJS({
|
|
|
52460
52460
|
parts.push(n.operator);
|
|
52461
52461
|
if (/[a-z]$/.test(n.operator))
|
|
52462
52462
|
parts.push(" ");
|
|
52463
|
-
parts.push(path2.call(
|
|
52463
|
+
parts.push(path2.call(print9, "argument"));
|
|
52464
52464
|
return (0, lines_1.concat)(parts);
|
|
52465
52465
|
case "UpdateExpression":
|
|
52466
|
-
parts.push(path2.call(
|
|
52466
|
+
parts.push(path2.call(print9, "argument"), n.operator);
|
|
52467
52467
|
if (n.prefix)
|
|
52468
52468
|
parts.reverse();
|
|
52469
52469
|
return (0, lines_1.concat)(parts);
|
|
52470
52470
|
case "ConditionalExpression":
|
|
52471
52471
|
return (0, lines_1.concat)([
|
|
52472
|
-
path2.call(
|
|
52472
|
+
path2.call(print9, "test"),
|
|
52473
52473
|
" ? ",
|
|
52474
|
-
path2.call(
|
|
52474
|
+
path2.call(print9, "consequent"),
|
|
52475
52475
|
" : ",
|
|
52476
|
-
path2.call(
|
|
52476
|
+
path2.call(print9, "alternate")
|
|
52477
52477
|
]);
|
|
52478
52478
|
case "NewExpression": {
|
|
52479
|
-
parts.push("new ", path2.call(
|
|
52479
|
+
parts.push("new ", path2.call(print9, "callee"));
|
|
52480
52480
|
if (n.typeParameters) {
|
|
52481
|
-
parts.push(path2.call(
|
|
52481
|
+
parts.push(path2.call(print9, "typeParameters"));
|
|
52482
52482
|
}
|
|
52483
52483
|
if (n.typeArguments) {
|
|
52484
|
-
parts.push(path2.call(
|
|
52484
|
+
parts.push(path2.call(print9, "typeArguments"));
|
|
52485
52485
|
}
|
|
52486
52486
|
var args = n.arguments;
|
|
52487
52487
|
if (args) {
|
|
52488
|
-
parts.push(printArgumentsList(path2, options,
|
|
52488
|
+
parts.push(printArgumentsList(path2, options, print9));
|
|
52489
52489
|
}
|
|
52490
52490
|
return (0, lines_1.concat)(parts);
|
|
52491
52491
|
}
|
|
@@ -52496,7 +52496,7 @@ var require_printer2 = __commonJS({
|
|
|
52496
52496
|
parts.push(n.kind, " ");
|
|
52497
52497
|
var maxLen_1 = 0;
|
|
52498
52498
|
var printed = path2.map(function(childPath) {
|
|
52499
|
-
var lines2 =
|
|
52499
|
+
var lines2 = print9(childPath);
|
|
52500
52500
|
maxLen_1 = Math.max(lines2.length, maxLen_1);
|
|
52501
52501
|
return lines2;
|
|
52502
52502
|
}, "declarations");
|
|
@@ -52515,30 +52515,30 @@ var require_printer2 = __commonJS({
|
|
|
52515
52515
|
}
|
|
52516
52516
|
case "VariableDeclarator":
|
|
52517
52517
|
return n.init ? (0, lines_1.fromString)(" = ").join([
|
|
52518
|
-
path2.call(
|
|
52519
|
-
path2.call(
|
|
52520
|
-
]) : path2.call(
|
|
52518
|
+
path2.call(print9, "id"),
|
|
52519
|
+
path2.call(print9, "init")
|
|
52520
|
+
]) : path2.call(print9, "id");
|
|
52521
52521
|
case "WithStatement":
|
|
52522
52522
|
return (0, lines_1.concat)([
|
|
52523
52523
|
"with (",
|
|
52524
|
-
path2.call(
|
|
52524
|
+
path2.call(print9, "object"),
|
|
52525
52525
|
") ",
|
|
52526
|
-
path2.call(
|
|
52526
|
+
path2.call(print9, "body")
|
|
52527
52527
|
]);
|
|
52528
52528
|
case "IfStatement": {
|
|
52529
|
-
var con = adjustClause(path2.call(
|
|
52530
|
-
parts.push("if (", path2.call(
|
|
52529
|
+
var con = adjustClause(path2.call(print9, "consequent"), options);
|
|
52530
|
+
parts.push("if (", path2.call(print9, "test"), ")", con);
|
|
52531
52531
|
if (n.alternate)
|
|
52532
|
-
parts.push(endsWithBrace(con) ? " else" : "\nelse", adjustClause(path2.call(
|
|
52532
|
+
parts.push(endsWithBrace(con) ? " else" : "\nelse", adjustClause(path2.call(print9, "alternate"), options));
|
|
52533
52533
|
return (0, lines_1.concat)(parts);
|
|
52534
52534
|
}
|
|
52535
52535
|
case "ForStatement": {
|
|
52536
|
-
var init = path2.call(
|
|
52536
|
+
var init = path2.call(print9, "init");
|
|
52537
52537
|
var sep2 = init.length > 1 ? ";\n" : "; ";
|
|
52538
52538
|
var forParen = "for (";
|
|
52539
|
-
var indented = (0, lines_1.fromString)(sep2).join([init, path2.call(
|
|
52539
|
+
var indented = (0, lines_1.fromString)(sep2).join([init, path2.call(print9, "test"), path2.call(print9, "update")]).indentTail(forParen.length);
|
|
52540
52540
|
var head = (0, lines_1.concat)([forParen, indented, ")"]);
|
|
52541
|
-
var clause = adjustClause(path2.call(
|
|
52541
|
+
var clause = adjustClause(path2.call(print9, "body"), options);
|
|
52542
52542
|
parts.push(head);
|
|
52543
52543
|
if (head.length > 1) {
|
|
52544
52544
|
parts.push("\n");
|
|
@@ -52550,18 +52550,18 @@ var require_printer2 = __commonJS({
|
|
|
52550
52550
|
case "WhileStatement":
|
|
52551
52551
|
return (0, lines_1.concat)([
|
|
52552
52552
|
"while (",
|
|
52553
|
-
path2.call(
|
|
52553
|
+
path2.call(print9, "test"),
|
|
52554
52554
|
")",
|
|
52555
|
-
adjustClause(path2.call(
|
|
52555
|
+
adjustClause(path2.call(print9, "body"), options)
|
|
52556
52556
|
]);
|
|
52557
52557
|
case "ForInStatement":
|
|
52558
52558
|
return (0, lines_1.concat)([
|
|
52559
52559
|
n.each ? "for each (" : "for (",
|
|
52560
|
-
path2.call(
|
|
52560
|
+
path2.call(print9, "left"),
|
|
52561
52561
|
" in ",
|
|
52562
|
-
path2.call(
|
|
52562
|
+
path2.call(print9, "right"),
|
|
52563
52563
|
")",
|
|
52564
|
-
adjustClause(path2.call(
|
|
52564
|
+
adjustClause(path2.call(print9, "body"), options)
|
|
52565
52565
|
]);
|
|
52566
52566
|
case "ForOfStatement":
|
|
52567
52567
|
case "ForAwaitStatement":
|
|
@@ -52569,122 +52569,122 @@ var require_printer2 = __commonJS({
|
|
|
52569
52569
|
if (n.await || n.type === "ForAwaitStatement") {
|
|
52570
52570
|
parts.push("await ");
|
|
52571
52571
|
}
|
|
52572
|
-
parts.push("(", path2.call(
|
|
52572
|
+
parts.push("(", path2.call(print9, "left"), " of ", path2.call(print9, "right"), ")", adjustClause(path2.call(print9, "body"), options));
|
|
52573
52573
|
return (0, lines_1.concat)(parts);
|
|
52574
52574
|
case "DoWhileStatement": {
|
|
52575
52575
|
var doBody = (0, lines_1.concat)([
|
|
52576
52576
|
"do",
|
|
52577
|
-
adjustClause(path2.call(
|
|
52577
|
+
adjustClause(path2.call(print9, "body"), options)
|
|
52578
52578
|
]);
|
|
52579
52579
|
parts.push(doBody);
|
|
52580
52580
|
if (endsWithBrace(doBody))
|
|
52581
52581
|
parts.push(" while");
|
|
52582
52582
|
else
|
|
52583
52583
|
parts.push("\nwhile");
|
|
52584
|
-
parts.push(" (", path2.call(
|
|
52584
|
+
parts.push(" (", path2.call(print9, "test"), ");");
|
|
52585
52585
|
return (0, lines_1.concat)(parts);
|
|
52586
52586
|
}
|
|
52587
52587
|
case "DoExpression": {
|
|
52588
52588
|
var statements = path2.call(function(bodyPath) {
|
|
52589
|
-
return printStatementSequence(bodyPath, options,
|
|
52589
|
+
return printStatementSequence(bodyPath, options, print9);
|
|
52590
52590
|
}, "body");
|
|
52591
52591
|
return (0, lines_1.concat)(["do {\n", statements.indent(options.tabWidth), "\n}"]);
|
|
52592
52592
|
}
|
|
52593
52593
|
case "BreakStatement":
|
|
52594
52594
|
parts.push("break");
|
|
52595
52595
|
if (n.label)
|
|
52596
|
-
parts.push(" ", path2.call(
|
|
52596
|
+
parts.push(" ", path2.call(print9, "label"));
|
|
52597
52597
|
parts.push(";");
|
|
52598
52598
|
return (0, lines_1.concat)(parts);
|
|
52599
52599
|
case "ContinueStatement":
|
|
52600
52600
|
parts.push("continue");
|
|
52601
52601
|
if (n.label)
|
|
52602
|
-
parts.push(" ", path2.call(
|
|
52602
|
+
parts.push(" ", path2.call(print9, "label"));
|
|
52603
52603
|
parts.push(";");
|
|
52604
52604
|
return (0, lines_1.concat)(parts);
|
|
52605
52605
|
case "LabeledStatement":
|
|
52606
52606
|
return (0, lines_1.concat)([
|
|
52607
|
-
path2.call(
|
|
52607
|
+
path2.call(print9, "label"),
|
|
52608
52608
|
":\n",
|
|
52609
|
-
path2.call(
|
|
52609
|
+
path2.call(print9, "body")
|
|
52610
52610
|
]);
|
|
52611
52611
|
case "TryStatement":
|
|
52612
|
-
parts.push("try ", path2.call(
|
|
52612
|
+
parts.push("try ", path2.call(print9, "block"));
|
|
52613
52613
|
if (n.handler) {
|
|
52614
|
-
parts.push(" ", path2.call(
|
|
52614
|
+
parts.push(" ", path2.call(print9, "handler"));
|
|
52615
52615
|
} else if (n.handlers) {
|
|
52616
52616
|
path2.each(function(handlerPath) {
|
|
52617
|
-
parts.push(" ",
|
|
52617
|
+
parts.push(" ", print9(handlerPath));
|
|
52618
52618
|
}, "handlers");
|
|
52619
52619
|
}
|
|
52620
52620
|
if (n.finalizer) {
|
|
52621
|
-
parts.push(" finally ", path2.call(
|
|
52621
|
+
parts.push(" finally ", path2.call(print9, "finalizer"));
|
|
52622
52622
|
}
|
|
52623
52623
|
return (0, lines_1.concat)(parts);
|
|
52624
52624
|
case "CatchClause":
|
|
52625
52625
|
parts.push("catch ");
|
|
52626
52626
|
if (n.param) {
|
|
52627
|
-
parts.push("(", path2.call(
|
|
52627
|
+
parts.push("(", path2.call(print9, "param"));
|
|
52628
52628
|
}
|
|
52629
52629
|
if (n.guard) {
|
|
52630
|
-
parts.push(" if ", path2.call(
|
|
52630
|
+
parts.push(" if ", path2.call(print9, "guard"));
|
|
52631
52631
|
}
|
|
52632
52632
|
if (n.param) {
|
|
52633
52633
|
parts.push(") ");
|
|
52634
52634
|
}
|
|
52635
|
-
parts.push(path2.call(
|
|
52635
|
+
parts.push(path2.call(print9, "body"));
|
|
52636
52636
|
return (0, lines_1.concat)(parts);
|
|
52637
52637
|
case "ThrowStatement":
|
|
52638
|
-
return (0, lines_1.concat)(["throw ", path2.call(
|
|
52638
|
+
return (0, lines_1.concat)(["throw ", path2.call(print9, "argument"), ";"]);
|
|
52639
52639
|
case "SwitchStatement":
|
|
52640
52640
|
return (0, lines_1.concat)([
|
|
52641
52641
|
"switch (",
|
|
52642
|
-
path2.call(
|
|
52642
|
+
path2.call(print9, "discriminant"),
|
|
52643
52643
|
") {\n",
|
|
52644
|
-
(0, lines_1.fromString)("\n").join(path2.map(
|
|
52644
|
+
(0, lines_1.fromString)("\n").join(path2.map(print9, "cases")),
|
|
52645
52645
|
"\n}"
|
|
52646
52646
|
]);
|
|
52647
52647
|
case "SwitchCase":
|
|
52648
52648
|
if (n.test)
|
|
52649
|
-
parts.push("case ", path2.call(
|
|
52649
|
+
parts.push("case ", path2.call(print9, "test"), ":");
|
|
52650
52650
|
else
|
|
52651
52651
|
parts.push("default:");
|
|
52652
52652
|
if (n.consequent.length > 0) {
|
|
52653
52653
|
parts.push("\n", path2.call(function(consequentPath) {
|
|
52654
|
-
return printStatementSequence(consequentPath, options,
|
|
52654
|
+
return printStatementSequence(consequentPath, options, print9);
|
|
52655
52655
|
}, "consequent").indent(options.tabWidth));
|
|
52656
52656
|
}
|
|
52657
52657
|
return (0, lines_1.concat)(parts);
|
|
52658
52658
|
case "DebuggerStatement":
|
|
52659
52659
|
return (0, lines_1.fromString)("debugger;");
|
|
52660
52660
|
case "JSXAttribute":
|
|
52661
|
-
parts.push(path2.call(
|
|
52661
|
+
parts.push(path2.call(print9, "name"));
|
|
52662
52662
|
if (n.value)
|
|
52663
|
-
parts.push("=", path2.call(
|
|
52663
|
+
parts.push("=", path2.call(print9, "value"));
|
|
52664
52664
|
return (0, lines_1.concat)(parts);
|
|
52665
52665
|
case "JSXIdentifier":
|
|
52666
52666
|
return (0, lines_1.fromString)(n.name, options);
|
|
52667
52667
|
case "JSXNamespacedName":
|
|
52668
52668
|
return (0, lines_1.fromString)(":").join([
|
|
52669
|
-
path2.call(
|
|
52670
|
-
path2.call(
|
|
52669
|
+
path2.call(print9, "namespace"),
|
|
52670
|
+
path2.call(print9, "name")
|
|
52671
52671
|
]);
|
|
52672
52672
|
case "JSXMemberExpression":
|
|
52673
52673
|
return (0, lines_1.fromString)(".").join([
|
|
52674
|
-
path2.call(
|
|
52675
|
-
path2.call(
|
|
52674
|
+
path2.call(print9, "object"),
|
|
52675
|
+
path2.call(print9, "property")
|
|
52676
52676
|
]);
|
|
52677
52677
|
case "JSXSpreadAttribute":
|
|
52678
|
-
return (0, lines_1.concat)(["{...", path2.call(
|
|
52678
|
+
return (0, lines_1.concat)(["{...", path2.call(print9, "argument"), "}"]);
|
|
52679
52679
|
case "JSXSpreadChild":
|
|
52680
|
-
return (0, lines_1.concat)(["{...", path2.call(
|
|
52680
|
+
return (0, lines_1.concat)(["{...", path2.call(print9, "expression"), "}"]);
|
|
52681
52681
|
case "JSXExpressionContainer":
|
|
52682
|
-
return (0, lines_1.concat)(["{", path2.call(
|
|
52682
|
+
return (0, lines_1.concat)(["{", path2.call(print9, "expression"), "}"]);
|
|
52683
52683
|
case "JSXElement":
|
|
52684
52684
|
case "JSXFragment": {
|
|
52685
52685
|
var openingPropName = "opening" + (n.type === "JSXElement" ? "Element" : "Fragment");
|
|
52686
52686
|
var closingPropName = "closing" + (n.type === "JSXElement" ? "Element" : "Fragment");
|
|
52687
|
-
var openingLines = path2.call(
|
|
52687
|
+
var openingLines = path2.call(print9, openingPropName);
|
|
52688
52688
|
if (n[openingPropName].selfClosing) {
|
|
52689
52689
|
assert_1.default.ok(!n[closingPropName], "unexpected " + closingPropName + " element in self-closing " + n.type);
|
|
52690
52690
|
return openingLines;
|
|
@@ -52698,16 +52698,16 @@ var require_printer2 = __commonJS({
|
|
|
52698
52698
|
return "\n";
|
|
52699
52699
|
}
|
|
52700
52700
|
}
|
|
52701
|
-
return
|
|
52701
|
+
return print9(childPath);
|
|
52702
52702
|
}, "children")).indentTail(options.tabWidth);
|
|
52703
|
-
var closingLines = path2.call(
|
|
52703
|
+
var closingLines = path2.call(print9, closingPropName);
|
|
52704
52704
|
return (0, lines_1.concat)([openingLines, childLines, closingLines]);
|
|
52705
52705
|
}
|
|
52706
52706
|
case "JSXOpeningElement": {
|
|
52707
|
-
parts.push("<", path2.call(
|
|
52707
|
+
parts.push("<", path2.call(print9, "name"));
|
|
52708
52708
|
var attrParts_1 = [];
|
|
52709
52709
|
path2.each(function(attrPath) {
|
|
52710
|
-
attrParts_1.push(" ",
|
|
52710
|
+
attrParts_1.push(" ", print9(attrPath));
|
|
52711
52711
|
}, "attributes");
|
|
52712
52712
|
var attrLines = (0, lines_1.concat)(attrParts_1);
|
|
52713
52713
|
var needLineWrap = attrLines.length > 1 || attrLines.getLineLength(1) > options.wrapColumn;
|
|
@@ -52724,7 +52724,7 @@ var require_printer2 = __commonJS({
|
|
|
52724
52724
|
return (0, lines_1.concat)(parts);
|
|
52725
52725
|
}
|
|
52726
52726
|
case "JSXClosingElement":
|
|
52727
|
-
return (0, lines_1.concat)(["</", path2.call(
|
|
52727
|
+
return (0, lines_1.concat)(["</", path2.call(print9, "name"), ">"]);
|
|
52728
52728
|
case "JSXOpeningFragment":
|
|
52729
52729
|
return (0, lines_1.fromString)("<>");
|
|
52730
52730
|
case "JSXClosingFragment":
|
|
@@ -52735,9 +52735,9 @@ var require_printer2 = __commonJS({
|
|
|
52735
52735
|
return (0, lines_1.fromString)("");
|
|
52736
52736
|
case "TypeAnnotatedIdentifier":
|
|
52737
52737
|
return (0, lines_1.concat)([
|
|
52738
|
-
path2.call(
|
|
52738
|
+
path2.call(print9, "annotation"),
|
|
52739
52739
|
" ",
|
|
52740
|
-
path2.call(
|
|
52740
|
+
path2.call(print9, "identifier")
|
|
52741
52741
|
]);
|
|
52742
52742
|
case "ClassBody":
|
|
52743
52743
|
if (n.body.length === 0) {
|
|
@@ -52746,12 +52746,12 @@ var require_printer2 = __commonJS({
|
|
|
52746
52746
|
return (0, lines_1.concat)([
|
|
52747
52747
|
"{\n",
|
|
52748
52748
|
path2.call(function(bodyPath) {
|
|
52749
|
-
return printStatementSequence(bodyPath, options,
|
|
52749
|
+
return printStatementSequence(bodyPath, options, print9);
|
|
52750
52750
|
}, "body").indent(options.tabWidth),
|
|
52751
52751
|
"\n}"
|
|
52752
52752
|
]);
|
|
52753
52753
|
case "ClassPropertyDefinition":
|
|
52754
|
-
parts.push("static ", path2.call(
|
|
52754
|
+
parts.push("static ", path2.call(print9, "definition"));
|
|
52755
52755
|
if (!namedTypes.MethodDefinition.check(n.definition))
|
|
52756
52756
|
parts.push(";");
|
|
52757
52757
|
return (0, lines_1.concat)(parts);
|
|
@@ -52772,12 +52772,12 @@ var require_printer2 = __commonJS({
|
|
|
52772
52772
|
if (n.readonly) {
|
|
52773
52773
|
parts.push("readonly ");
|
|
52774
52774
|
}
|
|
52775
|
-
var key = path2.call(
|
|
52775
|
+
var key = path2.call(print9, "key");
|
|
52776
52776
|
if (n.computed) {
|
|
52777
52777
|
key = (0, lines_1.concat)(["[", key, "]"]);
|
|
52778
52778
|
}
|
|
52779
52779
|
if (n.variance) {
|
|
52780
|
-
key = (0, lines_1.concat)([printVariance(path2,
|
|
52780
|
+
key = (0, lines_1.concat)([printVariance(path2, print9), key]);
|
|
52781
52781
|
}
|
|
52782
52782
|
parts.push(key);
|
|
52783
52783
|
if (n.optional) {
|
|
@@ -52787,10 +52787,10 @@ var require_printer2 = __commonJS({
|
|
|
52787
52787
|
parts.push("!");
|
|
52788
52788
|
}
|
|
52789
52789
|
if (n.typeAnnotation) {
|
|
52790
|
-
parts.push(path2.call(
|
|
52790
|
+
parts.push(path2.call(print9, "typeAnnotation"));
|
|
52791
52791
|
}
|
|
52792
52792
|
if (n.value) {
|
|
52793
|
-
parts.push(" = ", path2.call(
|
|
52793
|
+
parts.push(" = ", path2.call(print9, "value"));
|
|
52794
52794
|
}
|
|
52795
52795
|
parts.push(";");
|
|
52796
52796
|
return (0, lines_1.concat)(parts);
|
|
@@ -52799,21 +52799,21 @@ var require_printer2 = __commonJS({
|
|
|
52799
52799
|
if (n.static) {
|
|
52800
52800
|
parts.push("static ");
|
|
52801
52801
|
}
|
|
52802
|
-
parts.push(path2.call(
|
|
52802
|
+
parts.push(path2.call(print9, "key"));
|
|
52803
52803
|
if (n.typeAnnotation) {
|
|
52804
|
-
parts.push(path2.call(
|
|
52804
|
+
parts.push(path2.call(print9, "typeAnnotation"));
|
|
52805
52805
|
}
|
|
52806
52806
|
if (n.value) {
|
|
52807
|
-
parts.push(" = ", path2.call(
|
|
52807
|
+
parts.push(" = ", path2.call(print9, "value"));
|
|
52808
52808
|
}
|
|
52809
52809
|
parts.push(";");
|
|
52810
52810
|
return (0, lines_1.concat)(parts);
|
|
52811
52811
|
case "ClassAccessorProperty": {
|
|
52812
52812
|
parts.push.apply(parts, tslib_1.__spreadArray(tslib_1.__spreadArray([], printClassMemberModifiers(n), false), ["accessor "], false));
|
|
52813
52813
|
if (n.computed) {
|
|
52814
|
-
parts.push("[", path2.call(
|
|
52814
|
+
parts.push("[", path2.call(print9, "key"), "]");
|
|
52815
52815
|
} else {
|
|
52816
|
-
parts.push(path2.call(
|
|
52816
|
+
parts.push(path2.call(print9, "key"));
|
|
52817
52817
|
}
|
|
52818
52818
|
if (n.optional) {
|
|
52819
52819
|
parts.push("?");
|
|
@@ -52822,10 +52822,10 @@ var require_printer2 = __commonJS({
|
|
|
52822
52822
|
parts.push("!");
|
|
52823
52823
|
}
|
|
52824
52824
|
if (n.typeAnnotation) {
|
|
52825
|
-
parts.push(path2.call(
|
|
52825
|
+
parts.push(path2.call(print9, "typeAnnotation"));
|
|
52826
52826
|
}
|
|
52827
52827
|
if (n.value) {
|
|
52828
|
-
parts.push(" = ", path2.call(
|
|
52828
|
+
parts.push(" = ", path2.call(print9, "value"));
|
|
52829
52829
|
}
|
|
52830
52830
|
parts.push(";");
|
|
52831
52831
|
return (0, lines_1.concat)(parts);
|
|
@@ -52841,21 +52841,21 @@ var require_printer2 = __commonJS({
|
|
|
52841
52841
|
}
|
|
52842
52842
|
parts.push("class");
|
|
52843
52843
|
if (n.id) {
|
|
52844
|
-
parts.push(" ", path2.call(
|
|
52844
|
+
parts.push(" ", path2.call(print9, "id"));
|
|
52845
52845
|
}
|
|
52846
52846
|
if (n.typeParameters) {
|
|
52847
|
-
parts.push(path2.call(
|
|
52847
|
+
parts.push(path2.call(print9, "typeParameters"));
|
|
52848
52848
|
}
|
|
52849
52849
|
if (n.superClass) {
|
|
52850
|
-
parts.push(" extends ", path2.call(
|
|
52850
|
+
parts.push(" extends ", path2.call(print9, "superClass"), path2.call(print9, "superTypeParameters"));
|
|
52851
52851
|
}
|
|
52852
52852
|
if (n.extends && n.extends.length > 0) {
|
|
52853
|
-
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(
|
|
52853
|
+
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(print9, "extends")));
|
|
52854
52854
|
}
|
|
52855
52855
|
if (n["implements"] && n["implements"].length > 0) {
|
|
52856
|
-
parts.push(" implements ", (0, lines_1.fromString)(", ").join(path2.map(
|
|
52856
|
+
parts.push(" implements ", (0, lines_1.fromString)(", ").join(path2.map(print9, "implements")));
|
|
52857
52857
|
}
|
|
52858
|
-
parts.push(" ", path2.call(
|
|
52858
|
+
parts.push(" ", path2.call(print9, "body"));
|
|
52859
52859
|
if (n.type === "DeclareClass") {
|
|
52860
52860
|
return printFlowDeclaration(path2, parts);
|
|
52861
52861
|
} else {
|
|
@@ -52864,11 +52864,11 @@ var require_printer2 = __commonJS({
|
|
|
52864
52864
|
case "TemplateElement":
|
|
52865
52865
|
return (0, lines_1.fromString)(n.value.raw, options).lockIndentTail();
|
|
52866
52866
|
case "TemplateLiteral": {
|
|
52867
|
-
var expressions_1 = path2.map(
|
|
52867
|
+
var expressions_1 = path2.map(print9, "expressions");
|
|
52868
52868
|
parts.push("`");
|
|
52869
52869
|
path2.each(function(childPath) {
|
|
52870
52870
|
var i = childPath.getName();
|
|
52871
|
-
parts.push(
|
|
52871
|
+
parts.push(print9(childPath));
|
|
52872
52872
|
if (i < expressions_1.length) {
|
|
52873
52873
|
parts.push("${", expressions_1[i], "}");
|
|
52874
52874
|
}
|
|
@@ -52877,7 +52877,7 @@ var require_printer2 = __commonJS({
|
|
|
52877
52877
|
return (0, lines_1.concat)(parts).lockIndentTail();
|
|
52878
52878
|
}
|
|
52879
52879
|
case "TaggedTemplateExpression":
|
|
52880
|
-
return (0, lines_1.concat)([path2.call(
|
|
52880
|
+
return (0, lines_1.concat)([path2.call(print9, "tag"), path2.call(print9, "quasi")]);
|
|
52881
52881
|
case "Node":
|
|
52882
52882
|
case "Printable":
|
|
52883
52883
|
case "SourceLocation":
|
|
@@ -52911,7 +52911,7 @@ var require_printer2 = __commonJS({
|
|
|
52911
52911
|
if (n.typeAnnotation.type !== "FunctionTypeAnnotation") {
|
|
52912
52912
|
parts.push(": ");
|
|
52913
52913
|
}
|
|
52914
|
-
parts.push(path2.call(
|
|
52914
|
+
parts.push(path2.call(print9, "typeAnnotation"));
|
|
52915
52915
|
return (0, lines_1.concat)(parts);
|
|
52916
52916
|
}
|
|
52917
52917
|
return (0, lines_1.fromString)("");
|
|
@@ -52925,9 +52925,9 @@ var require_printer2 = __commonJS({
|
|
|
52925
52925
|
case "MixedTypeAnnotation":
|
|
52926
52926
|
return (0, lines_1.fromString)("mixed", options);
|
|
52927
52927
|
case "ArrayTypeAnnotation":
|
|
52928
|
-
return (0, lines_1.concat)([path2.call(
|
|
52928
|
+
return (0, lines_1.concat)([path2.call(print9, "elementType"), "[]"]);
|
|
52929
52929
|
case "TupleTypeAnnotation": {
|
|
52930
|
-
var printed_2 = path2.map(
|
|
52930
|
+
var printed_2 = path2.map(print9, "types");
|
|
52931
52931
|
var joined = (0, lines_1.fromString)(", ").join(printed_2);
|
|
52932
52932
|
var oneLine_3 = joined.getLineLength(1) <= options.wrapColumn;
|
|
52933
52933
|
if (oneLine_3) {
|
|
@@ -52974,38 +52974,38 @@ var require_printer2 = __commonJS({
|
|
|
52974
52974
|
case "InterfaceTypeAnnotation":
|
|
52975
52975
|
parts.push("interface");
|
|
52976
52976
|
if (n.extends && n.extends.length > 0) {
|
|
52977
|
-
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(
|
|
52977
|
+
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(print9, "extends")));
|
|
52978
52978
|
}
|
|
52979
|
-
parts.push(" ", path2.call(
|
|
52979
|
+
parts.push(" ", path2.call(print9, "body"));
|
|
52980
52980
|
return (0, lines_1.concat)(parts);
|
|
52981
52981
|
case "DeclareFunction":
|
|
52982
52982
|
return printFlowDeclaration(path2, [
|
|
52983
52983
|
"function ",
|
|
52984
|
-
path2.call(
|
|
52984
|
+
path2.call(print9, "id"),
|
|
52985
52985
|
";"
|
|
52986
52986
|
]);
|
|
52987
52987
|
case "DeclareModule":
|
|
52988
52988
|
return printFlowDeclaration(path2, [
|
|
52989
52989
|
"module ",
|
|
52990
|
-
path2.call(
|
|
52990
|
+
path2.call(print9, "id"),
|
|
52991
52991
|
" ",
|
|
52992
|
-
path2.call(
|
|
52992
|
+
path2.call(print9, "body")
|
|
52993
52993
|
]);
|
|
52994
52994
|
case "DeclareModuleExports":
|
|
52995
52995
|
return printFlowDeclaration(path2, [
|
|
52996
52996
|
"module.exports",
|
|
52997
|
-
path2.call(
|
|
52997
|
+
path2.call(print9, "typeAnnotation")
|
|
52998
52998
|
]);
|
|
52999
52999
|
case "DeclareVariable":
|
|
53000
|
-
return printFlowDeclaration(path2, ["var ", path2.call(
|
|
53000
|
+
return printFlowDeclaration(path2, ["var ", path2.call(print9, "id"), ";"]);
|
|
53001
53001
|
case "DeclareExportDeclaration":
|
|
53002
53002
|
case "DeclareExportAllDeclaration":
|
|
53003
|
-
return (0, lines_1.concat)(["declare ", printExportDeclaration(path2, options,
|
|
53003
|
+
return (0, lines_1.concat)(["declare ", printExportDeclaration(path2, options, print9)]);
|
|
53004
53004
|
case "EnumDeclaration":
|
|
53005
53005
|
return (0, lines_1.concat)([
|
|
53006
53006
|
"enum ",
|
|
53007
|
-
path2.call(
|
|
53008
|
-
path2.call(
|
|
53007
|
+
path2.call(print9, "id"),
|
|
53008
|
+
path2.call(print9, "body")
|
|
53009
53009
|
]);
|
|
53010
53010
|
case "EnumBooleanBody":
|
|
53011
53011
|
case "EnumNumberBody":
|
|
@@ -53017,24 +53017,24 @@ var require_printer2 = __commonJS({
|
|
|
53017
53017
|
n.type.slice(4, -4).toLowerCase()
|
|
53018
53018
|
);
|
|
53019
53019
|
}
|
|
53020
|
-
parts.push(" {\n", (0, lines_1.fromString)("\n").join(path2.map(
|
|
53020
|
+
parts.push(" {\n", (0, lines_1.fromString)("\n").join(path2.map(print9, "members")).indent(options.tabWidth), "\n}");
|
|
53021
53021
|
return (0, lines_1.concat)(parts);
|
|
53022
53022
|
}
|
|
53023
53023
|
case "EnumDefaultedMember":
|
|
53024
|
-
return (0, lines_1.concat)([path2.call(
|
|
53024
|
+
return (0, lines_1.concat)([path2.call(print9, "id"), ","]);
|
|
53025
53025
|
case "EnumBooleanMember":
|
|
53026
53026
|
case "EnumNumberMember":
|
|
53027
53027
|
case "EnumStringMember":
|
|
53028
53028
|
return (0, lines_1.concat)([
|
|
53029
|
-
path2.call(
|
|
53029
|
+
path2.call(print9, "id"),
|
|
53030
53030
|
" = ",
|
|
53031
|
-
path2.call(
|
|
53031
|
+
path2.call(print9, "init"),
|
|
53032
53032
|
","
|
|
53033
53033
|
]);
|
|
53034
53034
|
case "InferredPredicate":
|
|
53035
53035
|
return (0, lines_1.fromString)("%checks", options);
|
|
53036
53036
|
case "DeclaredPredicate":
|
|
53037
|
-
return (0, lines_1.concat)(["%checks(", path2.call(
|
|
53037
|
+
return (0, lines_1.concat)(["%checks(", path2.call(print9, "value"), ")"]);
|
|
53038
53038
|
case "FunctionTypeAnnotation": {
|
|
53039
53039
|
var parent = path2.getParentNode(0);
|
|
53040
53040
|
var isArrowFunctionTypeAnnotation = !(namedTypes.ObjectTypeCallProperty.check(parent) || namedTypes.ObjectTypeInternalSlot.check(parent) && parent.method || namedTypes.DeclareFunction.check(path2.getParentNode(2)));
|
|
@@ -53044,14 +53044,14 @@ var require_printer2 = __commonJS({
|
|
|
53044
53044
|
}
|
|
53045
53045
|
var hasTypeParameters = !!n.typeParameters;
|
|
53046
53046
|
var needsParens = hasTypeParameters || n.params.length !== 1 || n.params[0].name;
|
|
53047
|
-
parts.push(hasTypeParameters ? path2.call(
|
|
53047
|
+
parts.push(hasTypeParameters ? path2.call(print9, "typeParameters") : "", needsParens ? "(" : "", printFunctionParams(path2, options, print9), needsParens ? ")" : "");
|
|
53048
53048
|
if (n.returnType) {
|
|
53049
|
-
parts.push(isArrowFunctionTypeAnnotation ? " => " : ": ", path2.call(
|
|
53049
|
+
parts.push(isArrowFunctionTypeAnnotation ? " => " : ": ", path2.call(print9, "returnType"));
|
|
53050
53050
|
}
|
|
53051
53051
|
return (0, lines_1.concat)(parts);
|
|
53052
53052
|
}
|
|
53053
53053
|
case "FunctionTypeParam": {
|
|
53054
|
-
var name = path2.call(
|
|
53054
|
+
var name = path2.call(print9, "name");
|
|
53055
53055
|
parts.push(name);
|
|
53056
53056
|
if (n.optional) {
|
|
53057
53057
|
parts.push("?");
|
|
@@ -53059,13 +53059,13 @@ var require_printer2 = __commonJS({
|
|
|
53059
53059
|
if (name.infos[0].line) {
|
|
53060
53060
|
parts.push(": ");
|
|
53061
53061
|
}
|
|
53062
|
-
parts.push(path2.call(
|
|
53062
|
+
parts.push(path2.call(print9, "typeAnnotation"));
|
|
53063
53063
|
return (0, lines_1.concat)(parts);
|
|
53064
53064
|
}
|
|
53065
53065
|
case "GenericTypeAnnotation":
|
|
53066
53066
|
return (0, lines_1.concat)([
|
|
53067
|
-
path2.call(
|
|
53068
|
-
path2.call(
|
|
53067
|
+
path2.call(print9, "id"),
|
|
53068
|
+
path2.call(print9, "typeParameters")
|
|
53069
53069
|
]);
|
|
53070
53070
|
case "DeclareInterface":
|
|
53071
53071
|
parts.push("declare ");
|
|
@@ -53074,24 +53074,24 @@ var require_printer2 = __commonJS({
|
|
|
53074
53074
|
if (n.declare) {
|
|
53075
53075
|
parts.push("declare ");
|
|
53076
53076
|
}
|
|
53077
|
-
parts.push("interface ", path2.call(
|
|
53077
|
+
parts.push("interface ", path2.call(print9, "id"), path2.call(print9, "typeParameters"), " ");
|
|
53078
53078
|
if (n["extends"] && n["extends"].length > 0) {
|
|
53079
|
-
parts.push("extends ", (0, lines_1.fromString)(", ").join(path2.map(
|
|
53079
|
+
parts.push("extends ", (0, lines_1.fromString)(", ").join(path2.map(print9, "extends")), " ");
|
|
53080
53080
|
}
|
|
53081
53081
|
if (n.body) {
|
|
53082
|
-
parts.push(path2.call(
|
|
53082
|
+
parts.push(path2.call(print9, "body"));
|
|
53083
53083
|
}
|
|
53084
53084
|
return (0, lines_1.concat)(parts);
|
|
53085
53085
|
case "ClassImplements":
|
|
53086
53086
|
case "InterfaceExtends":
|
|
53087
53087
|
return (0, lines_1.concat)([
|
|
53088
|
-
path2.call(
|
|
53089
|
-
path2.call(
|
|
53088
|
+
path2.call(print9, "id"),
|
|
53089
|
+
path2.call(print9, "typeParameters")
|
|
53090
53090
|
]);
|
|
53091
53091
|
case "IntersectionTypeAnnotation":
|
|
53092
|
-
return (0, lines_1.fromString)(" & ").join(path2.map(
|
|
53092
|
+
return (0, lines_1.fromString)(" & ").join(path2.map(print9, "types"));
|
|
53093
53093
|
case "NullableTypeAnnotation":
|
|
53094
|
-
return (0, lines_1.concat)(["?", path2.call(
|
|
53094
|
+
return (0, lines_1.concat)(["?", path2.call(print9, "typeAnnotation")]);
|
|
53095
53095
|
case "NullLiteralTypeAnnotation":
|
|
53096
53096
|
return (0, lines_1.fromString)("null", options);
|
|
53097
53097
|
case "ThisTypeAnnotation":
|
|
@@ -53099,40 +53099,40 @@ var require_printer2 = __commonJS({
|
|
|
53099
53099
|
case "NumberTypeAnnotation":
|
|
53100
53100
|
return (0, lines_1.fromString)("number", options);
|
|
53101
53101
|
case "ObjectTypeCallProperty":
|
|
53102
|
-
return path2.call(
|
|
53102
|
+
return path2.call(print9, "value");
|
|
53103
53103
|
case "ObjectTypeIndexer":
|
|
53104
53104
|
if (n.static) {
|
|
53105
53105
|
parts.push("static ");
|
|
53106
53106
|
}
|
|
53107
|
-
parts.push(printVariance(path2,
|
|
53107
|
+
parts.push(printVariance(path2, print9), "[");
|
|
53108
53108
|
if (n.id) {
|
|
53109
|
-
parts.push(path2.call(
|
|
53109
|
+
parts.push(path2.call(print9, "id"), ": ");
|
|
53110
53110
|
}
|
|
53111
|
-
parts.push(path2.call(
|
|
53111
|
+
parts.push(path2.call(print9, "key"), "]: ", path2.call(print9, "value"));
|
|
53112
53112
|
return (0, lines_1.concat)(parts);
|
|
53113
53113
|
case "ObjectTypeProperty":
|
|
53114
53114
|
return (0, lines_1.concat)([
|
|
53115
|
-
printVariance(path2,
|
|
53116
|
-
path2.call(
|
|
53115
|
+
printVariance(path2, print9),
|
|
53116
|
+
path2.call(print9, "key"),
|
|
53117
53117
|
n.optional ? "?" : "",
|
|
53118
53118
|
": ",
|
|
53119
|
-
path2.call(
|
|
53119
|
+
path2.call(print9, "value")
|
|
53120
53120
|
]);
|
|
53121
53121
|
case "ObjectTypeInternalSlot":
|
|
53122
53122
|
return (0, lines_1.concat)([
|
|
53123
53123
|
n.static ? "static " : "",
|
|
53124
53124
|
"[[",
|
|
53125
|
-
path2.call(
|
|
53125
|
+
path2.call(print9, "id"),
|
|
53126
53126
|
"]]",
|
|
53127
53127
|
n.optional ? "?" : "",
|
|
53128
53128
|
n.value.type !== "FunctionTypeAnnotation" ? ": " : "",
|
|
53129
|
-
path2.call(
|
|
53129
|
+
path2.call(print9, "value")
|
|
53130
53130
|
]);
|
|
53131
53131
|
case "QualifiedTypeIdentifier":
|
|
53132
53132
|
return (0, lines_1.concat)([
|
|
53133
|
-
path2.call(
|
|
53133
|
+
path2.call(print9, "qualification"),
|
|
53134
53134
|
".",
|
|
53135
|
-
path2.call(
|
|
53135
|
+
path2.call(print9, "id")
|
|
53136
53136
|
]);
|
|
53137
53137
|
case "StringLiteralTypeAnnotation":
|
|
53138
53138
|
return (0, lines_1.fromString)(nodeStr(n.value, options), options);
|
|
@@ -53149,36 +53149,36 @@ var require_printer2 = __commonJS({
|
|
|
53149
53149
|
case "TypeAlias":
|
|
53150
53150
|
return (0, lines_1.concat)([
|
|
53151
53151
|
"type ",
|
|
53152
|
-
path2.call(
|
|
53153
|
-
path2.call(
|
|
53152
|
+
path2.call(print9, "id"),
|
|
53153
|
+
path2.call(print9, "typeParameters"),
|
|
53154
53154
|
" = ",
|
|
53155
|
-
path2.call(
|
|
53155
|
+
path2.call(print9, "right"),
|
|
53156
53156
|
";"
|
|
53157
53157
|
]);
|
|
53158
53158
|
case "DeclareOpaqueType":
|
|
53159
53159
|
parts.push("declare ");
|
|
53160
53160
|
case "OpaqueType":
|
|
53161
|
-
parts.push("opaque type ", path2.call(
|
|
53161
|
+
parts.push("opaque type ", path2.call(print9, "id"), path2.call(print9, "typeParameters"));
|
|
53162
53162
|
if (n["supertype"]) {
|
|
53163
|
-
parts.push(": ", path2.call(
|
|
53163
|
+
parts.push(": ", path2.call(print9, "supertype"));
|
|
53164
53164
|
}
|
|
53165
53165
|
if (n["impltype"]) {
|
|
53166
|
-
parts.push(" = ", path2.call(
|
|
53166
|
+
parts.push(" = ", path2.call(print9, "impltype"));
|
|
53167
53167
|
}
|
|
53168
53168
|
parts.push(";");
|
|
53169
53169
|
return (0, lines_1.concat)(parts);
|
|
53170
53170
|
case "TypeCastExpression":
|
|
53171
53171
|
return (0, lines_1.concat)([
|
|
53172
53172
|
"(",
|
|
53173
|
-
path2.call(
|
|
53174
|
-
path2.call(
|
|
53173
|
+
path2.call(print9, "expression"),
|
|
53174
|
+
path2.call(print9, "typeAnnotation"),
|
|
53175
53175
|
")"
|
|
53176
53176
|
]);
|
|
53177
53177
|
case "TypeParameterDeclaration":
|
|
53178
53178
|
case "TypeParameterInstantiation":
|
|
53179
53179
|
return (0, lines_1.concat)([
|
|
53180
53180
|
"<",
|
|
53181
|
-
(0, lines_1.fromString)(", ").join(path2.map(
|
|
53181
|
+
(0, lines_1.fromString)(", ").join(path2.map(print9, "params")),
|
|
53182
53182
|
">"
|
|
53183
53183
|
]);
|
|
53184
53184
|
case "Variance":
|
|
@@ -53191,32 +53191,32 @@ var require_printer2 = __commonJS({
|
|
|
53191
53191
|
return (0, lines_1.fromString)("");
|
|
53192
53192
|
case "TypeParameter":
|
|
53193
53193
|
if (n.variance) {
|
|
53194
|
-
parts.push(printVariance(path2,
|
|
53194
|
+
parts.push(printVariance(path2, print9));
|
|
53195
53195
|
}
|
|
53196
|
-
parts.push(path2.call(
|
|
53196
|
+
parts.push(path2.call(print9, "name"));
|
|
53197
53197
|
if (n.bound) {
|
|
53198
|
-
parts.push(path2.call(
|
|
53198
|
+
parts.push(path2.call(print9, "bound"));
|
|
53199
53199
|
}
|
|
53200
53200
|
if (n["default"]) {
|
|
53201
|
-
parts.push("=", path2.call(
|
|
53201
|
+
parts.push("=", path2.call(print9, "default"));
|
|
53202
53202
|
}
|
|
53203
53203
|
return (0, lines_1.concat)(parts);
|
|
53204
53204
|
case "TypeofTypeAnnotation":
|
|
53205
53205
|
return (0, lines_1.concat)([
|
|
53206
53206
|
(0, lines_1.fromString)("typeof ", options),
|
|
53207
|
-
path2.call(
|
|
53207
|
+
path2.call(print9, "argument")
|
|
53208
53208
|
]);
|
|
53209
53209
|
case "IndexedAccessType":
|
|
53210
53210
|
case "OptionalIndexedAccessType":
|
|
53211
53211
|
return (0, lines_1.concat)([
|
|
53212
|
-
path2.call(
|
|
53212
|
+
path2.call(print9, "objectType"),
|
|
53213
53213
|
n.optional ? "?." : "",
|
|
53214
53214
|
"[",
|
|
53215
|
-
path2.call(
|
|
53215
|
+
path2.call(print9, "indexType"),
|
|
53216
53216
|
"]"
|
|
53217
53217
|
]);
|
|
53218
53218
|
case "UnionTypeAnnotation":
|
|
53219
|
-
return (0, lines_1.fromString)(" | ").join(path2.map(
|
|
53219
|
+
return (0, lines_1.fromString)(" | ").join(path2.map(print9, "types"));
|
|
53220
53220
|
case "VoidTypeAnnotation":
|
|
53221
53221
|
return (0, lines_1.fromString)("void", options);
|
|
53222
53222
|
case "NullTypeAnnotation":
|
|
@@ -53256,77 +53256,77 @@ var require_printer2 = __commonJS({
|
|
|
53256
53256
|
case "TSNeverKeyword":
|
|
53257
53257
|
return (0, lines_1.fromString)("never", options);
|
|
53258
53258
|
case "TSArrayType":
|
|
53259
|
-
return (0, lines_1.concat)([path2.call(
|
|
53259
|
+
return (0, lines_1.concat)([path2.call(print9, "elementType"), "[]"]);
|
|
53260
53260
|
case "TSLiteralType":
|
|
53261
|
-
return path2.call(
|
|
53261
|
+
return path2.call(print9, "literal");
|
|
53262
53262
|
case "TSUnionType":
|
|
53263
|
-
return (0, lines_1.fromString)(" | ").join(path2.map(
|
|
53263
|
+
return (0, lines_1.fromString)(" | ").join(path2.map(print9, "types"));
|
|
53264
53264
|
case "TSIntersectionType":
|
|
53265
|
-
return (0, lines_1.fromString)(" & ").join(path2.map(
|
|
53265
|
+
return (0, lines_1.fromString)(" & ").join(path2.map(print9, "types"));
|
|
53266
53266
|
case "TSConditionalType":
|
|
53267
|
-
parts.push(path2.call(
|
|
53267
|
+
parts.push(path2.call(print9, "checkType"), " extends ", path2.call(print9, "extendsType"), " ? ", path2.call(print9, "trueType"), " : ", path2.call(print9, "falseType"));
|
|
53268
53268
|
return (0, lines_1.concat)(parts);
|
|
53269
53269
|
case "TSInferType":
|
|
53270
|
-
parts.push("infer ", path2.call(
|
|
53270
|
+
parts.push("infer ", path2.call(print9, "typeParameter"));
|
|
53271
53271
|
return (0, lines_1.concat)(parts);
|
|
53272
53272
|
case "TSParenthesizedType":
|
|
53273
|
-
return (0, lines_1.concat)(["(", path2.call(
|
|
53273
|
+
return (0, lines_1.concat)(["(", path2.call(print9, "typeAnnotation"), ")"]);
|
|
53274
53274
|
case "TSFunctionType":
|
|
53275
53275
|
return (0, lines_1.concat)([
|
|
53276
|
-
path2.call(
|
|
53276
|
+
path2.call(print9, "typeParameters"),
|
|
53277
53277
|
"(",
|
|
53278
|
-
printFunctionParams(path2, options,
|
|
53278
|
+
printFunctionParams(path2, options, print9),
|
|
53279
53279
|
") => ",
|
|
53280
|
-
path2.call(
|
|
53280
|
+
path2.call(print9, "typeAnnotation", "typeAnnotation")
|
|
53281
53281
|
]);
|
|
53282
53282
|
case "TSConstructorType":
|
|
53283
53283
|
return (0, lines_1.concat)([
|
|
53284
53284
|
"new ",
|
|
53285
|
-
path2.call(
|
|
53285
|
+
path2.call(print9, "typeParameters"),
|
|
53286
53286
|
"(",
|
|
53287
|
-
printFunctionParams(path2, options,
|
|
53287
|
+
printFunctionParams(path2, options, print9),
|
|
53288
53288
|
") => ",
|
|
53289
|
-
path2.call(
|
|
53289
|
+
path2.call(print9, "typeAnnotation", "typeAnnotation")
|
|
53290
53290
|
]);
|
|
53291
53291
|
case "TSMappedType": {
|
|
53292
|
-
parts.push(n.readonly ? "readonly " : "", "[", path2.call(
|
|
53292
|
+
parts.push(n.readonly ? "readonly " : "", "[", path2.call(print9, "typeParameter"), "]", n.optional ? "?" : "");
|
|
53293
53293
|
if (n.typeAnnotation) {
|
|
53294
|
-
parts.push(": ", path2.call(
|
|
53294
|
+
parts.push(": ", path2.call(print9, "typeAnnotation"), ";");
|
|
53295
53295
|
}
|
|
53296
53296
|
return (0, lines_1.concat)(["{\n", (0, lines_1.concat)(parts).indent(options.tabWidth), "\n}"]);
|
|
53297
53297
|
}
|
|
53298
53298
|
case "TSTupleType":
|
|
53299
53299
|
return (0, lines_1.concat)([
|
|
53300
53300
|
"[",
|
|
53301
|
-
(0, lines_1.fromString)(", ").join(path2.map(
|
|
53301
|
+
(0, lines_1.fromString)(", ").join(path2.map(print9, "elementTypes")),
|
|
53302
53302
|
"]"
|
|
53303
53303
|
]);
|
|
53304
53304
|
case "TSNamedTupleMember":
|
|
53305
|
-
parts.push(path2.call(
|
|
53305
|
+
parts.push(path2.call(print9, "label"));
|
|
53306
53306
|
if (n.optional) {
|
|
53307
53307
|
parts.push("?");
|
|
53308
53308
|
}
|
|
53309
|
-
parts.push(": ", path2.call(
|
|
53309
|
+
parts.push(": ", path2.call(print9, "elementType"));
|
|
53310
53310
|
return (0, lines_1.concat)(parts);
|
|
53311
53311
|
case "TSRestType":
|
|
53312
|
-
return (0, lines_1.concat)(["...", path2.call(
|
|
53312
|
+
return (0, lines_1.concat)(["...", path2.call(print9, "typeAnnotation")]);
|
|
53313
53313
|
case "TSOptionalType":
|
|
53314
|
-
return (0, lines_1.concat)([path2.call(
|
|
53314
|
+
return (0, lines_1.concat)([path2.call(print9, "typeAnnotation"), "?"]);
|
|
53315
53315
|
case "TSIndexedAccessType":
|
|
53316
53316
|
return (0, lines_1.concat)([
|
|
53317
|
-
path2.call(
|
|
53317
|
+
path2.call(print9, "objectType"),
|
|
53318
53318
|
"[",
|
|
53319
|
-
path2.call(
|
|
53319
|
+
path2.call(print9, "indexType"),
|
|
53320
53320
|
"]"
|
|
53321
53321
|
]);
|
|
53322
53322
|
case "TSTypeOperator":
|
|
53323
53323
|
return (0, lines_1.concat)([
|
|
53324
|
-
path2.call(
|
|
53324
|
+
path2.call(print9, "operator"),
|
|
53325
53325
|
" ",
|
|
53326
|
-
path2.call(
|
|
53326
|
+
path2.call(print9, "typeAnnotation")
|
|
53327
53327
|
]);
|
|
53328
53328
|
case "TSTypeLiteral": {
|
|
53329
|
-
var members = (0, lines_1.fromString)("\n").join(path2.map(
|
|
53329
|
+
var members = (0, lines_1.fromString)("\n").join(path2.map(print9, "members").map(function(member) {
|
|
53330
53330
|
if (lastNonSpaceCharacter(member) !== ";") {
|
|
53331
53331
|
return member.concat(";");
|
|
53332
53332
|
}
|
|
@@ -53339,13 +53339,13 @@ var require_printer2 = __commonJS({
|
|
|
53339
53339
|
return (0, lines_1.concat)(parts);
|
|
53340
53340
|
}
|
|
53341
53341
|
case "TSEnumMember":
|
|
53342
|
-
parts.push(path2.call(
|
|
53342
|
+
parts.push(path2.call(print9, "id"));
|
|
53343
53343
|
if (n.initializer) {
|
|
53344
|
-
parts.push(" = ", path2.call(
|
|
53344
|
+
parts.push(" = ", path2.call(print9, "initializer"));
|
|
53345
53345
|
}
|
|
53346
53346
|
return (0, lines_1.concat)(parts);
|
|
53347
53347
|
case "TSTypeQuery":
|
|
53348
|
-
return (0, lines_1.concat)(["typeof ", path2.call(
|
|
53348
|
+
return (0, lines_1.concat)(["typeof ", path2.call(print9, "exprName")]);
|
|
53349
53349
|
case "TSParameterProperty":
|
|
53350
53350
|
if (n.accessibility) {
|
|
53351
53351
|
parts.push(n.accessibility, " ");
|
|
@@ -53359,119 +53359,119 @@ var require_printer2 = __commonJS({
|
|
|
53359
53359
|
if (n.readonly) {
|
|
53360
53360
|
parts.push("readonly ");
|
|
53361
53361
|
}
|
|
53362
|
-
parts.push(path2.call(
|
|
53362
|
+
parts.push(path2.call(print9, "parameter"));
|
|
53363
53363
|
return (0, lines_1.concat)(parts);
|
|
53364
53364
|
case "TSTypeReference":
|
|
53365
53365
|
return (0, lines_1.concat)([
|
|
53366
|
-
path2.call(
|
|
53367
|
-
path2.call(
|
|
53366
|
+
path2.call(print9, "typeName"),
|
|
53367
|
+
path2.call(print9, "typeParameters")
|
|
53368
53368
|
]);
|
|
53369
53369
|
case "TSQualifiedName":
|
|
53370
|
-
return (0, lines_1.concat)([path2.call(
|
|
53370
|
+
return (0, lines_1.concat)([path2.call(print9, "left"), ".", path2.call(print9, "right")]);
|
|
53371
53371
|
case "TSAsExpression":
|
|
53372
53372
|
case "TSSatisfiesExpression": {
|
|
53373
|
-
var expression = path2.call(
|
|
53374
|
-
parts.push(expression, n.type === "TSSatisfiesExpression" ? " satisfies " : " as ", path2.call(
|
|
53373
|
+
var expression = path2.call(print9, "expression");
|
|
53374
|
+
parts.push(expression, n.type === "TSSatisfiesExpression" ? " satisfies " : " as ", path2.call(print9, "typeAnnotation"));
|
|
53375
53375
|
return (0, lines_1.concat)(parts);
|
|
53376
53376
|
}
|
|
53377
53377
|
case "TSTypeCastExpression":
|
|
53378
53378
|
return (0, lines_1.concat)([
|
|
53379
|
-
path2.call(
|
|
53380
|
-
path2.call(
|
|
53379
|
+
path2.call(print9, "expression"),
|
|
53380
|
+
path2.call(print9, "typeAnnotation")
|
|
53381
53381
|
]);
|
|
53382
53382
|
case "TSNonNullExpression":
|
|
53383
|
-
return (0, lines_1.concat)([path2.call(
|
|
53383
|
+
return (0, lines_1.concat)([path2.call(print9, "expression"), "!"]);
|
|
53384
53384
|
case "TSTypeAnnotation":
|
|
53385
|
-
return (0, lines_1.concat)([": ", path2.call(
|
|
53385
|
+
return (0, lines_1.concat)([": ", path2.call(print9, "typeAnnotation")]);
|
|
53386
53386
|
case "TSIndexSignature":
|
|
53387
53387
|
return (0, lines_1.concat)([
|
|
53388
53388
|
n.readonly ? "readonly " : "",
|
|
53389
53389
|
"[",
|
|
53390
|
-
path2.map(
|
|
53390
|
+
path2.map(print9, "parameters"),
|
|
53391
53391
|
"]",
|
|
53392
|
-
path2.call(
|
|
53392
|
+
path2.call(print9, "typeAnnotation")
|
|
53393
53393
|
]);
|
|
53394
53394
|
case "TSPropertySignature":
|
|
53395
|
-
parts.push(printVariance(path2,
|
|
53395
|
+
parts.push(printVariance(path2, print9), n.readonly ? "readonly " : "");
|
|
53396
53396
|
if (n.computed) {
|
|
53397
|
-
parts.push("[", path2.call(
|
|
53397
|
+
parts.push("[", path2.call(print9, "key"), "]");
|
|
53398
53398
|
} else {
|
|
53399
|
-
parts.push(path2.call(
|
|
53399
|
+
parts.push(path2.call(print9, "key"));
|
|
53400
53400
|
}
|
|
53401
|
-
parts.push(n.optional ? "?" : "", path2.call(
|
|
53401
|
+
parts.push(n.optional ? "?" : "", path2.call(print9, "typeAnnotation"));
|
|
53402
53402
|
return (0, lines_1.concat)(parts);
|
|
53403
53403
|
case "TSMethodSignature":
|
|
53404
53404
|
if (n.computed) {
|
|
53405
|
-
parts.push("[", path2.call(
|
|
53405
|
+
parts.push("[", path2.call(print9, "key"), "]");
|
|
53406
53406
|
} else {
|
|
53407
|
-
parts.push(path2.call(
|
|
53407
|
+
parts.push(path2.call(print9, "key"));
|
|
53408
53408
|
}
|
|
53409
53409
|
if (n.optional) {
|
|
53410
53410
|
parts.push("?");
|
|
53411
53411
|
}
|
|
53412
|
-
parts.push(path2.call(
|
|
53412
|
+
parts.push(path2.call(print9, "typeParameters"), "(", printFunctionParams(path2, options, print9), ")", path2.call(print9, "typeAnnotation"));
|
|
53413
53413
|
return (0, lines_1.concat)(parts);
|
|
53414
53414
|
case "TSTypePredicate":
|
|
53415
53415
|
if (n.asserts) {
|
|
53416
53416
|
parts.push("asserts ");
|
|
53417
53417
|
}
|
|
53418
|
-
parts.push(path2.call(
|
|
53418
|
+
parts.push(path2.call(print9, "parameterName"));
|
|
53419
53419
|
if (n.typeAnnotation) {
|
|
53420
|
-
parts.push(" is ", path2.call(
|
|
53420
|
+
parts.push(" is ", path2.call(print9, "typeAnnotation", "typeAnnotation"));
|
|
53421
53421
|
}
|
|
53422
53422
|
return (0, lines_1.concat)(parts);
|
|
53423
53423
|
case "TSCallSignatureDeclaration":
|
|
53424
53424
|
return (0, lines_1.concat)([
|
|
53425
|
-
path2.call(
|
|
53425
|
+
path2.call(print9, "typeParameters"),
|
|
53426
53426
|
"(",
|
|
53427
|
-
printFunctionParams(path2, options,
|
|
53427
|
+
printFunctionParams(path2, options, print9),
|
|
53428
53428
|
")",
|
|
53429
|
-
path2.call(
|
|
53429
|
+
path2.call(print9, "typeAnnotation")
|
|
53430
53430
|
]);
|
|
53431
53431
|
case "TSConstructSignatureDeclaration":
|
|
53432
53432
|
if (n.typeParameters) {
|
|
53433
|
-
parts.push("new", path2.call(
|
|
53433
|
+
parts.push("new", path2.call(print9, "typeParameters"));
|
|
53434
53434
|
} else {
|
|
53435
53435
|
parts.push("new ");
|
|
53436
53436
|
}
|
|
53437
|
-
parts.push("(", printFunctionParams(path2, options,
|
|
53437
|
+
parts.push("(", printFunctionParams(path2, options, print9), ")", path2.call(print9, "typeAnnotation"));
|
|
53438
53438
|
return (0, lines_1.concat)(parts);
|
|
53439
53439
|
case "TSTypeAliasDeclaration":
|
|
53440
53440
|
return (0, lines_1.concat)([
|
|
53441
53441
|
n.declare ? "declare " : "",
|
|
53442
53442
|
"type ",
|
|
53443
|
-
path2.call(
|
|
53444
|
-
path2.call(
|
|
53443
|
+
path2.call(print9, "id"),
|
|
53444
|
+
path2.call(print9, "typeParameters"),
|
|
53445
53445
|
" = ",
|
|
53446
|
-
path2.call(
|
|
53446
|
+
path2.call(print9, "typeAnnotation"),
|
|
53447
53447
|
";"
|
|
53448
53448
|
]);
|
|
53449
53449
|
case "TSTypeParameter": {
|
|
53450
|
-
parts.push(path2.call(
|
|
53450
|
+
parts.push(path2.call(print9, "name"));
|
|
53451
53451
|
var parent = path2.getParentNode(0);
|
|
53452
53452
|
var isInMappedType = namedTypes.TSMappedType.check(parent);
|
|
53453
53453
|
if (n.constraint) {
|
|
53454
|
-
parts.push(isInMappedType ? " in " : " extends ", path2.call(
|
|
53454
|
+
parts.push(isInMappedType ? " in " : " extends ", path2.call(print9, "constraint"));
|
|
53455
53455
|
}
|
|
53456
53456
|
if (n["default"]) {
|
|
53457
|
-
parts.push(" = ", path2.call(
|
|
53457
|
+
parts.push(" = ", path2.call(print9, "default"));
|
|
53458
53458
|
}
|
|
53459
53459
|
return (0, lines_1.concat)(parts);
|
|
53460
53460
|
}
|
|
53461
53461
|
case "TSTypeAssertion": {
|
|
53462
|
-
parts.push("<", path2.call(
|
|
53462
|
+
parts.push("<", path2.call(print9, "typeAnnotation"), "> ", path2.call(print9, "expression"));
|
|
53463
53463
|
return (0, lines_1.concat)(parts);
|
|
53464
53464
|
}
|
|
53465
53465
|
case "TSTypeParameterDeclaration":
|
|
53466
53466
|
case "TSTypeParameterInstantiation":
|
|
53467
53467
|
return (0, lines_1.concat)([
|
|
53468
53468
|
"<",
|
|
53469
|
-
(0, lines_1.fromString)(", ").join(path2.map(
|
|
53469
|
+
(0, lines_1.fromString)(", ").join(path2.map(print9, "params")),
|
|
53470
53470
|
">"
|
|
53471
53471
|
]);
|
|
53472
53472
|
case "TSEnumDeclaration": {
|
|
53473
|
-
parts.push(n.declare ? "declare " : "", n.const ? "const " : "", "enum ", path2.call(
|
|
53474
|
-
var memberLines = (0, lines_1.fromString)(",\n").join(path2.map(
|
|
53473
|
+
parts.push(n.declare ? "declare " : "", n.const ? "const " : "", "enum ", path2.call(print9, "id"));
|
|
53474
|
+
var memberLines = (0, lines_1.fromString)(",\n").join(path2.map(print9, "members"));
|
|
53475
53475
|
if (memberLines.isEmpty()) {
|
|
53476
53476
|
parts.push(" {}");
|
|
53477
53477
|
} else {
|
|
@@ -53481,11 +53481,11 @@ var require_printer2 = __commonJS({
|
|
|
53481
53481
|
}
|
|
53482
53482
|
case "TSExpressionWithTypeArguments":
|
|
53483
53483
|
return (0, lines_1.concat)([
|
|
53484
|
-
path2.call(
|
|
53485
|
-
path2.call(
|
|
53484
|
+
path2.call(print9, "expression"),
|
|
53485
|
+
path2.call(print9, "typeParameters")
|
|
53486
53486
|
]);
|
|
53487
53487
|
case "TSInterfaceBody": {
|
|
53488
|
-
var lines = (0, lines_1.fromString)("\n").join(path2.map(
|
|
53488
|
+
var lines = (0, lines_1.fromString)("\n").join(path2.map(print9, "body").map(function(element) {
|
|
53489
53489
|
if (lastNonSpaceCharacter(element) !== ";") {
|
|
53490
53490
|
return element.concat(";");
|
|
53491
53491
|
}
|
|
@@ -53497,22 +53497,22 @@ var require_printer2 = __commonJS({
|
|
|
53497
53497
|
return (0, lines_1.concat)(["{\n", lines.indent(options.tabWidth), "\n}"]);
|
|
53498
53498
|
}
|
|
53499
53499
|
case "TSImportType":
|
|
53500
|
-
parts.push("import(", path2.call(
|
|
53500
|
+
parts.push("import(", path2.call(print9, "argument"), ")");
|
|
53501
53501
|
if (n.qualifier) {
|
|
53502
|
-
parts.push(".", path2.call(
|
|
53502
|
+
parts.push(".", path2.call(print9, "qualifier"));
|
|
53503
53503
|
}
|
|
53504
53504
|
if (n.typeParameters) {
|
|
53505
|
-
parts.push(path2.call(
|
|
53505
|
+
parts.push(path2.call(print9, "typeParameters"));
|
|
53506
53506
|
}
|
|
53507
53507
|
return (0, lines_1.concat)(parts);
|
|
53508
53508
|
case "TSImportEqualsDeclaration":
|
|
53509
53509
|
if (n.isExport) {
|
|
53510
53510
|
parts.push("export ");
|
|
53511
53511
|
}
|
|
53512
|
-
parts.push("import ", path2.call(
|
|
53512
|
+
parts.push("import ", path2.call(print9, "id"), " = ", path2.call(print9, "moduleReference"));
|
|
53513
53513
|
return maybeAddSemicolon((0, lines_1.concat)(parts));
|
|
53514
53514
|
case "TSExternalModuleReference":
|
|
53515
|
-
return (0, lines_1.concat)(["require(", path2.call(
|
|
53515
|
+
return (0, lines_1.concat)(["require(", path2.call(print9, "expression"), ")"]);
|
|
53516
53516
|
case "TSModuleDeclaration": {
|
|
53517
53517
|
var parent = path2.getParentNode();
|
|
53518
53518
|
if (parent.type === "TSModuleDeclaration") {
|
|
@@ -53537,16 +53537,16 @@ var require_printer2 = __commonJS({
|
|
|
53537
53537
|
}
|
|
53538
53538
|
}
|
|
53539
53539
|
}
|
|
53540
|
-
parts.push(path2.call(
|
|
53540
|
+
parts.push(path2.call(print9, "id"));
|
|
53541
53541
|
if (n.body) {
|
|
53542
53542
|
parts.push(" ");
|
|
53543
|
-
parts.push(path2.call(
|
|
53543
|
+
parts.push(path2.call(print9, "body"));
|
|
53544
53544
|
}
|
|
53545
53545
|
return (0, lines_1.concat)(parts);
|
|
53546
53546
|
}
|
|
53547
53547
|
case "TSModuleBlock": {
|
|
53548
53548
|
var naked = path2.call(function(bodyPath) {
|
|
53549
|
-
return printStatementSequence(bodyPath, options,
|
|
53549
|
+
return printStatementSequence(bodyPath, options, print9);
|
|
53550
53550
|
}, "body");
|
|
53551
53551
|
if (naked.isEmpty()) {
|
|
53552
53552
|
parts.push("{}");
|
|
@@ -53556,11 +53556,11 @@ var require_printer2 = __commonJS({
|
|
|
53556
53556
|
return (0, lines_1.concat)(parts);
|
|
53557
53557
|
}
|
|
53558
53558
|
case "TSInstantiationExpression": {
|
|
53559
|
-
parts.push(path2.call(
|
|
53559
|
+
parts.push(path2.call(print9, "expression"), path2.call(print9, "typeParameters"));
|
|
53560
53560
|
return (0, lines_1.concat)(parts);
|
|
53561
53561
|
}
|
|
53562
53562
|
case "V8IntrinsicIdentifier":
|
|
53563
|
-
return (0, lines_1.concat)(["%", path2.call(
|
|
53563
|
+
return (0, lines_1.concat)(["%", path2.call(print9, "name")]);
|
|
53564
53564
|
case "TopicReference":
|
|
53565
53565
|
return (0, lines_1.fromString)("#");
|
|
53566
53566
|
case "ClassHeritage":
|
|
@@ -53610,7 +53610,7 @@ var require_printer2 = __commonJS({
|
|
|
53610
53610
|
}
|
|
53611
53611
|
return (0, lines_1.concat)(parts);
|
|
53612
53612
|
}
|
|
53613
|
-
function printStatementSequence(path2, options,
|
|
53613
|
+
function printStatementSequence(path2, options, print9) {
|
|
53614
53614
|
var filtered = [];
|
|
53615
53615
|
var sawComment = false;
|
|
53616
53616
|
var sawStatement = false;
|
|
@@ -53631,7 +53631,7 @@ var require_printer2 = __commonJS({
|
|
|
53631
53631
|
}
|
|
53632
53632
|
filtered.push({
|
|
53633
53633
|
node: stmt,
|
|
53634
|
-
printed:
|
|
53634
|
+
printed: print9(stmtPath)
|
|
53635
53635
|
});
|
|
53636
53636
|
});
|
|
53637
53637
|
if (sawComment) {
|
|
@@ -53723,7 +53723,7 @@ var require_printer2 = __commonJS({
|
|
|
53723
53723
|
}
|
|
53724
53724
|
return parts;
|
|
53725
53725
|
}
|
|
53726
|
-
function printMethod(path2, options,
|
|
53726
|
+
function printMethod(path2, options, print9) {
|
|
53727
53727
|
var node = path2.getNode();
|
|
53728
53728
|
var kind = node.kind;
|
|
53729
53729
|
var parts = [];
|
|
@@ -53741,7 +53741,7 @@ var require_printer2 = __commonJS({
|
|
|
53741
53741
|
if (kind === "get" || kind === "set") {
|
|
53742
53742
|
parts.push(kind, " ");
|
|
53743
53743
|
}
|
|
53744
|
-
var key = path2.call(
|
|
53744
|
+
var key = path2.call(print9, "key");
|
|
53745
53745
|
if (node.computed) {
|
|
53746
53746
|
key = (0, lines_1.concat)(["[", key, "]"]);
|
|
53747
53747
|
}
|
|
@@ -53750,26 +53750,26 @@ var require_printer2 = __commonJS({
|
|
|
53750
53750
|
parts.push("?");
|
|
53751
53751
|
}
|
|
53752
53752
|
if (node === nodeValue) {
|
|
53753
|
-
parts.push(path2.call(
|
|
53753
|
+
parts.push(path2.call(print9, "typeParameters"), "(", printFunctionParams(path2, options, print9), ")", path2.call(print9, "returnType"));
|
|
53754
53754
|
if (node.body) {
|
|
53755
|
-
parts.push(" ", path2.call(
|
|
53755
|
+
parts.push(" ", path2.call(print9, "body"));
|
|
53756
53756
|
} else {
|
|
53757
53757
|
parts.push(";");
|
|
53758
53758
|
}
|
|
53759
53759
|
} else {
|
|
53760
|
-
parts.push(path2.call(
|
|
53761
|
-
return printFunctionParams(valuePath, options,
|
|
53762
|
-
}, "value"), ")", path2.call(
|
|
53760
|
+
parts.push(path2.call(print9, "value", "typeParameters"), "(", path2.call(function(valuePath) {
|
|
53761
|
+
return printFunctionParams(valuePath, options, print9);
|
|
53762
|
+
}, "value"), ")", path2.call(print9, "value", "returnType"));
|
|
53763
53763
|
if (nodeValue.body) {
|
|
53764
|
-
parts.push(" ", path2.call(
|
|
53764
|
+
parts.push(" ", path2.call(print9, "value", "body"));
|
|
53765
53765
|
} else {
|
|
53766
53766
|
parts.push(";");
|
|
53767
53767
|
}
|
|
53768
53768
|
}
|
|
53769
53769
|
return (0, lines_1.concat)(parts);
|
|
53770
53770
|
}
|
|
53771
|
-
function printArgumentsList(path2, options,
|
|
53772
|
-
var printed = path2.map(
|
|
53771
|
+
function printArgumentsList(path2, options, print9) {
|
|
53772
|
+
var printed = path2.map(print9, "arguments");
|
|
53773
53773
|
var trailingComma = util.isTrailingCommaEnabled(options, "parameters");
|
|
53774
53774
|
var joined = (0, lines_1.fromString)(", ").join(printed);
|
|
53775
53775
|
if (joined.getLineLength(1) > options.wrapColumn) {
|
|
@@ -53782,28 +53782,28 @@ var require_printer2 = __commonJS({
|
|
|
53782
53782
|
}
|
|
53783
53783
|
return (0, lines_1.concat)(["(", joined, ")"]);
|
|
53784
53784
|
}
|
|
53785
|
-
function printFunctionParams(path2, options,
|
|
53785
|
+
function printFunctionParams(path2, options, print9) {
|
|
53786
53786
|
var fun = path2.getValue();
|
|
53787
53787
|
var params;
|
|
53788
53788
|
var printed = [];
|
|
53789
53789
|
if (fun.params) {
|
|
53790
53790
|
params = fun.params;
|
|
53791
|
-
printed = path2.map(
|
|
53791
|
+
printed = path2.map(print9, "params");
|
|
53792
53792
|
} else if (fun.parameters) {
|
|
53793
53793
|
params = fun.parameters;
|
|
53794
|
-
printed = path2.map(
|
|
53794
|
+
printed = path2.map(print9, "parameters");
|
|
53795
53795
|
}
|
|
53796
53796
|
if (fun.defaults) {
|
|
53797
53797
|
path2.each(function(defExprPath) {
|
|
53798
53798
|
var i = defExprPath.getName();
|
|
53799
53799
|
var p = printed[i];
|
|
53800
53800
|
if (p && defExprPath.getValue()) {
|
|
53801
|
-
printed[i] = (0, lines_1.concat)([p, " = ",
|
|
53801
|
+
printed[i] = (0, lines_1.concat)([p, " = ", print9(defExprPath)]);
|
|
53802
53802
|
}
|
|
53803
53803
|
}, "defaults");
|
|
53804
53804
|
}
|
|
53805
53805
|
if (fun.rest) {
|
|
53806
|
-
printed.push((0, lines_1.concat)(["...", path2.call(
|
|
53806
|
+
printed.push((0, lines_1.concat)(["...", path2.call(print9, "rest")]));
|
|
53807
53807
|
}
|
|
53808
53808
|
var joined = (0, lines_1.fromString)(", ").join(printed);
|
|
53809
53809
|
if (joined.length > 1 || joined.getLineLength(1) > options.wrapColumn) {
|
|
@@ -53817,11 +53817,11 @@ var require_printer2 = __commonJS({
|
|
|
53817
53817
|
}
|
|
53818
53818
|
return joined;
|
|
53819
53819
|
}
|
|
53820
|
-
function maybePrintImportAssertions(path2, options,
|
|
53820
|
+
function maybePrintImportAssertions(path2, options, print9) {
|
|
53821
53821
|
var n = path2.getValue();
|
|
53822
53822
|
if (n.assertions && n.assertions.length > 0) {
|
|
53823
53823
|
var parts = [" assert {"];
|
|
53824
|
-
var printed = path2.map(
|
|
53824
|
+
var printed = path2.map(print9, "assertions");
|
|
53825
53825
|
var flat = (0, lines_1.fromString)(", ").join(printed);
|
|
53826
53826
|
if (flat.length > 1 || flat.getLineLength(1) > options.wrapColumn) {
|
|
53827
53827
|
parts.push("\n", (0, lines_1.fromString)(",\n").join(printed).indent(options.tabWidth), "\n}");
|
|
@@ -53832,7 +53832,7 @@ var require_printer2 = __commonJS({
|
|
|
53832
53832
|
}
|
|
53833
53833
|
return (0, lines_1.fromString)("");
|
|
53834
53834
|
}
|
|
53835
|
-
function printExportDeclaration(path2, options,
|
|
53835
|
+
function printExportDeclaration(path2, options, print9) {
|
|
53836
53836
|
var decl = path2.getValue();
|
|
53837
53837
|
var parts = ["export "];
|
|
53838
53838
|
if (decl.exportKind && decl.exportKind === "type") {
|
|
@@ -53846,7 +53846,7 @@ var require_printer2 = __commonJS({
|
|
|
53846
53846
|
parts.push("default ");
|
|
53847
53847
|
}
|
|
53848
53848
|
if (decl.declaration) {
|
|
53849
|
-
parts.push(path2.call(
|
|
53849
|
+
parts.push(path2.call(print9, "declaration"));
|
|
53850
53850
|
} else if (decl.specifiers) {
|
|
53851
53851
|
if (decl.specifiers.length === 1 && decl.specifiers[0].type === "ExportBatchSpecifier") {
|
|
53852
53852
|
parts.push("*");
|
|
@@ -53858,9 +53858,9 @@ var require_printer2 = __commonJS({
|
|
|
53858
53858
|
path2.each(function(specifierPath) {
|
|
53859
53859
|
var spec = specifierPath.getValue();
|
|
53860
53860
|
if (spec.type === "ExportDefaultSpecifier") {
|
|
53861
|
-
unbracedSpecifiers_2.push(
|
|
53861
|
+
unbracedSpecifiers_2.push(print9(specifierPath));
|
|
53862
53862
|
} else {
|
|
53863
|
-
bracedSpecifiers_2.push(
|
|
53863
|
+
bracedSpecifiers_2.push(print9(specifierPath));
|
|
53864
53864
|
}
|
|
53865
53865
|
}, "specifiers");
|
|
53866
53866
|
unbracedSpecifiers_2.forEach(function(lines2, i) {
|
|
@@ -53889,10 +53889,10 @@ var require_printer2 = __commonJS({
|
|
|
53889
53889
|
}
|
|
53890
53890
|
}
|
|
53891
53891
|
} else {
|
|
53892
|
-
parts.push(shouldPrintSpaces ? "{ " : "{", (0, lines_1.fromString)(", ").join(path2.map(
|
|
53892
|
+
parts.push(shouldPrintSpaces ? "{ " : "{", (0, lines_1.fromString)(", ").join(path2.map(print9, "specifiers")), shouldPrintSpaces ? " }" : "}");
|
|
53893
53893
|
}
|
|
53894
53894
|
if (decl.source) {
|
|
53895
|
-
parts.push(" from ", path2.call(
|
|
53895
|
+
parts.push(" from ", path2.call(print9, "source"), maybePrintImportAssertions(path2, options, print9));
|
|
53896
53896
|
}
|
|
53897
53897
|
}
|
|
53898
53898
|
var lines = (0, lines_1.concat)(parts);
|
|
@@ -53910,7 +53910,7 @@ var require_printer2 = __commonJS({
|
|
|
53910
53910
|
}
|
|
53911
53911
|
return (0, lines_1.concat)(parts);
|
|
53912
53912
|
}
|
|
53913
|
-
function printVariance(path2,
|
|
53913
|
+
function printVariance(path2, print9) {
|
|
53914
53914
|
return path2.call(function(variancePath) {
|
|
53915
53915
|
var value = variancePath.getValue();
|
|
53916
53916
|
if (value) {
|
|
@@ -53920,7 +53920,7 @@ var require_printer2 = __commonJS({
|
|
|
53920
53920
|
if (value === "minus") {
|
|
53921
53921
|
return (0, lines_1.fromString)("-");
|
|
53922
53922
|
}
|
|
53923
|
-
return
|
|
53923
|
+
return print9(variancePath);
|
|
53924
53924
|
}
|
|
53925
53925
|
return (0, lines_1.fromString)("");
|
|
53926
53926
|
}, "variance");
|
|
@@ -54007,10 +54007,10 @@ var require_main2 = __commonJS({
|
|
|
54007
54007
|
Object.defineProperty(exports, "visit", { enumerable: true, get: function() {
|
|
54008
54008
|
return ast_types_1.visit;
|
|
54009
54009
|
} });
|
|
54010
|
-
function
|
|
54010
|
+
function print9(node, options) {
|
|
54011
54011
|
return new printer_1.Printer(options).print(node);
|
|
54012
54012
|
}
|
|
54013
|
-
exports.print =
|
|
54013
|
+
exports.print = print9;
|
|
54014
54014
|
function prettyPrint3(node, options) {
|
|
54015
54015
|
return new printer_1.Printer(options).printGenerically(node);
|
|
54016
54016
|
}
|
|
@@ -54034,7 +54034,7 @@ var require_main2 = __commonJS({
|
|
|
54034
54034
|
function runString(code, transformer, options) {
|
|
54035
54035
|
var writeback = options && options.writeback || defaultWriteback;
|
|
54036
54036
|
transformer((0, parser_1.parse)(code, options), function(node) {
|
|
54037
|
-
writeback(
|
|
54037
|
+
writeback(print9(node, options).code);
|
|
54038
54038
|
});
|
|
54039
54039
|
}
|
|
54040
54040
|
}
|
|
@@ -54054,7 +54054,7 @@ async function runPipeline(config2, pipeline, target) {
|
|
|
54054
54054
|
// src/lib/config.ts
|
|
54055
54055
|
var graphql = __toESM(require_graphql2(), 1);
|
|
54056
54056
|
var import_minimatch = __toESM(require_minimatch(), 1);
|
|
54057
|
-
import { fileURLToPath, pathToFileURL } from "url";
|
|
54057
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
54058
54058
|
|
|
54059
54059
|
// src/runtime/lib/config.ts
|
|
54060
54060
|
function defaultConfigValues(file) {
|
|
@@ -54153,8 +54153,8 @@ __export(fs_exports, {
|
|
|
54153
54153
|
var import_fs_extra = __toESM(require_lib2(), 1);
|
|
54154
54154
|
var import_glob = __toESM(require_glob(), 1);
|
|
54155
54155
|
var import_memfs = __toESM(require_lib(), 1);
|
|
54156
|
-
import fs from "fs/promises";
|
|
54157
|
-
import { promisify } from "util";
|
|
54156
|
+
import fs from "node:fs/promises";
|
|
54157
|
+
import { promisify } from "node:util";
|
|
54158
54158
|
|
|
54159
54159
|
// src/lib/path.ts
|
|
54160
54160
|
var path_exports = {};
|
|
@@ -54171,8 +54171,8 @@ __export(path_exports, {
|
|
|
54171
54171
|
resolve: () => resolve,
|
|
54172
54172
|
sep: () => sep
|
|
54173
54173
|
});
|
|
54174
|
-
import os from "os";
|
|
54175
|
-
import path from "path";
|
|
54174
|
+
import os from "node:os";
|
|
54175
|
+
import path from "node:path";
|
|
54176
54176
|
var sep = "/";
|
|
54177
54177
|
function resolve(...parts) {
|
|
54178
54178
|
return posixify(path.resolve(...parts));
|
|
@@ -54920,7 +54920,7 @@ function findModule(pkg = "houdini", currentLocation) {
|
|
|
54920
54920
|
|
|
54921
54921
|
// src/lib/graphql.ts
|
|
54922
54922
|
var graphql2 = __toESM(require_graphql2(), 1);
|
|
54923
|
-
import crypto from "crypto";
|
|
54923
|
+
import crypto from "node:crypto";
|
|
54924
54924
|
function getRootType(type) {
|
|
54925
54925
|
if (graphql2.isNonNullType(type)) {
|
|
54926
54926
|
return getRootType(type.ofType);
|
|
@@ -54933,8 +54933,8 @@ function getRootType(type) {
|
|
|
54933
54933
|
function hashDocument({
|
|
54934
54934
|
document
|
|
54935
54935
|
}) {
|
|
54936
|
-
const docString = typeof document === "string" ? document :
|
|
54937
|
-
return crypto.createHash("sha256").update(docString).digest("hex");
|
|
54936
|
+
const docString = typeof document === "string" ? document : document.artifact?.raw;
|
|
54937
|
+
return crypto.createHash("sha256").update(docString ?? "").digest("hex");
|
|
54938
54938
|
}
|
|
54939
54939
|
function parentTypeFromAncestors(schema, filepath, ancestors) {
|
|
54940
54940
|
const parents = [...ancestors];
|