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
|
@@ -3066,10 +3066,10 @@ var require_printer = __commonJS({
|
|
|
3066
3066
|
Object.defineProperty(exports, "__esModule", {
|
|
3067
3067
|
value: true
|
|
3068
3068
|
});
|
|
3069
|
-
exports.print =
|
|
3069
|
+
exports.print = print8;
|
|
3070
3070
|
var _visitor = require_visitor();
|
|
3071
3071
|
var _blockString = require_blockString();
|
|
3072
|
-
function
|
|
3072
|
+
function print8(ast) {
|
|
3073
3073
|
return (0, _visitor.visit)(ast, {
|
|
3074
3074
|
leave: printDocASTReducer
|
|
3075
3075
|
});
|
|
@@ -50822,12 +50822,12 @@ var require_comments = __commonJS({
|
|
|
50822
50822
|
comment.trailing = true;
|
|
50823
50823
|
addCommentHelper(node, comment);
|
|
50824
50824
|
}
|
|
50825
|
-
function printLeadingComment(commentPath,
|
|
50825
|
+
function printLeadingComment(commentPath, print8) {
|
|
50826
50826
|
var comment = commentPath.getValue();
|
|
50827
50827
|
n.Comment.assert(comment);
|
|
50828
50828
|
var loc = comment.loc;
|
|
50829
50829
|
var lines = loc && loc.lines;
|
|
50830
|
-
var parts = [
|
|
50830
|
+
var parts = [print8(commentPath)];
|
|
50831
50831
|
if (comment.trailing) {
|
|
50832
50832
|
parts.push("\n");
|
|
50833
50833
|
} else if (lines instanceof lines_1.Lines) {
|
|
@@ -50842,7 +50842,7 @@ var require_comments = __commonJS({
|
|
|
50842
50842
|
}
|
|
50843
50843
|
return (0, lines_1.concat)(parts);
|
|
50844
50844
|
}
|
|
50845
|
-
function printTrailingComment(commentPath,
|
|
50845
|
+
function printTrailingComment(commentPath, print8) {
|
|
50846
50846
|
var comment = commentPath.getValue(commentPath);
|
|
50847
50847
|
n.Comment.assert(comment);
|
|
50848
50848
|
var loc = comment.loc;
|
|
@@ -50857,12 +50857,12 @@ var require_comments = __commonJS({
|
|
|
50857
50857
|
parts.push(new Array(leadingSpace.length).join("\n"));
|
|
50858
50858
|
}
|
|
50859
50859
|
}
|
|
50860
|
-
parts.push(
|
|
50860
|
+
parts.push(print8(commentPath));
|
|
50861
50861
|
return (0, lines_1.concat)(parts);
|
|
50862
50862
|
}
|
|
50863
|
-
function printComments(path2,
|
|
50863
|
+
function printComments(path2, print8) {
|
|
50864
50864
|
var value = path2.getValue();
|
|
50865
|
-
var innerLines =
|
|
50865
|
+
var innerLines = print8(path2);
|
|
50866
50866
|
var comments = n.Node.check(value) && types14.getFieldValue(value, "comments");
|
|
50867
50867
|
if (!comments || comments.length === 0) {
|
|
50868
50868
|
return innerLines;
|
|
@@ -50874,9 +50874,9 @@ var require_comments = __commonJS({
|
|
|
50874
50874
|
var leading = types14.getFieldValue(comment, "leading");
|
|
50875
50875
|
var trailing = types14.getFieldValue(comment, "trailing");
|
|
50876
50876
|
if (leading || trailing && !(n.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
50877
|
-
leadingParts.push(printLeadingComment(commentPath,
|
|
50877
|
+
leadingParts.push(printLeadingComment(commentPath, print8));
|
|
50878
50878
|
} else if (trailing) {
|
|
50879
|
-
trailingParts.push(printTrailingComment(commentPath,
|
|
50879
|
+
trailingParts.push(printTrailingComment(commentPath, print8));
|
|
50880
50880
|
}
|
|
50881
50881
|
}, "comments");
|
|
50882
50882
|
leadingParts.push.apply(leadingParts, trailingParts);
|
|
@@ -51567,7 +51567,7 @@ var require_patcher = __commonJS({
|
|
|
51567
51567
|
};
|
|
51568
51568
|
exports.Patcher = Patcher;
|
|
51569
51569
|
var Pp = Patcher.prototype;
|
|
51570
|
-
Pp.tryToReprintComments = function(newNode, oldNode,
|
|
51570
|
+
Pp.tryToReprintComments = function(newNode, oldNode, print8) {
|
|
51571
51571
|
var patcher = this;
|
|
51572
51572
|
if (!newNode.comments && !oldNode.comments) {
|
|
51573
51573
|
return true;
|
|
@@ -51584,7 +51584,7 @@ var require_patcher = __commonJS({
|
|
|
51584
51584
|
assert_1.default.ok(oldComment.leading || oldComment.trailing);
|
|
51585
51585
|
patcher.replace(
|
|
51586
51586
|
oldComment.loc,
|
|
51587
|
-
|
|
51587
|
+
print8(reprint.newPath).indentTail(oldComment.loc.indent)
|
|
51588
51588
|
);
|
|
51589
51589
|
});
|
|
51590
51590
|
}
|
|
@@ -51631,17 +51631,17 @@ var require_patcher = __commonJS({
|
|
|
51631
51631
|
var reprints = [];
|
|
51632
51632
|
if (!lines || !findReprints(path2, reprints))
|
|
51633
51633
|
return;
|
|
51634
|
-
return function(
|
|
51634
|
+
return function(print8) {
|
|
51635
51635
|
var patcher = new Patcher(lines);
|
|
51636
51636
|
reprints.forEach(function(reprint) {
|
|
51637
51637
|
var newNode = reprint.newPath.getValue();
|
|
51638
51638
|
var oldNode = reprint.oldPath.getValue();
|
|
51639
51639
|
SourceLocation.assert(oldNode.loc, true);
|
|
51640
|
-
var needToPrintNewPathWithComments = !patcher.tryToReprintComments(newNode, oldNode,
|
|
51640
|
+
var needToPrintNewPathWithComments = !patcher.tryToReprintComments(newNode, oldNode, print8);
|
|
51641
51641
|
if (needToPrintNewPathWithComments) {
|
|
51642
51642
|
patcher.deleteComments(oldNode);
|
|
51643
51643
|
}
|
|
51644
|
-
var newLines =
|
|
51644
|
+
var newLines = print8(reprint.newPath, {
|
|
51645
51645
|
includeComments: needToPrintNewPathWithComments,
|
|
51646
51646
|
avoidRootParens: oldNode.type === newNode.type && reprint.oldPath.hasParens()
|
|
51647
51647
|
}).indentTail(oldNode.loc.indent);
|
|
@@ -51858,10 +51858,10 @@ var require_printer2 = __commonJS({
|
|
|
51858
51858
|
function makePrintFunctionWith(options, overrides) {
|
|
51859
51859
|
options = Object.assign({}, options, overrides);
|
|
51860
51860
|
return function(path2) {
|
|
51861
|
-
return
|
|
51861
|
+
return print8(path2, options);
|
|
51862
51862
|
};
|
|
51863
51863
|
}
|
|
51864
|
-
function
|
|
51864
|
+
function print8(path2, options) {
|
|
51865
51865
|
assert_1.default.ok(path2 instanceof fast_path_1.default);
|
|
51866
51866
|
options = options || {};
|
|
51867
51867
|
if (options.includeComments) {
|
|
@@ -51877,7 +51877,7 @@ var require_printer2 = __commonJS({
|
|
|
51877
51877
|
}
|
|
51878
51878
|
}
|
|
51879
51879
|
var reprinter = (0, patcher_1.getReprinter)(path2);
|
|
51880
|
-
var lines = reprinter ? reprinter(
|
|
51880
|
+
var lines = reprinter ? reprinter(print8) : genericPrint(path2, config2, options, makePrintFunctionWith(options, {
|
|
51881
51881
|
includeComments: true,
|
|
51882
51882
|
avoidRootParens: false
|
|
51883
51883
|
}));
|
|
@@ -51888,7 +51888,7 @@ var require_printer2 = __commonJS({
|
|
|
51888
51888
|
if (!ast) {
|
|
51889
51889
|
return emptyPrintResult;
|
|
51890
51890
|
}
|
|
51891
|
-
var lines =
|
|
51891
|
+
var lines = print8(fast_path_1.default.from(ast), {
|
|
51892
51892
|
includeComments: true,
|
|
51893
51893
|
avoidRootParens: false
|
|
51894
51894
|
});
|
|
@@ -51941,7 +51941,7 @@ var require_printer2 = __commonJS({
|
|
|
51941
51941
|
}
|
|
51942
51942
|
return (0, lines_1.concat)(parts);
|
|
51943
51943
|
}
|
|
51944
|
-
function genericPrintNoParens(path2, options,
|
|
51944
|
+
function genericPrintNoParens(path2, options, print8) {
|
|
51945
51945
|
var n = path2.getValue();
|
|
51946
51946
|
if (!n) {
|
|
51947
51947
|
return (0, lines_1.fromString)("");
|
|
@@ -51953,45 +51953,45 @@ var require_printer2 = __commonJS({
|
|
|
51953
51953
|
var parts = [];
|
|
51954
51954
|
switch (n.type) {
|
|
51955
51955
|
case "File":
|
|
51956
|
-
return path2.call(
|
|
51956
|
+
return path2.call(print8, "program");
|
|
51957
51957
|
case "Program":
|
|
51958
51958
|
if (n.directives) {
|
|
51959
51959
|
path2.each(function(childPath) {
|
|
51960
|
-
parts.push(
|
|
51960
|
+
parts.push(print8(childPath), ";\n");
|
|
51961
51961
|
}, "directives");
|
|
51962
51962
|
}
|
|
51963
51963
|
if (n.interpreter) {
|
|
51964
|
-
parts.push(path2.call(
|
|
51964
|
+
parts.push(path2.call(print8, "interpreter"));
|
|
51965
51965
|
}
|
|
51966
51966
|
parts.push(path2.call(function(bodyPath) {
|
|
51967
|
-
return printStatementSequence(bodyPath, options,
|
|
51967
|
+
return printStatementSequence(bodyPath, options, print8);
|
|
51968
51968
|
}, "body"));
|
|
51969
51969
|
return (0, lines_1.concat)(parts);
|
|
51970
51970
|
case "Noop":
|
|
51971
51971
|
case "EmptyStatement":
|
|
51972
51972
|
return (0, lines_1.fromString)("");
|
|
51973
51973
|
case "ExpressionStatement":
|
|
51974
|
-
return (0, lines_1.concat)([path2.call(
|
|
51974
|
+
return (0, lines_1.concat)([path2.call(print8, "expression"), ";"]);
|
|
51975
51975
|
case "ParenthesizedExpression":
|
|
51976
|
-
return (0, lines_1.concat)(["(", path2.call(
|
|
51976
|
+
return (0, lines_1.concat)(["(", path2.call(print8, "expression"), ")"]);
|
|
51977
51977
|
case "BinaryExpression":
|
|
51978
51978
|
case "LogicalExpression":
|
|
51979
51979
|
case "AssignmentExpression":
|
|
51980
51980
|
return (0, lines_1.fromString)(" ").join([
|
|
51981
|
-
path2.call(
|
|
51981
|
+
path2.call(print8, "left"),
|
|
51982
51982
|
n.operator,
|
|
51983
|
-
path2.call(
|
|
51983
|
+
path2.call(print8, "right")
|
|
51984
51984
|
]);
|
|
51985
51985
|
case "AssignmentPattern":
|
|
51986
51986
|
return (0, lines_1.concat)([
|
|
51987
|
-
path2.call(
|
|
51987
|
+
path2.call(print8, "left"),
|
|
51988
51988
|
" = ",
|
|
51989
|
-
path2.call(
|
|
51989
|
+
path2.call(print8, "right")
|
|
51990
51990
|
]);
|
|
51991
51991
|
case "MemberExpression":
|
|
51992
51992
|
case "OptionalMemberExpression": {
|
|
51993
|
-
parts.push(path2.call(
|
|
51994
|
-
var property = path2.call(
|
|
51993
|
+
parts.push(path2.call(print8, "object"));
|
|
51994
|
+
var property = path2.call(print8, "property");
|
|
51995
51995
|
var optional = types14.getFieldValue(n, "optional");
|
|
51996
51996
|
if (n.computed) {
|
|
51997
51997
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
@@ -52001,18 +52001,18 @@ var require_printer2 = __commonJS({
|
|
|
52001
52001
|
return (0, lines_1.concat)(parts);
|
|
52002
52002
|
}
|
|
52003
52003
|
case "ChainExpression":
|
|
52004
|
-
return path2.call(
|
|
52004
|
+
return path2.call(print8, "expression");
|
|
52005
52005
|
case "MetaProperty":
|
|
52006
52006
|
return (0, lines_1.concat)([
|
|
52007
|
-
path2.call(
|
|
52007
|
+
path2.call(print8, "meta"),
|
|
52008
52008
|
".",
|
|
52009
|
-
path2.call(
|
|
52009
|
+
path2.call(print8, "property")
|
|
52010
52010
|
]);
|
|
52011
52011
|
case "BindExpression":
|
|
52012
52012
|
if (n.object) {
|
|
52013
|
-
parts.push(path2.call(
|
|
52013
|
+
parts.push(path2.call(print8, "object"));
|
|
52014
52014
|
}
|
|
52015
|
-
parts.push("::", path2.call(
|
|
52015
|
+
parts.push("::", path2.call(print8, "callee"));
|
|
52016
52016
|
return (0, lines_1.concat)(parts);
|
|
52017
52017
|
case "Path":
|
|
52018
52018
|
return (0, lines_1.fromString)(".").join(n.body);
|
|
@@ -52020,7 +52020,7 @@ var require_printer2 = __commonJS({
|
|
|
52020
52020
|
return (0, lines_1.concat)([
|
|
52021
52021
|
(0, lines_1.fromString)(n.name, options),
|
|
52022
52022
|
n.optional ? "?" : "",
|
|
52023
|
-
path2.call(
|
|
52023
|
+
path2.call(print8, "typeAnnotation")
|
|
52024
52024
|
]);
|
|
52025
52025
|
case "SpreadElement":
|
|
52026
52026
|
case "SpreadElementPattern":
|
|
@@ -52031,8 +52031,8 @@ var require_printer2 = __commonJS({
|
|
|
52031
52031
|
case "RestElement":
|
|
52032
52032
|
return (0, lines_1.concat)([
|
|
52033
52033
|
"...",
|
|
52034
|
-
path2.call(
|
|
52035
|
-
path2.call(
|
|
52034
|
+
path2.call(print8, "argument"),
|
|
52035
|
+
path2.call(print8, "typeAnnotation")
|
|
52036
52036
|
]);
|
|
52037
52037
|
case "FunctionDeclaration":
|
|
52038
52038
|
case "FunctionExpression":
|
|
@@ -52047,15 +52047,15 @@ var require_printer2 = __commonJS({
|
|
|
52047
52047
|
if (n.generator)
|
|
52048
52048
|
parts.push("*");
|
|
52049
52049
|
if (n.id) {
|
|
52050
|
-
parts.push(" ", path2.call(
|
|
52050
|
+
parts.push(" ", path2.call(print8, "id"), path2.call(print8, "typeParameters"));
|
|
52051
52051
|
} else {
|
|
52052
52052
|
if (n.typeParameters) {
|
|
52053
|
-
parts.push(path2.call(
|
|
52053
|
+
parts.push(path2.call(print8, "typeParameters"));
|
|
52054
52054
|
}
|
|
52055
52055
|
}
|
|
52056
|
-
parts.push("(", printFunctionParams(path2, options,
|
|
52056
|
+
parts.push("(", printFunctionParams(path2, options, print8), ")", path2.call(print8, "returnType"));
|
|
52057
52057
|
if (n.body) {
|
|
52058
|
-
parts.push(" ", path2.call(
|
|
52058
|
+
parts.push(" ", path2.call(print8, "body"));
|
|
52059
52059
|
}
|
|
52060
52060
|
return (0, lines_1.concat)(parts);
|
|
52061
52061
|
case "ArrowFunctionExpression":
|
|
@@ -52063,44 +52063,44 @@ var require_printer2 = __commonJS({
|
|
|
52063
52063
|
parts.push("async ");
|
|
52064
52064
|
}
|
|
52065
52065
|
if (n.typeParameters) {
|
|
52066
|
-
parts.push(path2.call(
|
|
52066
|
+
parts.push(path2.call(print8, "typeParameters"));
|
|
52067
52067
|
}
|
|
52068
52068
|
if (!options.arrowParensAlways && n.params.length === 1 && !n.rest && n.params[0].type === "Identifier" && !n.params[0].typeAnnotation && !n.returnType) {
|
|
52069
|
-
parts.push(path2.call(
|
|
52069
|
+
parts.push(path2.call(print8, "params", 0));
|
|
52070
52070
|
} else {
|
|
52071
|
-
parts.push("(", printFunctionParams(path2, options,
|
|
52071
|
+
parts.push("(", printFunctionParams(path2, options, print8), ")", path2.call(print8, "returnType"));
|
|
52072
52072
|
}
|
|
52073
|
-
parts.push(" => ", path2.call(
|
|
52073
|
+
parts.push(" => ", path2.call(print8, "body"));
|
|
52074
52074
|
return (0, lines_1.concat)(parts);
|
|
52075
52075
|
case "MethodDefinition":
|
|
52076
|
-
return printMethod(path2, options,
|
|
52076
|
+
return printMethod(path2, options, print8);
|
|
52077
52077
|
case "YieldExpression":
|
|
52078
52078
|
parts.push("yield");
|
|
52079
52079
|
if (n.delegate)
|
|
52080
52080
|
parts.push("*");
|
|
52081
52081
|
if (n.argument)
|
|
52082
|
-
parts.push(" ", path2.call(
|
|
52082
|
+
parts.push(" ", path2.call(print8, "argument"));
|
|
52083
52083
|
return (0, lines_1.concat)(parts);
|
|
52084
52084
|
case "AwaitExpression":
|
|
52085
52085
|
parts.push("await");
|
|
52086
52086
|
if (n.all)
|
|
52087
52087
|
parts.push("*");
|
|
52088
52088
|
if (n.argument)
|
|
52089
|
-
parts.push(" ", path2.call(
|
|
52089
|
+
parts.push(" ", path2.call(print8, "argument"));
|
|
52090
52090
|
return (0, lines_1.concat)(parts);
|
|
52091
52091
|
case "ModuleExpression":
|
|
52092
52092
|
return (0, lines_1.concat)([
|
|
52093
52093
|
"module {\n",
|
|
52094
|
-
path2.call(
|
|
52094
|
+
path2.call(print8, "body").indent(options.tabWidth),
|
|
52095
52095
|
"\n}"
|
|
52096
52096
|
]);
|
|
52097
52097
|
case "ModuleDeclaration":
|
|
52098
|
-
parts.push("module", path2.call(
|
|
52098
|
+
parts.push("module", path2.call(print8, "id"));
|
|
52099
52099
|
if (n.source) {
|
|
52100
52100
|
assert_1.default.ok(!n.body);
|
|
52101
|
-
parts.push("from", path2.call(
|
|
52101
|
+
parts.push("from", path2.call(print8, "source"));
|
|
52102
52102
|
} else {
|
|
52103
|
-
parts.push(path2.call(
|
|
52103
|
+
parts.push(path2.call(print8, "body"));
|
|
52104
52104
|
}
|
|
52105
52105
|
return (0, lines_1.fromString)(" ").join(parts);
|
|
52106
52106
|
case "ImportSpecifier":
|
|
@@ -52108,27 +52108,27 @@ var require_printer2 = __commonJS({
|
|
|
52108
52108
|
parts.push(n.importKind + " ");
|
|
52109
52109
|
}
|
|
52110
52110
|
if (n.imported) {
|
|
52111
|
-
parts.push(path2.call(
|
|
52111
|
+
parts.push(path2.call(print8, "imported"));
|
|
52112
52112
|
if (n.local && n.local.name !== n.imported.name) {
|
|
52113
|
-
parts.push(" as ", path2.call(
|
|
52113
|
+
parts.push(" as ", path2.call(print8, "local"));
|
|
52114
52114
|
}
|
|
52115
52115
|
} else if (n.id) {
|
|
52116
|
-
parts.push(path2.call(
|
|
52116
|
+
parts.push(path2.call(print8, "id"));
|
|
52117
52117
|
if (n.name) {
|
|
52118
|
-
parts.push(" as ", path2.call(
|
|
52118
|
+
parts.push(" as ", path2.call(print8, "name"));
|
|
52119
52119
|
}
|
|
52120
52120
|
}
|
|
52121
52121
|
return (0, lines_1.concat)(parts);
|
|
52122
52122
|
case "ExportSpecifier":
|
|
52123
52123
|
if (n.local) {
|
|
52124
|
-
parts.push(path2.call(
|
|
52124
|
+
parts.push(path2.call(print8, "local"));
|
|
52125
52125
|
if (n.exported && n.exported.name !== n.local.name) {
|
|
52126
|
-
parts.push(" as ", path2.call(
|
|
52126
|
+
parts.push(" as ", path2.call(print8, "exported"));
|
|
52127
52127
|
}
|
|
52128
52128
|
} else if (n.id) {
|
|
52129
|
-
parts.push(path2.call(
|
|
52129
|
+
parts.push(path2.call(print8, "id"));
|
|
52130
52130
|
if (n.name) {
|
|
52131
|
-
parts.push(" as ", path2.call(
|
|
52131
|
+
parts.push(" as ", path2.call(print8, "name"));
|
|
52132
52132
|
}
|
|
52133
52133
|
}
|
|
52134
52134
|
return (0, lines_1.concat)(parts);
|
|
@@ -52137,40 +52137,40 @@ var require_printer2 = __commonJS({
|
|
|
52137
52137
|
case "ImportNamespaceSpecifier":
|
|
52138
52138
|
parts.push("* as ");
|
|
52139
52139
|
if (n.local) {
|
|
52140
|
-
parts.push(path2.call(
|
|
52140
|
+
parts.push(path2.call(print8, "local"));
|
|
52141
52141
|
} else if (n.id) {
|
|
52142
|
-
parts.push(path2.call(
|
|
52142
|
+
parts.push(path2.call(print8, "id"));
|
|
52143
52143
|
}
|
|
52144
52144
|
return (0, lines_1.concat)(parts);
|
|
52145
52145
|
case "ImportDefaultSpecifier":
|
|
52146
52146
|
if (n.local) {
|
|
52147
|
-
return path2.call(
|
|
52147
|
+
return path2.call(print8, "local");
|
|
52148
52148
|
}
|
|
52149
|
-
return path2.call(
|
|
52149
|
+
return path2.call(print8, "id");
|
|
52150
52150
|
case "TSExportAssignment":
|
|
52151
|
-
return (0, lines_1.concat)(["export = ", path2.call(
|
|
52151
|
+
return (0, lines_1.concat)(["export = ", path2.call(print8, "expression")]);
|
|
52152
52152
|
case "ExportDeclaration":
|
|
52153
52153
|
case "ExportDefaultDeclaration":
|
|
52154
52154
|
case "ExportNamedDeclaration":
|
|
52155
|
-
return printExportDeclaration(path2, options,
|
|
52155
|
+
return printExportDeclaration(path2, options, print8);
|
|
52156
52156
|
case "ExportAllDeclaration":
|
|
52157
52157
|
parts.push("export *");
|
|
52158
52158
|
if (n.exported) {
|
|
52159
|
-
parts.push(" as ", path2.call(
|
|
52159
|
+
parts.push(" as ", path2.call(print8, "exported"));
|
|
52160
52160
|
}
|
|
52161
|
-
parts.push(" from ", path2.call(
|
|
52161
|
+
parts.push(" from ", path2.call(print8, "source"), ";");
|
|
52162
52162
|
return (0, lines_1.concat)(parts);
|
|
52163
52163
|
case "TSNamespaceExportDeclaration":
|
|
52164
|
-
parts.push("export as namespace ", path2.call(
|
|
52164
|
+
parts.push("export as namespace ", path2.call(print8, "id"));
|
|
52165
52165
|
return maybeAddSemicolon((0, lines_1.concat)(parts));
|
|
52166
52166
|
case "ExportNamespaceSpecifier":
|
|
52167
|
-
return (0, lines_1.concat)(["* as ", path2.call(
|
|
52167
|
+
return (0, lines_1.concat)(["* as ", path2.call(print8, "exported")]);
|
|
52168
52168
|
case "ExportDefaultSpecifier":
|
|
52169
|
-
return path2.call(
|
|
52169
|
+
return path2.call(print8, "exported");
|
|
52170
52170
|
case "Import":
|
|
52171
52171
|
return (0, lines_1.fromString)("import", options);
|
|
52172
52172
|
case "ImportExpression":
|
|
52173
|
-
return (0, lines_1.concat)(["import(", path2.call(
|
|
52173
|
+
return (0, lines_1.concat)(["import(", path2.call(print8, "source"), ")"]);
|
|
52174
52174
|
case "ImportDeclaration": {
|
|
52175
52175
|
parts.push("import ");
|
|
52176
52176
|
if (n.importKind && n.importKind !== "value") {
|
|
@@ -52182,9 +52182,9 @@ var require_printer2 = __commonJS({
|
|
|
52182
52182
|
path2.each(function(specifierPath) {
|
|
52183
52183
|
var spec = specifierPath.getValue();
|
|
52184
52184
|
if (spec.type === "ImportSpecifier") {
|
|
52185
|
-
bracedSpecifiers_1.push(
|
|
52185
|
+
bracedSpecifiers_1.push(print8(specifierPath));
|
|
52186
52186
|
} else if (spec.type === "ImportDefaultSpecifier" || spec.type === "ImportNamespaceSpecifier") {
|
|
52187
|
-
unbracedSpecifiers_1.push(
|
|
52187
|
+
unbracedSpecifiers_1.push(print8(specifierPath));
|
|
52188
52188
|
}
|
|
52189
52189
|
}, "specifiers");
|
|
52190
52190
|
unbracedSpecifiers_1.forEach(function(lines2, i) {
|
|
@@ -52214,16 +52214,16 @@ var require_printer2 = __commonJS({
|
|
|
52214
52214
|
}
|
|
52215
52215
|
parts.push(" from ");
|
|
52216
52216
|
}
|
|
52217
|
-
parts.push(path2.call(
|
|
52217
|
+
parts.push(path2.call(print8, "source"), maybePrintImportAssertions(path2, options, print8), ";");
|
|
52218
52218
|
return (0, lines_1.concat)(parts);
|
|
52219
52219
|
}
|
|
52220
52220
|
case "ImportAttribute":
|
|
52221
|
-
return (0, lines_1.concat)([path2.call(
|
|
52221
|
+
return (0, lines_1.concat)([path2.call(print8, "key"), ": ", path2.call(print8, "value")]);
|
|
52222
52222
|
case "StaticBlock":
|
|
52223
52223
|
parts.push("static ");
|
|
52224
52224
|
case "BlockStatement": {
|
|
52225
52225
|
var naked_1 = path2.call(function(bodyPath) {
|
|
52226
|
-
return printStatementSequence(bodyPath, options,
|
|
52226
|
+
return printStatementSequence(bodyPath, options, print8);
|
|
52227
52227
|
}, "body");
|
|
52228
52228
|
if (naked_1.isEmpty()) {
|
|
52229
52229
|
if (!n.directives || n.directives.length === 0) {
|
|
@@ -52234,7 +52234,7 @@ var require_printer2 = __commonJS({
|
|
|
52234
52234
|
parts.push("{\n");
|
|
52235
52235
|
if (n.directives) {
|
|
52236
52236
|
path2.each(function(childPath) {
|
|
52237
|
-
parts.push(maybeAddSemicolon(
|
|
52237
|
+
parts.push(maybeAddSemicolon(print8(childPath).indent(options.tabWidth)), n.directives.length > 1 || !naked_1.isEmpty() ? "\n" : "");
|
|
52238
52238
|
}, "directives");
|
|
52239
52239
|
}
|
|
52240
52240
|
parts.push(naked_1.indent(options.tabWidth));
|
|
@@ -52244,7 +52244,7 @@ var require_printer2 = __commonJS({
|
|
|
52244
52244
|
case "ReturnStatement": {
|
|
52245
52245
|
parts.push("return");
|
|
52246
52246
|
if (n.argument) {
|
|
52247
|
-
var argLines = path2.call(
|
|
52247
|
+
var argLines = path2.call(print8, "argument");
|
|
52248
52248
|
if (argLines.startsWithComment() || argLines.length > 1 && namedTypes.JSXElement && namedTypes.JSXElement.check(n.argument)) {
|
|
52249
52249
|
parts.push(" (\n", argLines.indent(options.tabWidth), "\n)");
|
|
52250
52250
|
} else {
|
|
@@ -52256,17 +52256,17 @@ var require_printer2 = __commonJS({
|
|
|
52256
52256
|
}
|
|
52257
52257
|
case "CallExpression":
|
|
52258
52258
|
case "OptionalCallExpression":
|
|
52259
|
-
parts.push(path2.call(
|
|
52259
|
+
parts.push(path2.call(print8, "callee"));
|
|
52260
52260
|
if (n.typeParameters) {
|
|
52261
|
-
parts.push(path2.call(
|
|
52261
|
+
parts.push(path2.call(print8, "typeParameters"));
|
|
52262
52262
|
}
|
|
52263
52263
|
if (n.typeArguments) {
|
|
52264
|
-
parts.push(path2.call(
|
|
52264
|
+
parts.push(path2.call(print8, "typeArguments"));
|
|
52265
52265
|
}
|
|
52266
52266
|
if (types14.getFieldValue(n, "optional")) {
|
|
52267
52267
|
parts.push("?.");
|
|
52268
52268
|
}
|
|
52269
|
-
parts.push(printArgumentsList(path2, options,
|
|
52269
|
+
parts.push(printArgumentsList(path2, options, print8));
|
|
52270
52270
|
return (0, lines_1.concat)(parts);
|
|
52271
52271
|
case "RecordExpression":
|
|
52272
52272
|
parts.push("#");
|
|
@@ -52296,7 +52296,7 @@ var require_printer2 = __commonJS({
|
|
|
52296
52296
|
var i_1 = 0;
|
|
52297
52297
|
fields.forEach(function(field) {
|
|
52298
52298
|
path2.each(function(childPath) {
|
|
52299
|
-
var lines2 =
|
|
52299
|
+
var lines2 = print8(childPath);
|
|
52300
52300
|
if (!oneLine_1) {
|
|
52301
52301
|
lines2 = lines2.indent(options.tabWidth);
|
|
52302
52302
|
}
|
|
@@ -52333,32 +52333,32 @@ var require_printer2 = __commonJS({
|
|
|
52333
52333
|
parts[parts.length - 1] = " " + rightBrace;
|
|
52334
52334
|
}
|
|
52335
52335
|
if (n.typeAnnotation) {
|
|
52336
|
-
parts.push(path2.call(
|
|
52336
|
+
parts.push(path2.call(print8, "typeAnnotation"));
|
|
52337
52337
|
}
|
|
52338
52338
|
return (0, lines_1.concat)(parts);
|
|
52339
52339
|
}
|
|
52340
52340
|
case "PropertyPattern":
|
|
52341
52341
|
return (0, lines_1.concat)([
|
|
52342
|
-
path2.call(
|
|
52342
|
+
path2.call(print8, "key"),
|
|
52343
52343
|
": ",
|
|
52344
|
-
path2.call(
|
|
52344
|
+
path2.call(print8, "pattern")
|
|
52345
52345
|
]);
|
|
52346
52346
|
case "ObjectProperty":
|
|
52347
52347
|
case "Property": {
|
|
52348
52348
|
if (n.method || n.kind === "get" || n.kind === "set") {
|
|
52349
|
-
return printMethod(path2, options,
|
|
52349
|
+
return printMethod(path2, options, print8);
|
|
52350
52350
|
}
|
|
52351
52351
|
if (n.shorthand && n.value.type === "AssignmentPattern") {
|
|
52352
|
-
return path2.call(
|
|
52352
|
+
return path2.call(print8, "value");
|
|
52353
52353
|
}
|
|
52354
|
-
var key = path2.call(
|
|
52354
|
+
var key = path2.call(print8, "key");
|
|
52355
52355
|
if (n.computed) {
|
|
52356
52356
|
parts.push("[", key, "]");
|
|
52357
52357
|
} else {
|
|
52358
52358
|
parts.push(key);
|
|
52359
52359
|
}
|
|
52360
52360
|
if (!n.shorthand || n.key.name !== n.value.name) {
|
|
52361
|
-
parts.push(": ", path2.call(
|
|
52361
|
+
parts.push(": ", path2.call(print8, "value"));
|
|
52362
52362
|
}
|
|
52363
52363
|
return (0, lines_1.concat)(parts);
|
|
52364
52364
|
}
|
|
@@ -52366,18 +52366,18 @@ var require_printer2 = __commonJS({
|
|
|
52366
52366
|
case "ObjectMethod":
|
|
52367
52367
|
case "ClassPrivateMethod":
|
|
52368
52368
|
case "TSDeclareMethod":
|
|
52369
|
-
return printMethod(path2, options,
|
|
52369
|
+
return printMethod(path2, options, print8);
|
|
52370
52370
|
case "PrivateName":
|
|
52371
|
-
return (0, lines_1.concat)(["#", path2.call(
|
|
52371
|
+
return (0, lines_1.concat)(["#", path2.call(print8, "id")]);
|
|
52372
52372
|
case "Decorator":
|
|
52373
|
-
return (0, lines_1.concat)(["@", path2.call(
|
|
52373
|
+
return (0, lines_1.concat)(["@", path2.call(print8, "expression")]);
|
|
52374
52374
|
case "TupleExpression":
|
|
52375
52375
|
parts.push("#");
|
|
52376
52376
|
case "ArrayExpression":
|
|
52377
52377
|
case "ArrayPattern": {
|
|
52378
52378
|
var elems = n.elements;
|
|
52379
52379
|
var len_2 = elems.length;
|
|
52380
|
-
var printed_1 = path2.map(
|
|
52380
|
+
var printed_1 = path2.map(print8, "elements");
|
|
52381
52381
|
var joined = (0, lines_1.fromString)(", ").join(printed_1);
|
|
52382
52382
|
var oneLine_2 = joined.getLineLength(1) <= options.wrapColumn;
|
|
52383
52383
|
if (oneLine_2) {
|
|
@@ -52415,12 +52415,12 @@ var require_printer2 = __commonJS({
|
|
|
52415
52415
|
parts.push("]");
|
|
52416
52416
|
}
|
|
52417
52417
|
if (n.typeAnnotation) {
|
|
52418
|
-
parts.push(path2.call(
|
|
52418
|
+
parts.push(path2.call(print8, "typeAnnotation"));
|
|
52419
52419
|
}
|
|
52420
52420
|
return (0, lines_1.concat)(parts);
|
|
52421
52421
|
}
|
|
52422
52422
|
case "SequenceExpression":
|
|
52423
|
-
return (0, lines_1.fromString)(", ").join(path2.map(
|
|
52423
|
+
return (0, lines_1.fromString)(", ").join(path2.map(print8, "expressions"));
|
|
52424
52424
|
case "ThisExpression":
|
|
52425
52425
|
return (0, lines_1.fromString)("this");
|
|
52426
52426
|
case "Super":
|
|
@@ -52441,7 +52441,7 @@ var require_printer2 = __commonJS({
|
|
|
52441
52441
|
case "Literal":
|
|
52442
52442
|
return (0, lines_1.fromString)(getPossibleRaw(n) || (typeof n.value === "string" ? nodeStr(n.value, options) : n.value), options);
|
|
52443
52443
|
case "Directive":
|
|
52444
|
-
return path2.call(
|
|
52444
|
+
return path2.call(print8, "value");
|
|
52445
52445
|
case "DirectiveLiteral":
|
|
52446
52446
|
return (0, lines_1.fromString)(getPossibleRaw(n) || nodeStr(n.value, options), options);
|
|
52447
52447
|
case "InterpreterDirective":
|
|
@@ -52455,32 +52455,32 @@ var require_printer2 = __commonJS({
|
|
|
52455
52455
|
parts.push(n.operator);
|
|
52456
52456
|
if (/[a-z]$/.test(n.operator))
|
|
52457
52457
|
parts.push(" ");
|
|
52458
|
-
parts.push(path2.call(
|
|
52458
|
+
parts.push(path2.call(print8, "argument"));
|
|
52459
52459
|
return (0, lines_1.concat)(parts);
|
|
52460
52460
|
case "UpdateExpression":
|
|
52461
|
-
parts.push(path2.call(
|
|
52461
|
+
parts.push(path2.call(print8, "argument"), n.operator);
|
|
52462
52462
|
if (n.prefix)
|
|
52463
52463
|
parts.reverse();
|
|
52464
52464
|
return (0, lines_1.concat)(parts);
|
|
52465
52465
|
case "ConditionalExpression":
|
|
52466
52466
|
return (0, lines_1.concat)([
|
|
52467
|
-
path2.call(
|
|
52467
|
+
path2.call(print8, "test"),
|
|
52468
52468
|
" ? ",
|
|
52469
|
-
path2.call(
|
|
52469
|
+
path2.call(print8, "consequent"),
|
|
52470
52470
|
" : ",
|
|
52471
|
-
path2.call(
|
|
52471
|
+
path2.call(print8, "alternate")
|
|
52472
52472
|
]);
|
|
52473
52473
|
case "NewExpression": {
|
|
52474
|
-
parts.push("new ", path2.call(
|
|
52474
|
+
parts.push("new ", path2.call(print8, "callee"));
|
|
52475
52475
|
if (n.typeParameters) {
|
|
52476
|
-
parts.push(path2.call(
|
|
52476
|
+
parts.push(path2.call(print8, "typeParameters"));
|
|
52477
52477
|
}
|
|
52478
52478
|
if (n.typeArguments) {
|
|
52479
|
-
parts.push(path2.call(
|
|
52479
|
+
parts.push(path2.call(print8, "typeArguments"));
|
|
52480
52480
|
}
|
|
52481
52481
|
var args = n.arguments;
|
|
52482
52482
|
if (args) {
|
|
52483
|
-
parts.push(printArgumentsList(path2, options,
|
|
52483
|
+
parts.push(printArgumentsList(path2, options, print8));
|
|
52484
52484
|
}
|
|
52485
52485
|
return (0, lines_1.concat)(parts);
|
|
52486
52486
|
}
|
|
@@ -52491,7 +52491,7 @@ var require_printer2 = __commonJS({
|
|
|
52491
52491
|
parts.push(n.kind, " ");
|
|
52492
52492
|
var maxLen_1 = 0;
|
|
52493
52493
|
var printed = path2.map(function(childPath) {
|
|
52494
|
-
var lines2 =
|
|
52494
|
+
var lines2 = print8(childPath);
|
|
52495
52495
|
maxLen_1 = Math.max(lines2.length, maxLen_1);
|
|
52496
52496
|
return lines2;
|
|
52497
52497
|
}, "declarations");
|
|
@@ -52510,30 +52510,30 @@ var require_printer2 = __commonJS({
|
|
|
52510
52510
|
}
|
|
52511
52511
|
case "VariableDeclarator":
|
|
52512
52512
|
return n.init ? (0, lines_1.fromString)(" = ").join([
|
|
52513
|
-
path2.call(
|
|
52514
|
-
path2.call(
|
|
52515
|
-
]) : path2.call(
|
|
52513
|
+
path2.call(print8, "id"),
|
|
52514
|
+
path2.call(print8, "init")
|
|
52515
|
+
]) : path2.call(print8, "id");
|
|
52516
52516
|
case "WithStatement":
|
|
52517
52517
|
return (0, lines_1.concat)([
|
|
52518
52518
|
"with (",
|
|
52519
|
-
path2.call(
|
|
52519
|
+
path2.call(print8, "object"),
|
|
52520
52520
|
") ",
|
|
52521
|
-
path2.call(
|
|
52521
|
+
path2.call(print8, "body")
|
|
52522
52522
|
]);
|
|
52523
52523
|
case "IfStatement": {
|
|
52524
|
-
var con = adjustClause(path2.call(
|
|
52525
|
-
parts.push("if (", path2.call(
|
|
52524
|
+
var con = adjustClause(path2.call(print8, "consequent"), options);
|
|
52525
|
+
parts.push("if (", path2.call(print8, "test"), ")", con);
|
|
52526
52526
|
if (n.alternate)
|
|
52527
|
-
parts.push(endsWithBrace(con) ? " else" : "\nelse", adjustClause(path2.call(
|
|
52527
|
+
parts.push(endsWithBrace(con) ? " else" : "\nelse", adjustClause(path2.call(print8, "alternate"), options));
|
|
52528
52528
|
return (0, lines_1.concat)(parts);
|
|
52529
52529
|
}
|
|
52530
52530
|
case "ForStatement": {
|
|
52531
|
-
var init = path2.call(
|
|
52531
|
+
var init = path2.call(print8, "init");
|
|
52532
52532
|
var sep2 = init.length > 1 ? ";\n" : "; ";
|
|
52533
52533
|
var forParen = "for (";
|
|
52534
|
-
var indented = (0, lines_1.fromString)(sep2).join([init, path2.call(
|
|
52534
|
+
var indented = (0, lines_1.fromString)(sep2).join([init, path2.call(print8, "test"), path2.call(print8, "update")]).indentTail(forParen.length);
|
|
52535
52535
|
var head = (0, lines_1.concat)([forParen, indented, ")"]);
|
|
52536
|
-
var clause = adjustClause(path2.call(
|
|
52536
|
+
var clause = adjustClause(path2.call(print8, "body"), options);
|
|
52537
52537
|
parts.push(head);
|
|
52538
52538
|
if (head.length > 1) {
|
|
52539
52539
|
parts.push("\n");
|
|
@@ -52545,18 +52545,18 @@ var require_printer2 = __commonJS({
|
|
|
52545
52545
|
case "WhileStatement":
|
|
52546
52546
|
return (0, lines_1.concat)([
|
|
52547
52547
|
"while (",
|
|
52548
|
-
path2.call(
|
|
52548
|
+
path2.call(print8, "test"),
|
|
52549
52549
|
")",
|
|
52550
|
-
adjustClause(path2.call(
|
|
52550
|
+
adjustClause(path2.call(print8, "body"), options)
|
|
52551
52551
|
]);
|
|
52552
52552
|
case "ForInStatement":
|
|
52553
52553
|
return (0, lines_1.concat)([
|
|
52554
52554
|
n.each ? "for each (" : "for (",
|
|
52555
|
-
path2.call(
|
|
52555
|
+
path2.call(print8, "left"),
|
|
52556
52556
|
" in ",
|
|
52557
|
-
path2.call(
|
|
52557
|
+
path2.call(print8, "right"),
|
|
52558
52558
|
")",
|
|
52559
|
-
adjustClause(path2.call(
|
|
52559
|
+
adjustClause(path2.call(print8, "body"), options)
|
|
52560
52560
|
]);
|
|
52561
52561
|
case "ForOfStatement":
|
|
52562
52562
|
case "ForAwaitStatement":
|
|
@@ -52564,122 +52564,122 @@ var require_printer2 = __commonJS({
|
|
|
52564
52564
|
if (n.await || n.type === "ForAwaitStatement") {
|
|
52565
52565
|
parts.push("await ");
|
|
52566
52566
|
}
|
|
52567
|
-
parts.push("(", path2.call(
|
|
52567
|
+
parts.push("(", path2.call(print8, "left"), " of ", path2.call(print8, "right"), ")", adjustClause(path2.call(print8, "body"), options));
|
|
52568
52568
|
return (0, lines_1.concat)(parts);
|
|
52569
52569
|
case "DoWhileStatement": {
|
|
52570
52570
|
var doBody = (0, lines_1.concat)([
|
|
52571
52571
|
"do",
|
|
52572
|
-
adjustClause(path2.call(
|
|
52572
|
+
adjustClause(path2.call(print8, "body"), options)
|
|
52573
52573
|
]);
|
|
52574
52574
|
parts.push(doBody);
|
|
52575
52575
|
if (endsWithBrace(doBody))
|
|
52576
52576
|
parts.push(" while");
|
|
52577
52577
|
else
|
|
52578
52578
|
parts.push("\nwhile");
|
|
52579
|
-
parts.push(" (", path2.call(
|
|
52579
|
+
parts.push(" (", path2.call(print8, "test"), ");");
|
|
52580
52580
|
return (0, lines_1.concat)(parts);
|
|
52581
52581
|
}
|
|
52582
52582
|
case "DoExpression": {
|
|
52583
52583
|
var statements = path2.call(function(bodyPath) {
|
|
52584
|
-
return printStatementSequence(bodyPath, options,
|
|
52584
|
+
return printStatementSequence(bodyPath, options, print8);
|
|
52585
52585
|
}, "body");
|
|
52586
52586
|
return (0, lines_1.concat)(["do {\n", statements.indent(options.tabWidth), "\n}"]);
|
|
52587
52587
|
}
|
|
52588
52588
|
case "BreakStatement":
|
|
52589
52589
|
parts.push("break");
|
|
52590
52590
|
if (n.label)
|
|
52591
|
-
parts.push(" ", path2.call(
|
|
52591
|
+
parts.push(" ", path2.call(print8, "label"));
|
|
52592
52592
|
parts.push(";");
|
|
52593
52593
|
return (0, lines_1.concat)(parts);
|
|
52594
52594
|
case "ContinueStatement":
|
|
52595
52595
|
parts.push("continue");
|
|
52596
52596
|
if (n.label)
|
|
52597
|
-
parts.push(" ", path2.call(
|
|
52597
|
+
parts.push(" ", path2.call(print8, "label"));
|
|
52598
52598
|
parts.push(";");
|
|
52599
52599
|
return (0, lines_1.concat)(parts);
|
|
52600
52600
|
case "LabeledStatement":
|
|
52601
52601
|
return (0, lines_1.concat)([
|
|
52602
|
-
path2.call(
|
|
52602
|
+
path2.call(print8, "label"),
|
|
52603
52603
|
":\n",
|
|
52604
|
-
path2.call(
|
|
52604
|
+
path2.call(print8, "body")
|
|
52605
52605
|
]);
|
|
52606
52606
|
case "TryStatement":
|
|
52607
|
-
parts.push("try ", path2.call(
|
|
52607
|
+
parts.push("try ", path2.call(print8, "block"));
|
|
52608
52608
|
if (n.handler) {
|
|
52609
|
-
parts.push(" ", path2.call(
|
|
52609
|
+
parts.push(" ", path2.call(print8, "handler"));
|
|
52610
52610
|
} else if (n.handlers) {
|
|
52611
52611
|
path2.each(function(handlerPath) {
|
|
52612
|
-
parts.push(" ",
|
|
52612
|
+
parts.push(" ", print8(handlerPath));
|
|
52613
52613
|
}, "handlers");
|
|
52614
52614
|
}
|
|
52615
52615
|
if (n.finalizer) {
|
|
52616
|
-
parts.push(" finally ", path2.call(
|
|
52616
|
+
parts.push(" finally ", path2.call(print8, "finalizer"));
|
|
52617
52617
|
}
|
|
52618
52618
|
return (0, lines_1.concat)(parts);
|
|
52619
52619
|
case "CatchClause":
|
|
52620
52620
|
parts.push("catch ");
|
|
52621
52621
|
if (n.param) {
|
|
52622
|
-
parts.push("(", path2.call(
|
|
52622
|
+
parts.push("(", path2.call(print8, "param"));
|
|
52623
52623
|
}
|
|
52624
52624
|
if (n.guard) {
|
|
52625
|
-
parts.push(" if ", path2.call(
|
|
52625
|
+
parts.push(" if ", path2.call(print8, "guard"));
|
|
52626
52626
|
}
|
|
52627
52627
|
if (n.param) {
|
|
52628
52628
|
parts.push(") ");
|
|
52629
52629
|
}
|
|
52630
|
-
parts.push(path2.call(
|
|
52630
|
+
parts.push(path2.call(print8, "body"));
|
|
52631
52631
|
return (0, lines_1.concat)(parts);
|
|
52632
52632
|
case "ThrowStatement":
|
|
52633
|
-
return (0, lines_1.concat)(["throw ", path2.call(
|
|
52633
|
+
return (0, lines_1.concat)(["throw ", path2.call(print8, "argument"), ";"]);
|
|
52634
52634
|
case "SwitchStatement":
|
|
52635
52635
|
return (0, lines_1.concat)([
|
|
52636
52636
|
"switch (",
|
|
52637
|
-
path2.call(
|
|
52637
|
+
path2.call(print8, "discriminant"),
|
|
52638
52638
|
") {\n",
|
|
52639
|
-
(0, lines_1.fromString)("\n").join(path2.map(
|
|
52639
|
+
(0, lines_1.fromString)("\n").join(path2.map(print8, "cases")),
|
|
52640
52640
|
"\n}"
|
|
52641
52641
|
]);
|
|
52642
52642
|
case "SwitchCase":
|
|
52643
52643
|
if (n.test)
|
|
52644
|
-
parts.push("case ", path2.call(
|
|
52644
|
+
parts.push("case ", path2.call(print8, "test"), ":");
|
|
52645
52645
|
else
|
|
52646
52646
|
parts.push("default:");
|
|
52647
52647
|
if (n.consequent.length > 0) {
|
|
52648
52648
|
parts.push("\n", path2.call(function(consequentPath) {
|
|
52649
|
-
return printStatementSequence(consequentPath, options,
|
|
52649
|
+
return printStatementSequence(consequentPath, options, print8);
|
|
52650
52650
|
}, "consequent").indent(options.tabWidth));
|
|
52651
52651
|
}
|
|
52652
52652
|
return (0, lines_1.concat)(parts);
|
|
52653
52653
|
case "DebuggerStatement":
|
|
52654
52654
|
return (0, lines_1.fromString)("debugger;");
|
|
52655
52655
|
case "JSXAttribute":
|
|
52656
|
-
parts.push(path2.call(
|
|
52656
|
+
parts.push(path2.call(print8, "name"));
|
|
52657
52657
|
if (n.value)
|
|
52658
|
-
parts.push("=", path2.call(
|
|
52658
|
+
parts.push("=", path2.call(print8, "value"));
|
|
52659
52659
|
return (0, lines_1.concat)(parts);
|
|
52660
52660
|
case "JSXIdentifier":
|
|
52661
52661
|
return (0, lines_1.fromString)(n.name, options);
|
|
52662
52662
|
case "JSXNamespacedName":
|
|
52663
52663
|
return (0, lines_1.fromString)(":").join([
|
|
52664
|
-
path2.call(
|
|
52665
|
-
path2.call(
|
|
52664
|
+
path2.call(print8, "namespace"),
|
|
52665
|
+
path2.call(print8, "name")
|
|
52666
52666
|
]);
|
|
52667
52667
|
case "JSXMemberExpression":
|
|
52668
52668
|
return (0, lines_1.fromString)(".").join([
|
|
52669
|
-
path2.call(
|
|
52670
|
-
path2.call(
|
|
52669
|
+
path2.call(print8, "object"),
|
|
52670
|
+
path2.call(print8, "property")
|
|
52671
52671
|
]);
|
|
52672
52672
|
case "JSXSpreadAttribute":
|
|
52673
|
-
return (0, lines_1.concat)(["{...", path2.call(
|
|
52673
|
+
return (0, lines_1.concat)(["{...", path2.call(print8, "argument"), "}"]);
|
|
52674
52674
|
case "JSXSpreadChild":
|
|
52675
|
-
return (0, lines_1.concat)(["{...", path2.call(
|
|
52675
|
+
return (0, lines_1.concat)(["{...", path2.call(print8, "expression"), "}"]);
|
|
52676
52676
|
case "JSXExpressionContainer":
|
|
52677
|
-
return (0, lines_1.concat)(["{", path2.call(
|
|
52677
|
+
return (0, lines_1.concat)(["{", path2.call(print8, "expression"), "}"]);
|
|
52678
52678
|
case "JSXElement":
|
|
52679
52679
|
case "JSXFragment": {
|
|
52680
52680
|
var openingPropName = "opening" + (n.type === "JSXElement" ? "Element" : "Fragment");
|
|
52681
52681
|
var closingPropName = "closing" + (n.type === "JSXElement" ? "Element" : "Fragment");
|
|
52682
|
-
var openingLines = path2.call(
|
|
52682
|
+
var openingLines = path2.call(print8, openingPropName);
|
|
52683
52683
|
if (n[openingPropName].selfClosing) {
|
|
52684
52684
|
assert_1.default.ok(!n[closingPropName], "unexpected " + closingPropName + " element in self-closing " + n.type);
|
|
52685
52685
|
return openingLines;
|
|
@@ -52693,16 +52693,16 @@ var require_printer2 = __commonJS({
|
|
|
52693
52693
|
return "\n";
|
|
52694
52694
|
}
|
|
52695
52695
|
}
|
|
52696
|
-
return
|
|
52696
|
+
return print8(childPath);
|
|
52697
52697
|
}, "children")).indentTail(options.tabWidth);
|
|
52698
|
-
var closingLines = path2.call(
|
|
52698
|
+
var closingLines = path2.call(print8, closingPropName);
|
|
52699
52699
|
return (0, lines_1.concat)([openingLines, childLines, closingLines]);
|
|
52700
52700
|
}
|
|
52701
52701
|
case "JSXOpeningElement": {
|
|
52702
|
-
parts.push("<", path2.call(
|
|
52702
|
+
parts.push("<", path2.call(print8, "name"));
|
|
52703
52703
|
var attrParts_1 = [];
|
|
52704
52704
|
path2.each(function(attrPath) {
|
|
52705
|
-
attrParts_1.push(" ",
|
|
52705
|
+
attrParts_1.push(" ", print8(attrPath));
|
|
52706
52706
|
}, "attributes");
|
|
52707
52707
|
var attrLines = (0, lines_1.concat)(attrParts_1);
|
|
52708
52708
|
var needLineWrap = attrLines.length > 1 || attrLines.getLineLength(1) > options.wrapColumn;
|
|
@@ -52719,7 +52719,7 @@ var require_printer2 = __commonJS({
|
|
|
52719
52719
|
return (0, lines_1.concat)(parts);
|
|
52720
52720
|
}
|
|
52721
52721
|
case "JSXClosingElement":
|
|
52722
|
-
return (0, lines_1.concat)(["</", path2.call(
|
|
52722
|
+
return (0, lines_1.concat)(["</", path2.call(print8, "name"), ">"]);
|
|
52723
52723
|
case "JSXOpeningFragment":
|
|
52724
52724
|
return (0, lines_1.fromString)("<>");
|
|
52725
52725
|
case "JSXClosingFragment":
|
|
@@ -52730,9 +52730,9 @@ var require_printer2 = __commonJS({
|
|
|
52730
52730
|
return (0, lines_1.fromString)("");
|
|
52731
52731
|
case "TypeAnnotatedIdentifier":
|
|
52732
52732
|
return (0, lines_1.concat)([
|
|
52733
|
-
path2.call(
|
|
52733
|
+
path2.call(print8, "annotation"),
|
|
52734
52734
|
" ",
|
|
52735
|
-
path2.call(
|
|
52735
|
+
path2.call(print8, "identifier")
|
|
52736
52736
|
]);
|
|
52737
52737
|
case "ClassBody":
|
|
52738
52738
|
if (n.body.length === 0) {
|
|
@@ -52741,12 +52741,12 @@ var require_printer2 = __commonJS({
|
|
|
52741
52741
|
return (0, lines_1.concat)([
|
|
52742
52742
|
"{\n",
|
|
52743
52743
|
path2.call(function(bodyPath) {
|
|
52744
|
-
return printStatementSequence(bodyPath, options,
|
|
52744
|
+
return printStatementSequence(bodyPath, options, print8);
|
|
52745
52745
|
}, "body").indent(options.tabWidth),
|
|
52746
52746
|
"\n}"
|
|
52747
52747
|
]);
|
|
52748
52748
|
case "ClassPropertyDefinition":
|
|
52749
|
-
parts.push("static ", path2.call(
|
|
52749
|
+
parts.push("static ", path2.call(print8, "definition"));
|
|
52750
52750
|
if (!namedTypes.MethodDefinition.check(n.definition))
|
|
52751
52751
|
parts.push(";");
|
|
52752
52752
|
return (0, lines_1.concat)(parts);
|
|
@@ -52767,12 +52767,12 @@ var require_printer2 = __commonJS({
|
|
|
52767
52767
|
if (n.readonly) {
|
|
52768
52768
|
parts.push("readonly ");
|
|
52769
52769
|
}
|
|
52770
|
-
var key = path2.call(
|
|
52770
|
+
var key = path2.call(print8, "key");
|
|
52771
52771
|
if (n.computed) {
|
|
52772
52772
|
key = (0, lines_1.concat)(["[", key, "]"]);
|
|
52773
52773
|
}
|
|
52774
52774
|
if (n.variance) {
|
|
52775
|
-
key = (0, lines_1.concat)([printVariance(path2,
|
|
52775
|
+
key = (0, lines_1.concat)([printVariance(path2, print8), key]);
|
|
52776
52776
|
}
|
|
52777
52777
|
parts.push(key);
|
|
52778
52778
|
if (n.optional) {
|
|
@@ -52782,10 +52782,10 @@ var require_printer2 = __commonJS({
|
|
|
52782
52782
|
parts.push("!");
|
|
52783
52783
|
}
|
|
52784
52784
|
if (n.typeAnnotation) {
|
|
52785
|
-
parts.push(path2.call(
|
|
52785
|
+
parts.push(path2.call(print8, "typeAnnotation"));
|
|
52786
52786
|
}
|
|
52787
52787
|
if (n.value) {
|
|
52788
|
-
parts.push(" = ", path2.call(
|
|
52788
|
+
parts.push(" = ", path2.call(print8, "value"));
|
|
52789
52789
|
}
|
|
52790
52790
|
parts.push(";");
|
|
52791
52791
|
return (0, lines_1.concat)(parts);
|
|
@@ -52794,21 +52794,21 @@ var require_printer2 = __commonJS({
|
|
|
52794
52794
|
if (n.static) {
|
|
52795
52795
|
parts.push("static ");
|
|
52796
52796
|
}
|
|
52797
|
-
parts.push(path2.call(
|
|
52797
|
+
parts.push(path2.call(print8, "key"));
|
|
52798
52798
|
if (n.typeAnnotation) {
|
|
52799
|
-
parts.push(path2.call(
|
|
52799
|
+
parts.push(path2.call(print8, "typeAnnotation"));
|
|
52800
52800
|
}
|
|
52801
52801
|
if (n.value) {
|
|
52802
|
-
parts.push(" = ", path2.call(
|
|
52802
|
+
parts.push(" = ", path2.call(print8, "value"));
|
|
52803
52803
|
}
|
|
52804
52804
|
parts.push(";");
|
|
52805
52805
|
return (0, lines_1.concat)(parts);
|
|
52806
52806
|
case "ClassAccessorProperty": {
|
|
52807
52807
|
parts.push.apply(parts, tslib_1.__spreadArray(tslib_1.__spreadArray([], printClassMemberModifiers(n), false), ["accessor "], false));
|
|
52808
52808
|
if (n.computed) {
|
|
52809
|
-
parts.push("[", path2.call(
|
|
52809
|
+
parts.push("[", path2.call(print8, "key"), "]");
|
|
52810
52810
|
} else {
|
|
52811
|
-
parts.push(path2.call(
|
|
52811
|
+
parts.push(path2.call(print8, "key"));
|
|
52812
52812
|
}
|
|
52813
52813
|
if (n.optional) {
|
|
52814
52814
|
parts.push("?");
|
|
@@ -52817,10 +52817,10 @@ var require_printer2 = __commonJS({
|
|
|
52817
52817
|
parts.push("!");
|
|
52818
52818
|
}
|
|
52819
52819
|
if (n.typeAnnotation) {
|
|
52820
|
-
parts.push(path2.call(
|
|
52820
|
+
parts.push(path2.call(print8, "typeAnnotation"));
|
|
52821
52821
|
}
|
|
52822
52822
|
if (n.value) {
|
|
52823
|
-
parts.push(" = ", path2.call(
|
|
52823
|
+
parts.push(" = ", path2.call(print8, "value"));
|
|
52824
52824
|
}
|
|
52825
52825
|
parts.push(";");
|
|
52826
52826
|
return (0, lines_1.concat)(parts);
|
|
@@ -52836,21 +52836,21 @@ var require_printer2 = __commonJS({
|
|
|
52836
52836
|
}
|
|
52837
52837
|
parts.push("class");
|
|
52838
52838
|
if (n.id) {
|
|
52839
|
-
parts.push(" ", path2.call(
|
|
52839
|
+
parts.push(" ", path2.call(print8, "id"));
|
|
52840
52840
|
}
|
|
52841
52841
|
if (n.typeParameters) {
|
|
52842
|
-
parts.push(path2.call(
|
|
52842
|
+
parts.push(path2.call(print8, "typeParameters"));
|
|
52843
52843
|
}
|
|
52844
52844
|
if (n.superClass) {
|
|
52845
|
-
parts.push(" extends ", path2.call(
|
|
52845
|
+
parts.push(" extends ", path2.call(print8, "superClass"), path2.call(print8, "superTypeParameters"));
|
|
52846
52846
|
}
|
|
52847
52847
|
if (n.extends && n.extends.length > 0) {
|
|
52848
|
-
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(
|
|
52848
|
+
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(print8, "extends")));
|
|
52849
52849
|
}
|
|
52850
52850
|
if (n["implements"] && n["implements"].length > 0) {
|
|
52851
|
-
parts.push(" implements ", (0, lines_1.fromString)(", ").join(path2.map(
|
|
52851
|
+
parts.push(" implements ", (0, lines_1.fromString)(", ").join(path2.map(print8, "implements")));
|
|
52852
52852
|
}
|
|
52853
|
-
parts.push(" ", path2.call(
|
|
52853
|
+
parts.push(" ", path2.call(print8, "body"));
|
|
52854
52854
|
if (n.type === "DeclareClass") {
|
|
52855
52855
|
return printFlowDeclaration(path2, parts);
|
|
52856
52856
|
} else {
|
|
@@ -52859,11 +52859,11 @@ var require_printer2 = __commonJS({
|
|
|
52859
52859
|
case "TemplateElement":
|
|
52860
52860
|
return (0, lines_1.fromString)(n.value.raw, options).lockIndentTail();
|
|
52861
52861
|
case "TemplateLiteral": {
|
|
52862
|
-
var expressions_1 = path2.map(
|
|
52862
|
+
var expressions_1 = path2.map(print8, "expressions");
|
|
52863
52863
|
parts.push("`");
|
|
52864
52864
|
path2.each(function(childPath) {
|
|
52865
52865
|
var i = childPath.getName();
|
|
52866
|
-
parts.push(
|
|
52866
|
+
parts.push(print8(childPath));
|
|
52867
52867
|
if (i < expressions_1.length) {
|
|
52868
52868
|
parts.push("${", expressions_1[i], "}");
|
|
52869
52869
|
}
|
|
@@ -52872,7 +52872,7 @@ var require_printer2 = __commonJS({
|
|
|
52872
52872
|
return (0, lines_1.concat)(parts).lockIndentTail();
|
|
52873
52873
|
}
|
|
52874
52874
|
case "TaggedTemplateExpression":
|
|
52875
|
-
return (0, lines_1.concat)([path2.call(
|
|
52875
|
+
return (0, lines_1.concat)([path2.call(print8, "tag"), path2.call(print8, "quasi")]);
|
|
52876
52876
|
case "Node":
|
|
52877
52877
|
case "Printable":
|
|
52878
52878
|
case "SourceLocation":
|
|
@@ -52906,7 +52906,7 @@ var require_printer2 = __commonJS({
|
|
|
52906
52906
|
if (n.typeAnnotation.type !== "FunctionTypeAnnotation") {
|
|
52907
52907
|
parts.push(": ");
|
|
52908
52908
|
}
|
|
52909
|
-
parts.push(path2.call(
|
|
52909
|
+
parts.push(path2.call(print8, "typeAnnotation"));
|
|
52910
52910
|
return (0, lines_1.concat)(parts);
|
|
52911
52911
|
}
|
|
52912
52912
|
return (0, lines_1.fromString)("");
|
|
@@ -52920,9 +52920,9 @@ var require_printer2 = __commonJS({
|
|
|
52920
52920
|
case "MixedTypeAnnotation":
|
|
52921
52921
|
return (0, lines_1.fromString)("mixed", options);
|
|
52922
52922
|
case "ArrayTypeAnnotation":
|
|
52923
|
-
return (0, lines_1.concat)([path2.call(
|
|
52923
|
+
return (0, lines_1.concat)([path2.call(print8, "elementType"), "[]"]);
|
|
52924
52924
|
case "TupleTypeAnnotation": {
|
|
52925
|
-
var printed_2 = path2.map(
|
|
52925
|
+
var printed_2 = path2.map(print8, "types");
|
|
52926
52926
|
var joined = (0, lines_1.fromString)(", ").join(printed_2);
|
|
52927
52927
|
var oneLine_3 = joined.getLineLength(1) <= options.wrapColumn;
|
|
52928
52928
|
if (oneLine_3) {
|
|
@@ -52969,38 +52969,38 @@ var require_printer2 = __commonJS({
|
|
|
52969
52969
|
case "InterfaceTypeAnnotation":
|
|
52970
52970
|
parts.push("interface");
|
|
52971
52971
|
if (n.extends && n.extends.length > 0) {
|
|
52972
|
-
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(
|
|
52972
|
+
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path2.map(print8, "extends")));
|
|
52973
52973
|
}
|
|
52974
|
-
parts.push(" ", path2.call(
|
|
52974
|
+
parts.push(" ", path2.call(print8, "body"));
|
|
52975
52975
|
return (0, lines_1.concat)(parts);
|
|
52976
52976
|
case "DeclareFunction":
|
|
52977
52977
|
return printFlowDeclaration(path2, [
|
|
52978
52978
|
"function ",
|
|
52979
|
-
path2.call(
|
|
52979
|
+
path2.call(print8, "id"),
|
|
52980
52980
|
";"
|
|
52981
52981
|
]);
|
|
52982
52982
|
case "DeclareModule":
|
|
52983
52983
|
return printFlowDeclaration(path2, [
|
|
52984
52984
|
"module ",
|
|
52985
|
-
path2.call(
|
|
52985
|
+
path2.call(print8, "id"),
|
|
52986
52986
|
" ",
|
|
52987
|
-
path2.call(
|
|
52987
|
+
path2.call(print8, "body")
|
|
52988
52988
|
]);
|
|
52989
52989
|
case "DeclareModuleExports":
|
|
52990
52990
|
return printFlowDeclaration(path2, [
|
|
52991
52991
|
"module.exports",
|
|
52992
|
-
path2.call(
|
|
52992
|
+
path2.call(print8, "typeAnnotation")
|
|
52993
52993
|
]);
|
|
52994
52994
|
case "DeclareVariable":
|
|
52995
|
-
return printFlowDeclaration(path2, ["var ", path2.call(
|
|
52995
|
+
return printFlowDeclaration(path2, ["var ", path2.call(print8, "id"), ";"]);
|
|
52996
52996
|
case "DeclareExportDeclaration":
|
|
52997
52997
|
case "DeclareExportAllDeclaration":
|
|
52998
|
-
return (0, lines_1.concat)(["declare ", printExportDeclaration(path2, options,
|
|
52998
|
+
return (0, lines_1.concat)(["declare ", printExportDeclaration(path2, options, print8)]);
|
|
52999
52999
|
case "EnumDeclaration":
|
|
53000
53000
|
return (0, lines_1.concat)([
|
|
53001
53001
|
"enum ",
|
|
53002
|
-
path2.call(
|
|
53003
|
-
path2.call(
|
|
53002
|
+
path2.call(print8, "id"),
|
|
53003
|
+
path2.call(print8, "body")
|
|
53004
53004
|
]);
|
|
53005
53005
|
case "EnumBooleanBody":
|
|
53006
53006
|
case "EnumNumberBody":
|
|
@@ -53012,24 +53012,24 @@ var require_printer2 = __commonJS({
|
|
|
53012
53012
|
n.type.slice(4, -4).toLowerCase()
|
|
53013
53013
|
);
|
|
53014
53014
|
}
|
|
53015
|
-
parts.push(" {\n", (0, lines_1.fromString)("\n").join(path2.map(
|
|
53015
|
+
parts.push(" {\n", (0, lines_1.fromString)("\n").join(path2.map(print8, "members")).indent(options.tabWidth), "\n}");
|
|
53016
53016
|
return (0, lines_1.concat)(parts);
|
|
53017
53017
|
}
|
|
53018
53018
|
case "EnumDefaultedMember":
|
|
53019
|
-
return (0, lines_1.concat)([path2.call(
|
|
53019
|
+
return (0, lines_1.concat)([path2.call(print8, "id"), ","]);
|
|
53020
53020
|
case "EnumBooleanMember":
|
|
53021
53021
|
case "EnumNumberMember":
|
|
53022
53022
|
case "EnumStringMember":
|
|
53023
53023
|
return (0, lines_1.concat)([
|
|
53024
|
-
path2.call(
|
|
53024
|
+
path2.call(print8, "id"),
|
|
53025
53025
|
" = ",
|
|
53026
|
-
path2.call(
|
|
53026
|
+
path2.call(print8, "init"),
|
|
53027
53027
|
","
|
|
53028
53028
|
]);
|
|
53029
53029
|
case "InferredPredicate":
|
|
53030
53030
|
return (0, lines_1.fromString)("%checks", options);
|
|
53031
53031
|
case "DeclaredPredicate":
|
|
53032
|
-
return (0, lines_1.concat)(["%checks(", path2.call(
|
|
53032
|
+
return (0, lines_1.concat)(["%checks(", path2.call(print8, "value"), ")"]);
|
|
53033
53033
|
case "FunctionTypeAnnotation": {
|
|
53034
53034
|
var parent = path2.getParentNode(0);
|
|
53035
53035
|
var isArrowFunctionTypeAnnotation = !(namedTypes.ObjectTypeCallProperty.check(parent) || namedTypes.ObjectTypeInternalSlot.check(parent) && parent.method || namedTypes.DeclareFunction.check(path2.getParentNode(2)));
|
|
@@ -53039,14 +53039,14 @@ var require_printer2 = __commonJS({
|
|
|
53039
53039
|
}
|
|
53040
53040
|
var hasTypeParameters = !!n.typeParameters;
|
|
53041
53041
|
var needsParens = hasTypeParameters || n.params.length !== 1 || n.params[0].name;
|
|
53042
|
-
parts.push(hasTypeParameters ? path2.call(
|
|
53042
|
+
parts.push(hasTypeParameters ? path2.call(print8, "typeParameters") : "", needsParens ? "(" : "", printFunctionParams(path2, options, print8), needsParens ? ")" : "");
|
|
53043
53043
|
if (n.returnType) {
|
|
53044
|
-
parts.push(isArrowFunctionTypeAnnotation ? " => " : ": ", path2.call(
|
|
53044
|
+
parts.push(isArrowFunctionTypeAnnotation ? " => " : ": ", path2.call(print8, "returnType"));
|
|
53045
53045
|
}
|
|
53046
53046
|
return (0, lines_1.concat)(parts);
|
|
53047
53047
|
}
|
|
53048
53048
|
case "FunctionTypeParam": {
|
|
53049
|
-
var name = path2.call(
|
|
53049
|
+
var name = path2.call(print8, "name");
|
|
53050
53050
|
parts.push(name);
|
|
53051
53051
|
if (n.optional) {
|
|
53052
53052
|
parts.push("?");
|
|
@@ -53054,13 +53054,13 @@ var require_printer2 = __commonJS({
|
|
|
53054
53054
|
if (name.infos[0].line) {
|
|
53055
53055
|
parts.push(": ");
|
|
53056
53056
|
}
|
|
53057
|
-
parts.push(path2.call(
|
|
53057
|
+
parts.push(path2.call(print8, "typeAnnotation"));
|
|
53058
53058
|
return (0, lines_1.concat)(parts);
|
|
53059
53059
|
}
|
|
53060
53060
|
case "GenericTypeAnnotation":
|
|
53061
53061
|
return (0, lines_1.concat)([
|
|
53062
|
-
path2.call(
|
|
53063
|
-
path2.call(
|
|
53062
|
+
path2.call(print8, "id"),
|
|
53063
|
+
path2.call(print8, "typeParameters")
|
|
53064
53064
|
]);
|
|
53065
53065
|
case "DeclareInterface":
|
|
53066
53066
|
parts.push("declare ");
|
|
@@ -53069,24 +53069,24 @@ var require_printer2 = __commonJS({
|
|
|
53069
53069
|
if (n.declare) {
|
|
53070
53070
|
parts.push("declare ");
|
|
53071
53071
|
}
|
|
53072
|
-
parts.push("interface ", path2.call(
|
|
53072
|
+
parts.push("interface ", path2.call(print8, "id"), path2.call(print8, "typeParameters"), " ");
|
|
53073
53073
|
if (n["extends"] && n["extends"].length > 0) {
|
|
53074
|
-
parts.push("extends ", (0, lines_1.fromString)(", ").join(path2.map(
|
|
53074
|
+
parts.push("extends ", (0, lines_1.fromString)(", ").join(path2.map(print8, "extends")), " ");
|
|
53075
53075
|
}
|
|
53076
53076
|
if (n.body) {
|
|
53077
|
-
parts.push(path2.call(
|
|
53077
|
+
parts.push(path2.call(print8, "body"));
|
|
53078
53078
|
}
|
|
53079
53079
|
return (0, lines_1.concat)(parts);
|
|
53080
53080
|
case "ClassImplements":
|
|
53081
53081
|
case "InterfaceExtends":
|
|
53082
53082
|
return (0, lines_1.concat)([
|
|
53083
|
-
path2.call(
|
|
53084
|
-
path2.call(
|
|
53083
|
+
path2.call(print8, "id"),
|
|
53084
|
+
path2.call(print8, "typeParameters")
|
|
53085
53085
|
]);
|
|
53086
53086
|
case "IntersectionTypeAnnotation":
|
|
53087
|
-
return (0, lines_1.fromString)(" & ").join(path2.map(
|
|
53087
|
+
return (0, lines_1.fromString)(" & ").join(path2.map(print8, "types"));
|
|
53088
53088
|
case "NullableTypeAnnotation":
|
|
53089
|
-
return (0, lines_1.concat)(["?", path2.call(
|
|
53089
|
+
return (0, lines_1.concat)(["?", path2.call(print8, "typeAnnotation")]);
|
|
53090
53090
|
case "NullLiteralTypeAnnotation":
|
|
53091
53091
|
return (0, lines_1.fromString)("null", options);
|
|
53092
53092
|
case "ThisTypeAnnotation":
|
|
@@ -53094,40 +53094,40 @@ var require_printer2 = __commonJS({
|
|
|
53094
53094
|
case "NumberTypeAnnotation":
|
|
53095
53095
|
return (0, lines_1.fromString)("number", options);
|
|
53096
53096
|
case "ObjectTypeCallProperty":
|
|
53097
|
-
return path2.call(
|
|
53097
|
+
return path2.call(print8, "value");
|
|
53098
53098
|
case "ObjectTypeIndexer":
|
|
53099
53099
|
if (n.static) {
|
|
53100
53100
|
parts.push("static ");
|
|
53101
53101
|
}
|
|
53102
|
-
parts.push(printVariance(path2,
|
|
53102
|
+
parts.push(printVariance(path2, print8), "[");
|
|
53103
53103
|
if (n.id) {
|
|
53104
|
-
parts.push(path2.call(
|
|
53104
|
+
parts.push(path2.call(print8, "id"), ": ");
|
|
53105
53105
|
}
|
|
53106
|
-
parts.push(path2.call(
|
|
53106
|
+
parts.push(path2.call(print8, "key"), "]: ", path2.call(print8, "value"));
|
|
53107
53107
|
return (0, lines_1.concat)(parts);
|
|
53108
53108
|
case "ObjectTypeProperty":
|
|
53109
53109
|
return (0, lines_1.concat)([
|
|
53110
|
-
printVariance(path2,
|
|
53111
|
-
path2.call(
|
|
53110
|
+
printVariance(path2, print8),
|
|
53111
|
+
path2.call(print8, "key"),
|
|
53112
53112
|
n.optional ? "?" : "",
|
|
53113
53113
|
": ",
|
|
53114
|
-
path2.call(
|
|
53114
|
+
path2.call(print8, "value")
|
|
53115
53115
|
]);
|
|
53116
53116
|
case "ObjectTypeInternalSlot":
|
|
53117
53117
|
return (0, lines_1.concat)([
|
|
53118
53118
|
n.static ? "static " : "",
|
|
53119
53119
|
"[[",
|
|
53120
|
-
path2.call(
|
|
53120
|
+
path2.call(print8, "id"),
|
|
53121
53121
|
"]]",
|
|
53122
53122
|
n.optional ? "?" : "",
|
|
53123
53123
|
n.value.type !== "FunctionTypeAnnotation" ? ": " : "",
|
|
53124
|
-
path2.call(
|
|
53124
|
+
path2.call(print8, "value")
|
|
53125
53125
|
]);
|
|
53126
53126
|
case "QualifiedTypeIdentifier":
|
|
53127
53127
|
return (0, lines_1.concat)([
|
|
53128
|
-
path2.call(
|
|
53128
|
+
path2.call(print8, "qualification"),
|
|
53129
53129
|
".",
|
|
53130
|
-
path2.call(
|
|
53130
|
+
path2.call(print8, "id")
|
|
53131
53131
|
]);
|
|
53132
53132
|
case "StringLiteralTypeAnnotation":
|
|
53133
53133
|
return (0, lines_1.fromString)(nodeStr(n.value, options), options);
|
|
@@ -53144,36 +53144,36 @@ var require_printer2 = __commonJS({
|
|
|
53144
53144
|
case "TypeAlias":
|
|
53145
53145
|
return (0, lines_1.concat)([
|
|
53146
53146
|
"type ",
|
|
53147
|
-
path2.call(
|
|
53148
|
-
path2.call(
|
|
53147
|
+
path2.call(print8, "id"),
|
|
53148
|
+
path2.call(print8, "typeParameters"),
|
|
53149
53149
|
" = ",
|
|
53150
|
-
path2.call(
|
|
53150
|
+
path2.call(print8, "right"),
|
|
53151
53151
|
";"
|
|
53152
53152
|
]);
|
|
53153
53153
|
case "DeclareOpaqueType":
|
|
53154
53154
|
parts.push("declare ");
|
|
53155
53155
|
case "OpaqueType":
|
|
53156
|
-
parts.push("opaque type ", path2.call(
|
|
53156
|
+
parts.push("opaque type ", path2.call(print8, "id"), path2.call(print8, "typeParameters"));
|
|
53157
53157
|
if (n["supertype"]) {
|
|
53158
|
-
parts.push(": ", path2.call(
|
|
53158
|
+
parts.push(": ", path2.call(print8, "supertype"));
|
|
53159
53159
|
}
|
|
53160
53160
|
if (n["impltype"]) {
|
|
53161
|
-
parts.push(" = ", path2.call(
|
|
53161
|
+
parts.push(" = ", path2.call(print8, "impltype"));
|
|
53162
53162
|
}
|
|
53163
53163
|
parts.push(";");
|
|
53164
53164
|
return (0, lines_1.concat)(parts);
|
|
53165
53165
|
case "TypeCastExpression":
|
|
53166
53166
|
return (0, lines_1.concat)([
|
|
53167
53167
|
"(",
|
|
53168
|
-
path2.call(
|
|
53169
|
-
path2.call(
|
|
53168
|
+
path2.call(print8, "expression"),
|
|
53169
|
+
path2.call(print8, "typeAnnotation"),
|
|
53170
53170
|
")"
|
|
53171
53171
|
]);
|
|
53172
53172
|
case "TypeParameterDeclaration":
|
|
53173
53173
|
case "TypeParameterInstantiation":
|
|
53174
53174
|
return (0, lines_1.concat)([
|
|
53175
53175
|
"<",
|
|
53176
|
-
(0, lines_1.fromString)(", ").join(path2.map(
|
|
53176
|
+
(0, lines_1.fromString)(", ").join(path2.map(print8, "params")),
|
|
53177
53177
|
">"
|
|
53178
53178
|
]);
|
|
53179
53179
|
case "Variance":
|
|
@@ -53186,32 +53186,32 @@ var require_printer2 = __commonJS({
|
|
|
53186
53186
|
return (0, lines_1.fromString)("");
|
|
53187
53187
|
case "TypeParameter":
|
|
53188
53188
|
if (n.variance) {
|
|
53189
|
-
parts.push(printVariance(path2,
|
|
53189
|
+
parts.push(printVariance(path2, print8));
|
|
53190
53190
|
}
|
|
53191
|
-
parts.push(path2.call(
|
|
53191
|
+
parts.push(path2.call(print8, "name"));
|
|
53192
53192
|
if (n.bound) {
|
|
53193
|
-
parts.push(path2.call(
|
|
53193
|
+
parts.push(path2.call(print8, "bound"));
|
|
53194
53194
|
}
|
|
53195
53195
|
if (n["default"]) {
|
|
53196
|
-
parts.push("=", path2.call(
|
|
53196
|
+
parts.push("=", path2.call(print8, "default"));
|
|
53197
53197
|
}
|
|
53198
53198
|
return (0, lines_1.concat)(parts);
|
|
53199
53199
|
case "TypeofTypeAnnotation":
|
|
53200
53200
|
return (0, lines_1.concat)([
|
|
53201
53201
|
(0, lines_1.fromString)("typeof ", options),
|
|
53202
|
-
path2.call(
|
|
53202
|
+
path2.call(print8, "argument")
|
|
53203
53203
|
]);
|
|
53204
53204
|
case "IndexedAccessType":
|
|
53205
53205
|
case "OptionalIndexedAccessType":
|
|
53206
53206
|
return (0, lines_1.concat)([
|
|
53207
|
-
path2.call(
|
|
53207
|
+
path2.call(print8, "objectType"),
|
|
53208
53208
|
n.optional ? "?." : "",
|
|
53209
53209
|
"[",
|
|
53210
|
-
path2.call(
|
|
53210
|
+
path2.call(print8, "indexType"),
|
|
53211
53211
|
"]"
|
|
53212
53212
|
]);
|
|
53213
53213
|
case "UnionTypeAnnotation":
|
|
53214
|
-
return (0, lines_1.fromString)(" | ").join(path2.map(
|
|
53214
|
+
return (0, lines_1.fromString)(" | ").join(path2.map(print8, "types"));
|
|
53215
53215
|
case "VoidTypeAnnotation":
|
|
53216
53216
|
return (0, lines_1.fromString)("void", options);
|
|
53217
53217
|
case "NullTypeAnnotation":
|
|
@@ -53251,77 +53251,77 @@ var require_printer2 = __commonJS({
|
|
|
53251
53251
|
case "TSNeverKeyword":
|
|
53252
53252
|
return (0, lines_1.fromString)("never", options);
|
|
53253
53253
|
case "TSArrayType":
|
|
53254
|
-
return (0, lines_1.concat)([path2.call(
|
|
53254
|
+
return (0, lines_1.concat)([path2.call(print8, "elementType"), "[]"]);
|
|
53255
53255
|
case "TSLiteralType":
|
|
53256
|
-
return path2.call(
|
|
53256
|
+
return path2.call(print8, "literal");
|
|
53257
53257
|
case "TSUnionType":
|
|
53258
|
-
return (0, lines_1.fromString)(" | ").join(path2.map(
|
|
53258
|
+
return (0, lines_1.fromString)(" | ").join(path2.map(print8, "types"));
|
|
53259
53259
|
case "TSIntersectionType":
|
|
53260
|
-
return (0, lines_1.fromString)(" & ").join(path2.map(
|
|
53260
|
+
return (0, lines_1.fromString)(" & ").join(path2.map(print8, "types"));
|
|
53261
53261
|
case "TSConditionalType":
|
|
53262
|
-
parts.push(path2.call(
|
|
53262
|
+
parts.push(path2.call(print8, "checkType"), " extends ", path2.call(print8, "extendsType"), " ? ", path2.call(print8, "trueType"), " : ", path2.call(print8, "falseType"));
|
|
53263
53263
|
return (0, lines_1.concat)(parts);
|
|
53264
53264
|
case "TSInferType":
|
|
53265
|
-
parts.push("infer ", path2.call(
|
|
53265
|
+
parts.push("infer ", path2.call(print8, "typeParameter"));
|
|
53266
53266
|
return (0, lines_1.concat)(parts);
|
|
53267
53267
|
case "TSParenthesizedType":
|
|
53268
|
-
return (0, lines_1.concat)(["(", path2.call(
|
|
53268
|
+
return (0, lines_1.concat)(["(", path2.call(print8, "typeAnnotation"), ")"]);
|
|
53269
53269
|
case "TSFunctionType":
|
|
53270
53270
|
return (0, lines_1.concat)([
|
|
53271
|
-
path2.call(
|
|
53271
|
+
path2.call(print8, "typeParameters"),
|
|
53272
53272
|
"(",
|
|
53273
|
-
printFunctionParams(path2, options,
|
|
53273
|
+
printFunctionParams(path2, options, print8),
|
|
53274
53274
|
") => ",
|
|
53275
|
-
path2.call(
|
|
53275
|
+
path2.call(print8, "typeAnnotation", "typeAnnotation")
|
|
53276
53276
|
]);
|
|
53277
53277
|
case "TSConstructorType":
|
|
53278
53278
|
return (0, lines_1.concat)([
|
|
53279
53279
|
"new ",
|
|
53280
|
-
path2.call(
|
|
53280
|
+
path2.call(print8, "typeParameters"),
|
|
53281
53281
|
"(",
|
|
53282
|
-
printFunctionParams(path2, options,
|
|
53282
|
+
printFunctionParams(path2, options, print8),
|
|
53283
53283
|
") => ",
|
|
53284
|
-
path2.call(
|
|
53284
|
+
path2.call(print8, "typeAnnotation", "typeAnnotation")
|
|
53285
53285
|
]);
|
|
53286
53286
|
case "TSMappedType": {
|
|
53287
|
-
parts.push(n.readonly ? "readonly " : "", "[", path2.call(
|
|
53287
|
+
parts.push(n.readonly ? "readonly " : "", "[", path2.call(print8, "typeParameter"), "]", n.optional ? "?" : "");
|
|
53288
53288
|
if (n.typeAnnotation) {
|
|
53289
|
-
parts.push(": ", path2.call(
|
|
53289
|
+
parts.push(": ", path2.call(print8, "typeAnnotation"), ";");
|
|
53290
53290
|
}
|
|
53291
53291
|
return (0, lines_1.concat)(["{\n", (0, lines_1.concat)(parts).indent(options.tabWidth), "\n}"]);
|
|
53292
53292
|
}
|
|
53293
53293
|
case "TSTupleType":
|
|
53294
53294
|
return (0, lines_1.concat)([
|
|
53295
53295
|
"[",
|
|
53296
|
-
(0, lines_1.fromString)(", ").join(path2.map(
|
|
53296
|
+
(0, lines_1.fromString)(", ").join(path2.map(print8, "elementTypes")),
|
|
53297
53297
|
"]"
|
|
53298
53298
|
]);
|
|
53299
53299
|
case "TSNamedTupleMember":
|
|
53300
|
-
parts.push(path2.call(
|
|
53300
|
+
parts.push(path2.call(print8, "label"));
|
|
53301
53301
|
if (n.optional) {
|
|
53302
53302
|
parts.push("?");
|
|
53303
53303
|
}
|
|
53304
|
-
parts.push(": ", path2.call(
|
|
53304
|
+
parts.push(": ", path2.call(print8, "elementType"));
|
|
53305
53305
|
return (0, lines_1.concat)(parts);
|
|
53306
53306
|
case "TSRestType":
|
|
53307
|
-
return (0, lines_1.concat)(["...", path2.call(
|
|
53307
|
+
return (0, lines_1.concat)(["...", path2.call(print8, "typeAnnotation")]);
|
|
53308
53308
|
case "TSOptionalType":
|
|
53309
|
-
return (0, lines_1.concat)([path2.call(
|
|
53309
|
+
return (0, lines_1.concat)([path2.call(print8, "typeAnnotation"), "?"]);
|
|
53310
53310
|
case "TSIndexedAccessType":
|
|
53311
53311
|
return (0, lines_1.concat)([
|
|
53312
|
-
path2.call(
|
|
53312
|
+
path2.call(print8, "objectType"),
|
|
53313
53313
|
"[",
|
|
53314
|
-
path2.call(
|
|
53314
|
+
path2.call(print8, "indexType"),
|
|
53315
53315
|
"]"
|
|
53316
53316
|
]);
|
|
53317
53317
|
case "TSTypeOperator":
|
|
53318
53318
|
return (0, lines_1.concat)([
|
|
53319
|
-
path2.call(
|
|
53319
|
+
path2.call(print8, "operator"),
|
|
53320
53320
|
" ",
|
|
53321
|
-
path2.call(
|
|
53321
|
+
path2.call(print8, "typeAnnotation")
|
|
53322
53322
|
]);
|
|
53323
53323
|
case "TSTypeLiteral": {
|
|
53324
|
-
var members = (0, lines_1.fromString)("\n").join(path2.map(
|
|
53324
|
+
var members = (0, lines_1.fromString)("\n").join(path2.map(print8, "members").map(function(member) {
|
|
53325
53325
|
if (lastNonSpaceCharacter(member) !== ";") {
|
|
53326
53326
|
return member.concat(";");
|
|
53327
53327
|
}
|
|
@@ -53334,13 +53334,13 @@ var require_printer2 = __commonJS({
|
|
|
53334
53334
|
return (0, lines_1.concat)(parts);
|
|
53335
53335
|
}
|
|
53336
53336
|
case "TSEnumMember":
|
|
53337
|
-
parts.push(path2.call(
|
|
53337
|
+
parts.push(path2.call(print8, "id"));
|
|
53338
53338
|
if (n.initializer) {
|
|
53339
|
-
parts.push(" = ", path2.call(
|
|
53339
|
+
parts.push(" = ", path2.call(print8, "initializer"));
|
|
53340
53340
|
}
|
|
53341
53341
|
return (0, lines_1.concat)(parts);
|
|
53342
53342
|
case "TSTypeQuery":
|
|
53343
|
-
return (0, lines_1.concat)(["typeof ", path2.call(
|
|
53343
|
+
return (0, lines_1.concat)(["typeof ", path2.call(print8, "exprName")]);
|
|
53344
53344
|
case "TSParameterProperty":
|
|
53345
53345
|
if (n.accessibility) {
|
|
53346
53346
|
parts.push(n.accessibility, " ");
|
|
@@ -53354,119 +53354,119 @@ var require_printer2 = __commonJS({
|
|
|
53354
53354
|
if (n.readonly) {
|
|
53355
53355
|
parts.push("readonly ");
|
|
53356
53356
|
}
|
|
53357
|
-
parts.push(path2.call(
|
|
53357
|
+
parts.push(path2.call(print8, "parameter"));
|
|
53358
53358
|
return (0, lines_1.concat)(parts);
|
|
53359
53359
|
case "TSTypeReference":
|
|
53360
53360
|
return (0, lines_1.concat)([
|
|
53361
|
-
path2.call(
|
|
53362
|
-
path2.call(
|
|
53361
|
+
path2.call(print8, "typeName"),
|
|
53362
|
+
path2.call(print8, "typeParameters")
|
|
53363
53363
|
]);
|
|
53364
53364
|
case "TSQualifiedName":
|
|
53365
|
-
return (0, lines_1.concat)([path2.call(
|
|
53365
|
+
return (0, lines_1.concat)([path2.call(print8, "left"), ".", path2.call(print8, "right")]);
|
|
53366
53366
|
case "TSAsExpression":
|
|
53367
53367
|
case "TSSatisfiesExpression": {
|
|
53368
|
-
var expression = path2.call(
|
|
53369
|
-
parts.push(expression, n.type === "TSSatisfiesExpression" ? " satisfies " : " as ", path2.call(
|
|
53368
|
+
var expression = path2.call(print8, "expression");
|
|
53369
|
+
parts.push(expression, n.type === "TSSatisfiesExpression" ? " satisfies " : " as ", path2.call(print8, "typeAnnotation"));
|
|
53370
53370
|
return (0, lines_1.concat)(parts);
|
|
53371
53371
|
}
|
|
53372
53372
|
case "TSTypeCastExpression":
|
|
53373
53373
|
return (0, lines_1.concat)([
|
|
53374
|
-
path2.call(
|
|
53375
|
-
path2.call(
|
|
53374
|
+
path2.call(print8, "expression"),
|
|
53375
|
+
path2.call(print8, "typeAnnotation")
|
|
53376
53376
|
]);
|
|
53377
53377
|
case "TSNonNullExpression":
|
|
53378
|
-
return (0, lines_1.concat)([path2.call(
|
|
53378
|
+
return (0, lines_1.concat)([path2.call(print8, "expression"), "!"]);
|
|
53379
53379
|
case "TSTypeAnnotation":
|
|
53380
|
-
return (0, lines_1.concat)([": ", path2.call(
|
|
53380
|
+
return (0, lines_1.concat)([": ", path2.call(print8, "typeAnnotation")]);
|
|
53381
53381
|
case "TSIndexSignature":
|
|
53382
53382
|
return (0, lines_1.concat)([
|
|
53383
53383
|
n.readonly ? "readonly " : "",
|
|
53384
53384
|
"[",
|
|
53385
|
-
path2.map(
|
|
53385
|
+
path2.map(print8, "parameters"),
|
|
53386
53386
|
"]",
|
|
53387
|
-
path2.call(
|
|
53387
|
+
path2.call(print8, "typeAnnotation")
|
|
53388
53388
|
]);
|
|
53389
53389
|
case "TSPropertySignature":
|
|
53390
|
-
parts.push(printVariance(path2,
|
|
53390
|
+
parts.push(printVariance(path2, print8), n.readonly ? "readonly " : "");
|
|
53391
53391
|
if (n.computed) {
|
|
53392
|
-
parts.push("[", path2.call(
|
|
53392
|
+
parts.push("[", path2.call(print8, "key"), "]");
|
|
53393
53393
|
} else {
|
|
53394
|
-
parts.push(path2.call(
|
|
53394
|
+
parts.push(path2.call(print8, "key"));
|
|
53395
53395
|
}
|
|
53396
|
-
parts.push(n.optional ? "?" : "", path2.call(
|
|
53396
|
+
parts.push(n.optional ? "?" : "", path2.call(print8, "typeAnnotation"));
|
|
53397
53397
|
return (0, lines_1.concat)(parts);
|
|
53398
53398
|
case "TSMethodSignature":
|
|
53399
53399
|
if (n.computed) {
|
|
53400
|
-
parts.push("[", path2.call(
|
|
53400
|
+
parts.push("[", path2.call(print8, "key"), "]");
|
|
53401
53401
|
} else {
|
|
53402
|
-
parts.push(path2.call(
|
|
53402
|
+
parts.push(path2.call(print8, "key"));
|
|
53403
53403
|
}
|
|
53404
53404
|
if (n.optional) {
|
|
53405
53405
|
parts.push("?");
|
|
53406
53406
|
}
|
|
53407
|
-
parts.push(path2.call(
|
|
53407
|
+
parts.push(path2.call(print8, "typeParameters"), "(", printFunctionParams(path2, options, print8), ")", path2.call(print8, "typeAnnotation"));
|
|
53408
53408
|
return (0, lines_1.concat)(parts);
|
|
53409
53409
|
case "TSTypePredicate":
|
|
53410
53410
|
if (n.asserts) {
|
|
53411
53411
|
parts.push("asserts ");
|
|
53412
53412
|
}
|
|
53413
|
-
parts.push(path2.call(
|
|
53413
|
+
parts.push(path2.call(print8, "parameterName"));
|
|
53414
53414
|
if (n.typeAnnotation) {
|
|
53415
|
-
parts.push(" is ", path2.call(
|
|
53415
|
+
parts.push(" is ", path2.call(print8, "typeAnnotation", "typeAnnotation"));
|
|
53416
53416
|
}
|
|
53417
53417
|
return (0, lines_1.concat)(parts);
|
|
53418
53418
|
case "TSCallSignatureDeclaration":
|
|
53419
53419
|
return (0, lines_1.concat)([
|
|
53420
|
-
path2.call(
|
|
53420
|
+
path2.call(print8, "typeParameters"),
|
|
53421
53421
|
"(",
|
|
53422
|
-
printFunctionParams(path2, options,
|
|
53422
|
+
printFunctionParams(path2, options, print8),
|
|
53423
53423
|
")",
|
|
53424
|
-
path2.call(
|
|
53424
|
+
path2.call(print8, "typeAnnotation")
|
|
53425
53425
|
]);
|
|
53426
53426
|
case "TSConstructSignatureDeclaration":
|
|
53427
53427
|
if (n.typeParameters) {
|
|
53428
|
-
parts.push("new", path2.call(
|
|
53428
|
+
parts.push("new", path2.call(print8, "typeParameters"));
|
|
53429
53429
|
} else {
|
|
53430
53430
|
parts.push("new ");
|
|
53431
53431
|
}
|
|
53432
|
-
parts.push("(", printFunctionParams(path2, options,
|
|
53432
|
+
parts.push("(", printFunctionParams(path2, options, print8), ")", path2.call(print8, "typeAnnotation"));
|
|
53433
53433
|
return (0, lines_1.concat)(parts);
|
|
53434
53434
|
case "TSTypeAliasDeclaration":
|
|
53435
53435
|
return (0, lines_1.concat)([
|
|
53436
53436
|
n.declare ? "declare " : "",
|
|
53437
53437
|
"type ",
|
|
53438
|
-
path2.call(
|
|
53439
|
-
path2.call(
|
|
53438
|
+
path2.call(print8, "id"),
|
|
53439
|
+
path2.call(print8, "typeParameters"),
|
|
53440
53440
|
" = ",
|
|
53441
|
-
path2.call(
|
|
53441
|
+
path2.call(print8, "typeAnnotation"),
|
|
53442
53442
|
";"
|
|
53443
53443
|
]);
|
|
53444
53444
|
case "TSTypeParameter": {
|
|
53445
|
-
parts.push(path2.call(
|
|
53445
|
+
parts.push(path2.call(print8, "name"));
|
|
53446
53446
|
var parent = path2.getParentNode(0);
|
|
53447
53447
|
var isInMappedType = namedTypes.TSMappedType.check(parent);
|
|
53448
53448
|
if (n.constraint) {
|
|
53449
|
-
parts.push(isInMappedType ? " in " : " extends ", path2.call(
|
|
53449
|
+
parts.push(isInMappedType ? " in " : " extends ", path2.call(print8, "constraint"));
|
|
53450
53450
|
}
|
|
53451
53451
|
if (n["default"]) {
|
|
53452
|
-
parts.push(" = ", path2.call(
|
|
53452
|
+
parts.push(" = ", path2.call(print8, "default"));
|
|
53453
53453
|
}
|
|
53454
53454
|
return (0, lines_1.concat)(parts);
|
|
53455
53455
|
}
|
|
53456
53456
|
case "TSTypeAssertion": {
|
|
53457
|
-
parts.push("<", path2.call(
|
|
53457
|
+
parts.push("<", path2.call(print8, "typeAnnotation"), "> ", path2.call(print8, "expression"));
|
|
53458
53458
|
return (0, lines_1.concat)(parts);
|
|
53459
53459
|
}
|
|
53460
53460
|
case "TSTypeParameterDeclaration":
|
|
53461
53461
|
case "TSTypeParameterInstantiation":
|
|
53462
53462
|
return (0, lines_1.concat)([
|
|
53463
53463
|
"<",
|
|
53464
|
-
(0, lines_1.fromString)(", ").join(path2.map(
|
|
53464
|
+
(0, lines_1.fromString)(", ").join(path2.map(print8, "params")),
|
|
53465
53465
|
">"
|
|
53466
53466
|
]);
|
|
53467
53467
|
case "TSEnumDeclaration": {
|
|
53468
|
-
parts.push(n.declare ? "declare " : "", n.const ? "const " : "", "enum ", path2.call(
|
|
53469
|
-
var memberLines = (0, lines_1.fromString)(",\n").join(path2.map(
|
|
53468
|
+
parts.push(n.declare ? "declare " : "", n.const ? "const " : "", "enum ", path2.call(print8, "id"));
|
|
53469
|
+
var memberLines = (0, lines_1.fromString)(",\n").join(path2.map(print8, "members"));
|
|
53470
53470
|
if (memberLines.isEmpty()) {
|
|
53471
53471
|
parts.push(" {}");
|
|
53472
53472
|
} else {
|
|
@@ -53476,11 +53476,11 @@ var require_printer2 = __commonJS({
|
|
|
53476
53476
|
}
|
|
53477
53477
|
case "TSExpressionWithTypeArguments":
|
|
53478
53478
|
return (0, lines_1.concat)([
|
|
53479
|
-
path2.call(
|
|
53480
|
-
path2.call(
|
|
53479
|
+
path2.call(print8, "expression"),
|
|
53480
|
+
path2.call(print8, "typeParameters")
|
|
53481
53481
|
]);
|
|
53482
53482
|
case "TSInterfaceBody": {
|
|
53483
|
-
var lines = (0, lines_1.fromString)("\n").join(path2.map(
|
|
53483
|
+
var lines = (0, lines_1.fromString)("\n").join(path2.map(print8, "body").map(function(element) {
|
|
53484
53484
|
if (lastNonSpaceCharacter(element) !== ";") {
|
|
53485
53485
|
return element.concat(";");
|
|
53486
53486
|
}
|
|
@@ -53492,22 +53492,22 @@ var require_printer2 = __commonJS({
|
|
|
53492
53492
|
return (0, lines_1.concat)(["{\n", lines.indent(options.tabWidth), "\n}"]);
|
|
53493
53493
|
}
|
|
53494
53494
|
case "TSImportType":
|
|
53495
|
-
parts.push("import(", path2.call(
|
|
53495
|
+
parts.push("import(", path2.call(print8, "argument"), ")");
|
|
53496
53496
|
if (n.qualifier) {
|
|
53497
|
-
parts.push(".", path2.call(
|
|
53497
|
+
parts.push(".", path2.call(print8, "qualifier"));
|
|
53498
53498
|
}
|
|
53499
53499
|
if (n.typeParameters) {
|
|
53500
|
-
parts.push(path2.call(
|
|
53500
|
+
parts.push(path2.call(print8, "typeParameters"));
|
|
53501
53501
|
}
|
|
53502
53502
|
return (0, lines_1.concat)(parts);
|
|
53503
53503
|
case "TSImportEqualsDeclaration":
|
|
53504
53504
|
if (n.isExport) {
|
|
53505
53505
|
parts.push("export ");
|
|
53506
53506
|
}
|
|
53507
|
-
parts.push("import ", path2.call(
|
|
53507
|
+
parts.push("import ", path2.call(print8, "id"), " = ", path2.call(print8, "moduleReference"));
|
|
53508
53508
|
return maybeAddSemicolon((0, lines_1.concat)(parts));
|
|
53509
53509
|
case "TSExternalModuleReference":
|
|
53510
|
-
return (0, lines_1.concat)(["require(", path2.call(
|
|
53510
|
+
return (0, lines_1.concat)(["require(", path2.call(print8, "expression"), ")"]);
|
|
53511
53511
|
case "TSModuleDeclaration": {
|
|
53512
53512
|
var parent = path2.getParentNode();
|
|
53513
53513
|
if (parent.type === "TSModuleDeclaration") {
|
|
@@ -53532,16 +53532,16 @@ var require_printer2 = __commonJS({
|
|
|
53532
53532
|
}
|
|
53533
53533
|
}
|
|
53534
53534
|
}
|
|
53535
|
-
parts.push(path2.call(
|
|
53535
|
+
parts.push(path2.call(print8, "id"));
|
|
53536
53536
|
if (n.body) {
|
|
53537
53537
|
parts.push(" ");
|
|
53538
|
-
parts.push(path2.call(
|
|
53538
|
+
parts.push(path2.call(print8, "body"));
|
|
53539
53539
|
}
|
|
53540
53540
|
return (0, lines_1.concat)(parts);
|
|
53541
53541
|
}
|
|
53542
53542
|
case "TSModuleBlock": {
|
|
53543
53543
|
var naked = path2.call(function(bodyPath) {
|
|
53544
|
-
return printStatementSequence(bodyPath, options,
|
|
53544
|
+
return printStatementSequence(bodyPath, options, print8);
|
|
53545
53545
|
}, "body");
|
|
53546
53546
|
if (naked.isEmpty()) {
|
|
53547
53547
|
parts.push("{}");
|
|
@@ -53551,11 +53551,11 @@ var require_printer2 = __commonJS({
|
|
|
53551
53551
|
return (0, lines_1.concat)(parts);
|
|
53552
53552
|
}
|
|
53553
53553
|
case "TSInstantiationExpression": {
|
|
53554
|
-
parts.push(path2.call(
|
|
53554
|
+
parts.push(path2.call(print8, "expression"), path2.call(print8, "typeParameters"));
|
|
53555
53555
|
return (0, lines_1.concat)(parts);
|
|
53556
53556
|
}
|
|
53557
53557
|
case "V8IntrinsicIdentifier":
|
|
53558
|
-
return (0, lines_1.concat)(["%", path2.call(
|
|
53558
|
+
return (0, lines_1.concat)(["%", path2.call(print8, "name")]);
|
|
53559
53559
|
case "TopicReference":
|
|
53560
53560
|
return (0, lines_1.fromString)("#");
|
|
53561
53561
|
case "ClassHeritage":
|
|
@@ -53605,7 +53605,7 @@ var require_printer2 = __commonJS({
|
|
|
53605
53605
|
}
|
|
53606
53606
|
return (0, lines_1.concat)(parts);
|
|
53607
53607
|
}
|
|
53608
|
-
function printStatementSequence(path2, options,
|
|
53608
|
+
function printStatementSequence(path2, options, print8) {
|
|
53609
53609
|
var filtered = [];
|
|
53610
53610
|
var sawComment = false;
|
|
53611
53611
|
var sawStatement = false;
|
|
@@ -53626,7 +53626,7 @@ var require_printer2 = __commonJS({
|
|
|
53626
53626
|
}
|
|
53627
53627
|
filtered.push({
|
|
53628
53628
|
node: stmt,
|
|
53629
|
-
printed:
|
|
53629
|
+
printed: print8(stmtPath)
|
|
53630
53630
|
});
|
|
53631
53631
|
});
|
|
53632
53632
|
if (sawComment) {
|
|
@@ -53718,7 +53718,7 @@ var require_printer2 = __commonJS({
|
|
|
53718
53718
|
}
|
|
53719
53719
|
return parts;
|
|
53720
53720
|
}
|
|
53721
|
-
function printMethod(path2, options,
|
|
53721
|
+
function printMethod(path2, options, print8) {
|
|
53722
53722
|
var node = path2.getNode();
|
|
53723
53723
|
var kind = node.kind;
|
|
53724
53724
|
var parts = [];
|
|
@@ -53736,7 +53736,7 @@ var require_printer2 = __commonJS({
|
|
|
53736
53736
|
if (kind === "get" || kind === "set") {
|
|
53737
53737
|
parts.push(kind, " ");
|
|
53738
53738
|
}
|
|
53739
|
-
var key = path2.call(
|
|
53739
|
+
var key = path2.call(print8, "key");
|
|
53740
53740
|
if (node.computed) {
|
|
53741
53741
|
key = (0, lines_1.concat)(["[", key, "]"]);
|
|
53742
53742
|
}
|
|
@@ -53745,26 +53745,26 @@ var require_printer2 = __commonJS({
|
|
|
53745
53745
|
parts.push("?");
|
|
53746
53746
|
}
|
|
53747
53747
|
if (node === nodeValue) {
|
|
53748
|
-
parts.push(path2.call(
|
|
53748
|
+
parts.push(path2.call(print8, "typeParameters"), "(", printFunctionParams(path2, options, print8), ")", path2.call(print8, "returnType"));
|
|
53749
53749
|
if (node.body) {
|
|
53750
|
-
parts.push(" ", path2.call(
|
|
53750
|
+
parts.push(" ", path2.call(print8, "body"));
|
|
53751
53751
|
} else {
|
|
53752
53752
|
parts.push(";");
|
|
53753
53753
|
}
|
|
53754
53754
|
} else {
|
|
53755
|
-
parts.push(path2.call(
|
|
53756
|
-
return printFunctionParams(valuePath, options,
|
|
53757
|
-
}, "value"), ")", path2.call(
|
|
53755
|
+
parts.push(path2.call(print8, "value", "typeParameters"), "(", path2.call(function(valuePath) {
|
|
53756
|
+
return printFunctionParams(valuePath, options, print8);
|
|
53757
|
+
}, "value"), ")", path2.call(print8, "value", "returnType"));
|
|
53758
53758
|
if (nodeValue.body) {
|
|
53759
|
-
parts.push(" ", path2.call(
|
|
53759
|
+
parts.push(" ", path2.call(print8, "value", "body"));
|
|
53760
53760
|
} else {
|
|
53761
53761
|
parts.push(";");
|
|
53762
53762
|
}
|
|
53763
53763
|
}
|
|
53764
53764
|
return (0, lines_1.concat)(parts);
|
|
53765
53765
|
}
|
|
53766
|
-
function printArgumentsList(path2, options,
|
|
53767
|
-
var printed = path2.map(
|
|
53766
|
+
function printArgumentsList(path2, options, print8) {
|
|
53767
|
+
var printed = path2.map(print8, "arguments");
|
|
53768
53768
|
var trailingComma = util.isTrailingCommaEnabled(options, "parameters");
|
|
53769
53769
|
var joined = (0, lines_1.fromString)(", ").join(printed);
|
|
53770
53770
|
if (joined.getLineLength(1) > options.wrapColumn) {
|
|
@@ -53777,28 +53777,28 @@ var require_printer2 = __commonJS({
|
|
|
53777
53777
|
}
|
|
53778
53778
|
return (0, lines_1.concat)(["(", joined, ")"]);
|
|
53779
53779
|
}
|
|
53780
|
-
function printFunctionParams(path2, options,
|
|
53780
|
+
function printFunctionParams(path2, options, print8) {
|
|
53781
53781
|
var fun = path2.getValue();
|
|
53782
53782
|
var params;
|
|
53783
53783
|
var printed = [];
|
|
53784
53784
|
if (fun.params) {
|
|
53785
53785
|
params = fun.params;
|
|
53786
|
-
printed = path2.map(
|
|
53786
|
+
printed = path2.map(print8, "params");
|
|
53787
53787
|
} else if (fun.parameters) {
|
|
53788
53788
|
params = fun.parameters;
|
|
53789
|
-
printed = path2.map(
|
|
53789
|
+
printed = path2.map(print8, "parameters");
|
|
53790
53790
|
}
|
|
53791
53791
|
if (fun.defaults) {
|
|
53792
53792
|
path2.each(function(defExprPath) {
|
|
53793
53793
|
var i = defExprPath.getName();
|
|
53794
53794
|
var p = printed[i];
|
|
53795
53795
|
if (p && defExprPath.getValue()) {
|
|
53796
|
-
printed[i] = (0, lines_1.concat)([p, " = ",
|
|
53796
|
+
printed[i] = (0, lines_1.concat)([p, " = ", print8(defExprPath)]);
|
|
53797
53797
|
}
|
|
53798
53798
|
}, "defaults");
|
|
53799
53799
|
}
|
|
53800
53800
|
if (fun.rest) {
|
|
53801
|
-
printed.push((0, lines_1.concat)(["...", path2.call(
|
|
53801
|
+
printed.push((0, lines_1.concat)(["...", path2.call(print8, "rest")]));
|
|
53802
53802
|
}
|
|
53803
53803
|
var joined = (0, lines_1.fromString)(", ").join(printed);
|
|
53804
53804
|
if (joined.length > 1 || joined.getLineLength(1) > options.wrapColumn) {
|
|
@@ -53812,11 +53812,11 @@ var require_printer2 = __commonJS({
|
|
|
53812
53812
|
}
|
|
53813
53813
|
return joined;
|
|
53814
53814
|
}
|
|
53815
|
-
function maybePrintImportAssertions(path2, options,
|
|
53815
|
+
function maybePrintImportAssertions(path2, options, print8) {
|
|
53816
53816
|
var n = path2.getValue();
|
|
53817
53817
|
if (n.assertions && n.assertions.length > 0) {
|
|
53818
53818
|
var parts = [" assert {"];
|
|
53819
|
-
var printed = path2.map(
|
|
53819
|
+
var printed = path2.map(print8, "assertions");
|
|
53820
53820
|
var flat = (0, lines_1.fromString)(", ").join(printed);
|
|
53821
53821
|
if (flat.length > 1 || flat.getLineLength(1) > options.wrapColumn) {
|
|
53822
53822
|
parts.push("\n", (0, lines_1.fromString)(",\n").join(printed).indent(options.tabWidth), "\n}");
|
|
@@ -53827,7 +53827,7 @@ var require_printer2 = __commonJS({
|
|
|
53827
53827
|
}
|
|
53828
53828
|
return (0, lines_1.fromString)("");
|
|
53829
53829
|
}
|
|
53830
|
-
function printExportDeclaration(path2, options,
|
|
53830
|
+
function printExportDeclaration(path2, options, print8) {
|
|
53831
53831
|
var decl = path2.getValue();
|
|
53832
53832
|
var parts = ["export "];
|
|
53833
53833
|
if (decl.exportKind && decl.exportKind === "type") {
|
|
@@ -53841,7 +53841,7 @@ var require_printer2 = __commonJS({
|
|
|
53841
53841
|
parts.push("default ");
|
|
53842
53842
|
}
|
|
53843
53843
|
if (decl.declaration) {
|
|
53844
|
-
parts.push(path2.call(
|
|
53844
|
+
parts.push(path2.call(print8, "declaration"));
|
|
53845
53845
|
} else if (decl.specifiers) {
|
|
53846
53846
|
if (decl.specifiers.length === 1 && decl.specifiers[0].type === "ExportBatchSpecifier") {
|
|
53847
53847
|
parts.push("*");
|
|
@@ -53853,9 +53853,9 @@ var require_printer2 = __commonJS({
|
|
|
53853
53853
|
path2.each(function(specifierPath) {
|
|
53854
53854
|
var spec = specifierPath.getValue();
|
|
53855
53855
|
if (spec.type === "ExportDefaultSpecifier") {
|
|
53856
|
-
unbracedSpecifiers_2.push(
|
|
53856
|
+
unbracedSpecifiers_2.push(print8(specifierPath));
|
|
53857
53857
|
} else {
|
|
53858
|
-
bracedSpecifiers_2.push(
|
|
53858
|
+
bracedSpecifiers_2.push(print8(specifierPath));
|
|
53859
53859
|
}
|
|
53860
53860
|
}, "specifiers");
|
|
53861
53861
|
unbracedSpecifiers_2.forEach(function(lines2, i) {
|
|
@@ -53884,10 +53884,10 @@ var require_printer2 = __commonJS({
|
|
|
53884
53884
|
}
|
|
53885
53885
|
}
|
|
53886
53886
|
} else {
|
|
53887
|
-
parts.push(shouldPrintSpaces ? "{ " : "{", (0, lines_1.fromString)(", ").join(path2.map(
|
|
53887
|
+
parts.push(shouldPrintSpaces ? "{ " : "{", (0, lines_1.fromString)(", ").join(path2.map(print8, "specifiers")), shouldPrintSpaces ? " }" : "}");
|
|
53888
53888
|
}
|
|
53889
53889
|
if (decl.source) {
|
|
53890
|
-
parts.push(" from ", path2.call(
|
|
53890
|
+
parts.push(" from ", path2.call(print8, "source"), maybePrintImportAssertions(path2, options, print8));
|
|
53891
53891
|
}
|
|
53892
53892
|
}
|
|
53893
53893
|
var lines = (0, lines_1.concat)(parts);
|
|
@@ -53905,7 +53905,7 @@ var require_printer2 = __commonJS({
|
|
|
53905
53905
|
}
|
|
53906
53906
|
return (0, lines_1.concat)(parts);
|
|
53907
53907
|
}
|
|
53908
|
-
function printVariance(path2,
|
|
53908
|
+
function printVariance(path2, print8) {
|
|
53909
53909
|
return path2.call(function(variancePath) {
|
|
53910
53910
|
var value = variancePath.getValue();
|
|
53911
53911
|
if (value) {
|
|
@@ -53915,7 +53915,7 @@ var require_printer2 = __commonJS({
|
|
|
53915
53915
|
if (value === "minus") {
|
|
53916
53916
|
return (0, lines_1.fromString)("-");
|
|
53917
53917
|
}
|
|
53918
|
-
return
|
|
53918
|
+
return print8(variancePath);
|
|
53919
53919
|
}
|
|
53920
53920
|
return (0, lines_1.fromString)("");
|
|
53921
53921
|
}, "variance");
|
|
@@ -54002,10 +54002,10 @@ var require_main2 = __commonJS({
|
|
|
54002
54002
|
Object.defineProperty(exports, "visit", { enumerable: true, get: function() {
|
|
54003
54003
|
return ast_types_1.visit;
|
|
54004
54004
|
} });
|
|
54005
|
-
function
|
|
54005
|
+
function print8(node, options) {
|
|
54006
54006
|
return new printer_1.Printer(options).print(node);
|
|
54007
54007
|
}
|
|
54008
|
-
exports.print =
|
|
54008
|
+
exports.print = print8;
|
|
54009
54009
|
function prettyPrint3(node, options) {
|
|
54010
54010
|
return new printer_1.Printer(options).printGenerically(node);
|
|
54011
54011
|
}
|
|
@@ -54029,7 +54029,7 @@ var require_main2 = __commonJS({
|
|
|
54029
54029
|
function runString(code, transformer, options) {
|
|
54030
54030
|
var writeback = options && options.writeback || defaultWriteback;
|
|
54031
54031
|
transformer((0, parser_1.parse)(code, options), function(node) {
|
|
54032
|
-
writeback(
|
|
54032
|
+
writeback(print8(node, options).code);
|
|
54033
54033
|
});
|
|
54034
54034
|
}
|
|
54035
54035
|
}
|
|
@@ -54053,7 +54053,7 @@ async function runPipeline(config2, pipeline, target) {
|
|
|
54053
54053
|
|
|
54054
54054
|
// src/lib/config.ts
|
|
54055
54055
|
var import_minimatch = __toESM(require_minimatch(), 1);
|
|
54056
|
-
var
|
|
54056
|
+
var import_node_url = require("node:url");
|
|
54057
54057
|
|
|
54058
54058
|
// src/runtime/lib/config.ts
|
|
54059
54059
|
function keyFieldsForType(configFile, type) {
|
|
@@ -54132,10 +54132,10 @@ __export(fs_exports, {
|
|
|
54132
54132
|
writeFile: () => writeFile
|
|
54133
54133
|
});
|
|
54134
54134
|
var import_fs_extra = __toESM(require_lib(), 1);
|
|
54135
|
-
var import_promises = __toESM(require("fs/promises"), 1);
|
|
54136
54135
|
var import_glob = __toESM(require_glob(), 1);
|
|
54137
54136
|
var import_memfs = __toESM(require_lib2(), 1);
|
|
54138
|
-
var
|
|
54137
|
+
var import_promises = __toESM(require("node:fs/promises"), 1);
|
|
54138
|
+
var import_node_util = require("node:util");
|
|
54139
54139
|
|
|
54140
54140
|
// src/lib/path.ts
|
|
54141
54141
|
var path_exports = {};
|
|
@@ -54152,36 +54152,36 @@ __export(path_exports, {
|
|
|
54152
54152
|
resolve: () => resolve,
|
|
54153
54153
|
sep: () => sep
|
|
54154
54154
|
});
|
|
54155
|
-
var
|
|
54156
|
-
var
|
|
54155
|
+
var import_node_os = __toESM(require("node:os"), 1);
|
|
54156
|
+
var import_node_path = __toESM(require("node:path"), 1);
|
|
54157
54157
|
var sep = "/";
|
|
54158
54158
|
function resolve(...parts) {
|
|
54159
|
-
return posixify(
|
|
54159
|
+
return posixify(import_node_path.default.resolve(...parts));
|
|
54160
54160
|
}
|
|
54161
54161
|
function join(...parts) {
|
|
54162
|
-
return posixify(
|
|
54162
|
+
return posixify(import_node_path.default.join(...parts));
|
|
54163
54163
|
}
|
|
54164
54164
|
function extname(target) {
|
|
54165
|
-
return
|
|
54165
|
+
return import_node_path.default.extname(target);
|
|
54166
54166
|
}
|
|
54167
54167
|
function relative(from, to) {
|
|
54168
|
-
return posixify(
|
|
54168
|
+
return posixify(import_node_path.default.relative(from, to));
|
|
54169
54169
|
}
|
|
54170
54170
|
function basename(target) {
|
|
54171
|
-
return
|
|
54171
|
+
return import_node_path.default.basename(target);
|
|
54172
54172
|
}
|
|
54173
54173
|
function dirname(target) {
|
|
54174
|
-
return
|
|
54174
|
+
return import_node_path.default.dirname(target);
|
|
54175
54175
|
}
|
|
54176
54176
|
function isAbsolute(target) {
|
|
54177
|
-
return
|
|
54177
|
+
return import_node_path.default.isAbsolute(target);
|
|
54178
54178
|
}
|
|
54179
54179
|
function parse(target) {
|
|
54180
|
-
return
|
|
54180
|
+
return import_node_path.default.parse(target);
|
|
54181
54181
|
}
|
|
54182
54182
|
var posixify = (str) => str.replace(/\\/g, "/");
|
|
54183
54183
|
function importPath(target) {
|
|
54184
|
-
return ["win32", "win64"].includes(
|
|
54184
|
+
return ["win32", "win64"].includes(import_node_os.default.platform()) ? "file:///" + target : target;
|
|
54185
54185
|
}
|
|
54186
54186
|
|
|
54187
54187
|
// src/lib/fs.ts
|
|
@@ -54305,7 +54305,7 @@ async function rmdir(filepath) {
|
|
|
54305
54305
|
recursive: true
|
|
54306
54306
|
});
|
|
54307
54307
|
}
|
|
54308
|
-
return await (0,
|
|
54308
|
+
return await (0, import_node_util.promisify)(import_memfs.fs.rmdir)(filepath);
|
|
54309
54309
|
}
|
|
54310
54310
|
async function stat(filepath) {
|
|
54311
54311
|
if (!houdini_mode.is_testing) {
|
|
@@ -54383,18 +54383,18 @@ async function recursiveCopy(source, target, transforms, notRoot) {
|
|
|
54383
54383
|
}
|
|
54384
54384
|
}
|
|
54385
54385
|
async function glob(pattern) {
|
|
54386
|
-
return await (0,
|
|
54386
|
+
return await (0, import_node_util.promisify)(import_glob.glob)(posixify(pattern));
|
|
54387
54387
|
}
|
|
54388
54388
|
glob.hasMagic = import_glob.glob.hasMagic;
|
|
54389
54389
|
|
|
54390
54390
|
// src/lib/config.ts
|
|
54391
54391
|
var import_meta = {};
|
|
54392
|
-
var currentDir = global.__dirname || dirname((0,
|
|
54392
|
+
var currentDir = global.__dirname || dirname((0, import_node_url.fileURLToPath)(import_meta.url));
|
|
54393
54393
|
var DEFAULT_CONFIG_PATH = join(process.cwd(), "houdini.config.js");
|
|
54394
54394
|
|
|
54395
54395
|
// src/lib/graphql.ts
|
|
54396
|
-
var import_crypto = __toESM(require("crypto"), 1);
|
|
54397
54396
|
var graphql = __toESM(require_graphql2(), 1);
|
|
54397
|
+
var import_node_crypto = __toESM(require("node:crypto"), 1);
|
|
54398
54398
|
function getRootType(type) {
|
|
54399
54399
|
if (graphql.isNonNullType(type)) {
|
|
54400
54400
|
return getRootType(type.ofType);
|
|
@@ -54407,8 +54407,8 @@ function getRootType(type) {
|
|
|
54407
54407
|
function hashDocument({
|
|
54408
54408
|
document
|
|
54409
54409
|
}) {
|
|
54410
|
-
const docString = typeof document === "string" ? document :
|
|
54411
|
-
return
|
|
54410
|
+
const docString = typeof document === "string" ? document : document.artifact?.raw;
|
|
54411
|
+
return import_node_crypto.default.createHash("sha256").update(docString ?? "").digest("hex");
|
|
54412
54412
|
}
|
|
54413
54413
|
function parentTypeFromAncestors(schema, filepath, ancestors) {
|
|
54414
54414
|
const parents = [...ancestors];
|