houdini-react 1.2.44 → 1.2.46
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/plugin-cjs/index.js +871 -868
- package/build/plugin-esm/index.js +871 -868
- package/build/runtime/hooks/useDocumentHandle.d.ts +2 -0
- package/build/runtime/index.d.ts +1 -1
- package/build/runtime/routing/Router.d.ts +13 -1
- package/build/runtime-cjs/clientPlugin.js +1 -1
- package/build/runtime-cjs/hooks/useDocumentHandle.d.ts +2 -0
- package/build/runtime-cjs/hooks/useDocumentHandle.js +20 -5
- package/build/runtime-cjs/index.d.ts +1 -1
- package/build/runtime-cjs/index.js +2 -0
- package/build/runtime-cjs/routing/Router.d.ts +13 -1
- package/build/runtime-cjs/routing/Router.js +75 -19
- package/build/runtime-esm/clientPlugin.js +1 -1
- package/build/runtime-esm/hooks/useDocumentHandle.d.ts +2 -0
- package/build/runtime-esm/hooks/useDocumentHandle.js +21 -6
- package/build/runtime-esm/index.d.ts +1 -1
- package/build/runtime-esm/index.js +2 -1
- package/build/runtime-esm/routing/Router.d.ts +13 -1
- package/build/runtime-esm/routing/Router.js +73 -19
- package/package.json +4 -4
|
@@ -13146,12 +13146,12 @@ var require_comments2 = __commonJS({
|
|
|
13146
13146
|
comment.trailing = true;
|
|
13147
13147
|
addCommentHelper(node, comment);
|
|
13148
13148
|
}
|
|
13149
|
-
function printLeadingComment(commentPath,
|
|
13149
|
+
function printLeadingComment(commentPath, print6) {
|
|
13150
13150
|
var comment = commentPath.getValue();
|
|
13151
13151
|
n.Comment.assert(comment);
|
|
13152
13152
|
var loc = comment.loc;
|
|
13153
13153
|
var lines = loc && loc.lines;
|
|
13154
|
-
var parts = [
|
|
13154
|
+
var parts = [print6(commentPath)];
|
|
13155
13155
|
if (comment.trailing) {
|
|
13156
13156
|
parts.push("\n");
|
|
13157
13157
|
} else if (lines instanceof lines_1.Lines) {
|
|
@@ -13166,7 +13166,7 @@ var require_comments2 = __commonJS({
|
|
|
13166
13166
|
}
|
|
13167
13167
|
return (0, lines_1.concat)(parts);
|
|
13168
13168
|
}
|
|
13169
|
-
function printTrailingComment(commentPath,
|
|
13169
|
+
function printTrailingComment(commentPath, print6) {
|
|
13170
13170
|
var comment = commentPath.getValue(commentPath);
|
|
13171
13171
|
n.Comment.assert(comment);
|
|
13172
13172
|
var loc = comment.loc;
|
|
@@ -13181,12 +13181,12 @@ var require_comments2 = __commonJS({
|
|
|
13181
13181
|
parts.push(new Array(leadingSpace.length).join("\n"));
|
|
13182
13182
|
}
|
|
13183
13183
|
}
|
|
13184
|
-
parts.push(
|
|
13184
|
+
parts.push(print6(commentPath));
|
|
13185
13185
|
return (0, lines_1.concat)(parts);
|
|
13186
13186
|
}
|
|
13187
|
-
function printComments(path3,
|
|
13187
|
+
function printComments(path3, print6) {
|
|
13188
13188
|
var value = path3.getValue();
|
|
13189
|
-
var innerLines =
|
|
13189
|
+
var innerLines = print6(path3);
|
|
13190
13190
|
var comments = n.Node.check(value) && types4.getFieldValue(value, "comments");
|
|
13191
13191
|
if (!comments || comments.length === 0) {
|
|
13192
13192
|
return innerLines;
|
|
@@ -13198,9 +13198,9 @@ var require_comments2 = __commonJS({
|
|
|
13198
13198
|
var leading = types4.getFieldValue(comment, "leading");
|
|
13199
13199
|
var trailing = types4.getFieldValue(comment, "trailing");
|
|
13200
13200
|
if (leading || trailing && !(n.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
13201
|
-
leadingParts.push(printLeadingComment(commentPath,
|
|
13201
|
+
leadingParts.push(printLeadingComment(commentPath, print6));
|
|
13202
13202
|
} else if (trailing) {
|
|
13203
|
-
trailingParts.push(printTrailingComment(commentPath,
|
|
13203
|
+
trailingParts.push(printTrailingComment(commentPath, print6));
|
|
13204
13204
|
}
|
|
13205
13205
|
}, "comments");
|
|
13206
13206
|
leadingParts.push.apply(leadingParts, trailingParts);
|
|
@@ -13891,7 +13891,7 @@ var require_patcher2 = __commonJS({
|
|
|
13891
13891
|
};
|
|
13892
13892
|
exports.Patcher = Patcher;
|
|
13893
13893
|
var Pp = Patcher.prototype;
|
|
13894
|
-
Pp.tryToReprintComments = function(newNode, oldNode,
|
|
13894
|
+
Pp.tryToReprintComments = function(newNode, oldNode, print6) {
|
|
13895
13895
|
var patcher = this;
|
|
13896
13896
|
if (!newNode.comments && !oldNode.comments) {
|
|
13897
13897
|
return true;
|
|
@@ -13908,7 +13908,7 @@ var require_patcher2 = __commonJS({
|
|
|
13908
13908
|
assert_1.default.ok(oldComment.leading || oldComment.trailing);
|
|
13909
13909
|
patcher.replace(
|
|
13910
13910
|
oldComment.loc,
|
|
13911
|
-
|
|
13911
|
+
print6(reprint.newPath).indentTail(oldComment.loc.indent)
|
|
13912
13912
|
);
|
|
13913
13913
|
});
|
|
13914
13914
|
}
|
|
@@ -13955,17 +13955,17 @@ var require_patcher2 = __commonJS({
|
|
|
13955
13955
|
var reprints = [];
|
|
13956
13956
|
if (!lines || !findReprints(path3, reprints))
|
|
13957
13957
|
return;
|
|
13958
|
-
return function(
|
|
13958
|
+
return function(print6) {
|
|
13959
13959
|
var patcher = new Patcher(lines);
|
|
13960
13960
|
reprints.forEach(function(reprint) {
|
|
13961
13961
|
var newNode = reprint.newPath.getValue();
|
|
13962
13962
|
var oldNode = reprint.oldPath.getValue();
|
|
13963
13963
|
SourceLocation.assert(oldNode.loc, true);
|
|
13964
|
-
var needToPrintNewPathWithComments = !patcher.tryToReprintComments(newNode, oldNode,
|
|
13964
|
+
var needToPrintNewPathWithComments = !patcher.tryToReprintComments(newNode, oldNode, print6);
|
|
13965
13965
|
if (needToPrintNewPathWithComments) {
|
|
13966
13966
|
patcher.deleteComments(oldNode);
|
|
13967
13967
|
}
|
|
13968
|
-
var newLines =
|
|
13968
|
+
var newLines = print6(reprint.newPath, {
|
|
13969
13969
|
includeComments: needToPrintNewPathWithComments,
|
|
13970
13970
|
avoidRootParens: oldNode.type === newNode.type && reprint.oldPath.hasParens()
|
|
13971
13971
|
}).indentTail(oldNode.loc.indent);
|
|
@@ -14182,10 +14182,10 @@ var require_printer2 = __commonJS({
|
|
|
14182
14182
|
function makePrintFunctionWith(options, overrides) {
|
|
14183
14183
|
options = Object.assign({}, options, overrides);
|
|
14184
14184
|
return function(path3) {
|
|
14185
|
-
return
|
|
14185
|
+
return print6(path3, options);
|
|
14186
14186
|
};
|
|
14187
14187
|
}
|
|
14188
|
-
function
|
|
14188
|
+
function print6(path3, options) {
|
|
14189
14189
|
assert_1.default.ok(path3 instanceof fast_path_1.default);
|
|
14190
14190
|
options = options || {};
|
|
14191
14191
|
if (options.includeComments) {
|
|
@@ -14201,7 +14201,7 @@ var require_printer2 = __commonJS({
|
|
|
14201
14201
|
}
|
|
14202
14202
|
}
|
|
14203
14203
|
var reprinter = (0, patcher_1.getReprinter)(path3);
|
|
14204
|
-
var lines = reprinter ? reprinter(
|
|
14204
|
+
var lines = reprinter ? reprinter(print6) : genericPrint(path3, config, options, makePrintFunctionWith(options, {
|
|
14205
14205
|
includeComments: true,
|
|
14206
14206
|
avoidRootParens: false
|
|
14207
14207
|
}));
|
|
@@ -14212,7 +14212,7 @@ var require_printer2 = __commonJS({
|
|
|
14212
14212
|
if (!ast) {
|
|
14213
14213
|
return emptyPrintResult;
|
|
14214
14214
|
}
|
|
14215
|
-
var lines =
|
|
14215
|
+
var lines = print6(fast_path_1.default.from(ast), {
|
|
14216
14216
|
includeComments: true,
|
|
14217
14217
|
avoidRootParens: false
|
|
14218
14218
|
});
|
|
@@ -14265,7 +14265,7 @@ var require_printer2 = __commonJS({
|
|
|
14265
14265
|
}
|
|
14266
14266
|
return (0, lines_1.concat)(parts);
|
|
14267
14267
|
}
|
|
14268
|
-
function genericPrintNoParens(path3, options,
|
|
14268
|
+
function genericPrintNoParens(path3, options, print6) {
|
|
14269
14269
|
var n = path3.getValue();
|
|
14270
14270
|
if (!n) {
|
|
14271
14271
|
return (0, lines_1.fromString)("");
|
|
@@ -14277,45 +14277,45 @@ var require_printer2 = __commonJS({
|
|
|
14277
14277
|
var parts = [];
|
|
14278
14278
|
switch (n.type) {
|
|
14279
14279
|
case "File":
|
|
14280
|
-
return path3.call(
|
|
14280
|
+
return path3.call(print6, "program");
|
|
14281
14281
|
case "Program":
|
|
14282
14282
|
if (n.directives) {
|
|
14283
14283
|
path3.each(function(childPath) {
|
|
14284
|
-
parts.push(
|
|
14284
|
+
parts.push(print6(childPath), ";\n");
|
|
14285
14285
|
}, "directives");
|
|
14286
14286
|
}
|
|
14287
14287
|
if (n.interpreter) {
|
|
14288
|
-
parts.push(path3.call(
|
|
14288
|
+
parts.push(path3.call(print6, "interpreter"));
|
|
14289
14289
|
}
|
|
14290
14290
|
parts.push(path3.call(function(bodyPath) {
|
|
14291
|
-
return printStatementSequence(bodyPath, options,
|
|
14291
|
+
return printStatementSequence(bodyPath, options, print6);
|
|
14292
14292
|
}, "body"));
|
|
14293
14293
|
return (0, lines_1.concat)(parts);
|
|
14294
14294
|
case "Noop":
|
|
14295
14295
|
case "EmptyStatement":
|
|
14296
14296
|
return (0, lines_1.fromString)("");
|
|
14297
14297
|
case "ExpressionStatement":
|
|
14298
|
-
return (0, lines_1.concat)([path3.call(
|
|
14298
|
+
return (0, lines_1.concat)([path3.call(print6, "expression"), ";"]);
|
|
14299
14299
|
case "ParenthesizedExpression":
|
|
14300
|
-
return (0, lines_1.concat)(["(", path3.call(
|
|
14300
|
+
return (0, lines_1.concat)(["(", path3.call(print6, "expression"), ")"]);
|
|
14301
14301
|
case "BinaryExpression":
|
|
14302
14302
|
case "LogicalExpression":
|
|
14303
14303
|
case "AssignmentExpression":
|
|
14304
14304
|
return (0, lines_1.fromString)(" ").join([
|
|
14305
|
-
path3.call(
|
|
14305
|
+
path3.call(print6, "left"),
|
|
14306
14306
|
n.operator,
|
|
14307
|
-
path3.call(
|
|
14307
|
+
path3.call(print6, "right")
|
|
14308
14308
|
]);
|
|
14309
14309
|
case "AssignmentPattern":
|
|
14310
14310
|
return (0, lines_1.concat)([
|
|
14311
|
-
path3.call(
|
|
14311
|
+
path3.call(print6, "left"),
|
|
14312
14312
|
" = ",
|
|
14313
|
-
path3.call(
|
|
14313
|
+
path3.call(print6, "right")
|
|
14314
14314
|
]);
|
|
14315
14315
|
case "MemberExpression":
|
|
14316
14316
|
case "OptionalMemberExpression": {
|
|
14317
|
-
parts.push(path3.call(
|
|
14318
|
-
var property = path3.call(
|
|
14317
|
+
parts.push(path3.call(print6, "object"));
|
|
14318
|
+
var property = path3.call(print6, "property");
|
|
14319
14319
|
var optional = types4.getFieldValue(n, "optional");
|
|
14320
14320
|
if (n.computed) {
|
|
14321
14321
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
@@ -14325,18 +14325,18 @@ var require_printer2 = __commonJS({
|
|
|
14325
14325
|
return (0, lines_1.concat)(parts);
|
|
14326
14326
|
}
|
|
14327
14327
|
case "ChainExpression":
|
|
14328
|
-
return path3.call(
|
|
14328
|
+
return path3.call(print6, "expression");
|
|
14329
14329
|
case "MetaProperty":
|
|
14330
14330
|
return (0, lines_1.concat)([
|
|
14331
|
-
path3.call(
|
|
14331
|
+
path3.call(print6, "meta"),
|
|
14332
14332
|
".",
|
|
14333
|
-
path3.call(
|
|
14333
|
+
path3.call(print6, "property")
|
|
14334
14334
|
]);
|
|
14335
14335
|
case "BindExpression":
|
|
14336
14336
|
if (n.object) {
|
|
14337
|
-
parts.push(path3.call(
|
|
14337
|
+
parts.push(path3.call(print6, "object"));
|
|
14338
14338
|
}
|
|
14339
|
-
parts.push("::", path3.call(
|
|
14339
|
+
parts.push("::", path3.call(print6, "callee"));
|
|
14340
14340
|
return (0, lines_1.concat)(parts);
|
|
14341
14341
|
case "Path":
|
|
14342
14342
|
return (0, lines_1.fromString)(".").join(n.body);
|
|
@@ -14344,7 +14344,7 @@ var require_printer2 = __commonJS({
|
|
|
14344
14344
|
return (0, lines_1.concat)([
|
|
14345
14345
|
(0, lines_1.fromString)(n.name, options),
|
|
14346
14346
|
n.optional ? "?" : "",
|
|
14347
|
-
path3.call(
|
|
14347
|
+
path3.call(print6, "typeAnnotation")
|
|
14348
14348
|
]);
|
|
14349
14349
|
case "SpreadElement":
|
|
14350
14350
|
case "SpreadElementPattern":
|
|
@@ -14355,8 +14355,8 @@ var require_printer2 = __commonJS({
|
|
|
14355
14355
|
case "RestElement":
|
|
14356
14356
|
return (0, lines_1.concat)([
|
|
14357
14357
|
"...",
|
|
14358
|
-
path3.call(
|
|
14359
|
-
path3.call(
|
|
14358
|
+
path3.call(print6, "argument"),
|
|
14359
|
+
path3.call(print6, "typeAnnotation")
|
|
14360
14360
|
]);
|
|
14361
14361
|
case "FunctionDeclaration":
|
|
14362
14362
|
case "FunctionExpression":
|
|
@@ -14371,15 +14371,15 @@ var require_printer2 = __commonJS({
|
|
|
14371
14371
|
if (n.generator)
|
|
14372
14372
|
parts.push("*");
|
|
14373
14373
|
if (n.id) {
|
|
14374
|
-
parts.push(" ", path3.call(
|
|
14374
|
+
parts.push(" ", path3.call(print6, "id"), path3.call(print6, "typeParameters"));
|
|
14375
14375
|
} else {
|
|
14376
14376
|
if (n.typeParameters) {
|
|
14377
|
-
parts.push(path3.call(
|
|
14377
|
+
parts.push(path3.call(print6, "typeParameters"));
|
|
14378
14378
|
}
|
|
14379
14379
|
}
|
|
14380
|
-
parts.push("(", printFunctionParams(path3, options,
|
|
14380
|
+
parts.push("(", printFunctionParams(path3, options, print6), ")", path3.call(print6, "returnType"));
|
|
14381
14381
|
if (n.body) {
|
|
14382
|
-
parts.push(" ", path3.call(
|
|
14382
|
+
parts.push(" ", path3.call(print6, "body"));
|
|
14383
14383
|
}
|
|
14384
14384
|
return (0, lines_1.concat)(parts);
|
|
14385
14385
|
case "ArrowFunctionExpression":
|
|
@@ -14387,44 +14387,44 @@ var require_printer2 = __commonJS({
|
|
|
14387
14387
|
parts.push("async ");
|
|
14388
14388
|
}
|
|
14389
14389
|
if (n.typeParameters) {
|
|
14390
|
-
parts.push(path3.call(
|
|
14390
|
+
parts.push(path3.call(print6, "typeParameters"));
|
|
14391
14391
|
}
|
|
14392
14392
|
if (!options.arrowParensAlways && n.params.length === 1 && !n.rest && n.params[0].type === "Identifier" && !n.params[0].typeAnnotation && !n.returnType) {
|
|
14393
|
-
parts.push(path3.call(
|
|
14393
|
+
parts.push(path3.call(print6, "params", 0));
|
|
14394
14394
|
} else {
|
|
14395
|
-
parts.push("(", printFunctionParams(path3, options,
|
|
14395
|
+
parts.push("(", printFunctionParams(path3, options, print6), ")", path3.call(print6, "returnType"));
|
|
14396
14396
|
}
|
|
14397
|
-
parts.push(" => ", path3.call(
|
|
14397
|
+
parts.push(" => ", path3.call(print6, "body"));
|
|
14398
14398
|
return (0, lines_1.concat)(parts);
|
|
14399
14399
|
case "MethodDefinition":
|
|
14400
|
-
return printMethod(path3, options,
|
|
14400
|
+
return printMethod(path3, options, print6);
|
|
14401
14401
|
case "YieldExpression":
|
|
14402
14402
|
parts.push("yield");
|
|
14403
14403
|
if (n.delegate)
|
|
14404
14404
|
parts.push("*");
|
|
14405
14405
|
if (n.argument)
|
|
14406
|
-
parts.push(" ", path3.call(
|
|
14406
|
+
parts.push(" ", path3.call(print6, "argument"));
|
|
14407
14407
|
return (0, lines_1.concat)(parts);
|
|
14408
14408
|
case "AwaitExpression":
|
|
14409
14409
|
parts.push("await");
|
|
14410
14410
|
if (n.all)
|
|
14411
14411
|
parts.push("*");
|
|
14412
14412
|
if (n.argument)
|
|
14413
|
-
parts.push(" ", path3.call(
|
|
14413
|
+
parts.push(" ", path3.call(print6, "argument"));
|
|
14414
14414
|
return (0, lines_1.concat)(parts);
|
|
14415
14415
|
case "ModuleExpression":
|
|
14416
14416
|
return (0, lines_1.concat)([
|
|
14417
14417
|
"module {\n",
|
|
14418
|
-
path3.call(
|
|
14418
|
+
path3.call(print6, "body").indent(options.tabWidth),
|
|
14419
14419
|
"\n}"
|
|
14420
14420
|
]);
|
|
14421
14421
|
case "ModuleDeclaration":
|
|
14422
|
-
parts.push("module", path3.call(
|
|
14422
|
+
parts.push("module", path3.call(print6, "id"));
|
|
14423
14423
|
if (n.source) {
|
|
14424
14424
|
assert_1.default.ok(!n.body);
|
|
14425
|
-
parts.push("from", path3.call(
|
|
14425
|
+
parts.push("from", path3.call(print6, "source"));
|
|
14426
14426
|
} else {
|
|
14427
|
-
parts.push(path3.call(
|
|
14427
|
+
parts.push(path3.call(print6, "body"));
|
|
14428
14428
|
}
|
|
14429
14429
|
return (0, lines_1.fromString)(" ").join(parts);
|
|
14430
14430
|
case "ImportSpecifier":
|
|
@@ -14432,27 +14432,27 @@ var require_printer2 = __commonJS({
|
|
|
14432
14432
|
parts.push(n.importKind + " ");
|
|
14433
14433
|
}
|
|
14434
14434
|
if (n.imported) {
|
|
14435
|
-
parts.push(path3.call(
|
|
14435
|
+
parts.push(path3.call(print6, "imported"));
|
|
14436
14436
|
if (n.local && n.local.name !== n.imported.name) {
|
|
14437
|
-
parts.push(" as ", path3.call(
|
|
14437
|
+
parts.push(" as ", path3.call(print6, "local"));
|
|
14438
14438
|
}
|
|
14439
14439
|
} else if (n.id) {
|
|
14440
|
-
parts.push(path3.call(
|
|
14440
|
+
parts.push(path3.call(print6, "id"));
|
|
14441
14441
|
if (n.name) {
|
|
14442
|
-
parts.push(" as ", path3.call(
|
|
14442
|
+
parts.push(" as ", path3.call(print6, "name"));
|
|
14443
14443
|
}
|
|
14444
14444
|
}
|
|
14445
14445
|
return (0, lines_1.concat)(parts);
|
|
14446
14446
|
case "ExportSpecifier":
|
|
14447
14447
|
if (n.local) {
|
|
14448
|
-
parts.push(path3.call(
|
|
14448
|
+
parts.push(path3.call(print6, "local"));
|
|
14449
14449
|
if (n.exported && n.exported.name !== n.local.name) {
|
|
14450
|
-
parts.push(" as ", path3.call(
|
|
14450
|
+
parts.push(" as ", path3.call(print6, "exported"));
|
|
14451
14451
|
}
|
|
14452
14452
|
} else if (n.id) {
|
|
14453
|
-
parts.push(path3.call(
|
|
14453
|
+
parts.push(path3.call(print6, "id"));
|
|
14454
14454
|
if (n.name) {
|
|
14455
|
-
parts.push(" as ", path3.call(
|
|
14455
|
+
parts.push(" as ", path3.call(print6, "name"));
|
|
14456
14456
|
}
|
|
14457
14457
|
}
|
|
14458
14458
|
return (0, lines_1.concat)(parts);
|
|
@@ -14461,40 +14461,40 @@ var require_printer2 = __commonJS({
|
|
|
14461
14461
|
case "ImportNamespaceSpecifier":
|
|
14462
14462
|
parts.push("* as ");
|
|
14463
14463
|
if (n.local) {
|
|
14464
|
-
parts.push(path3.call(
|
|
14464
|
+
parts.push(path3.call(print6, "local"));
|
|
14465
14465
|
} else if (n.id) {
|
|
14466
|
-
parts.push(path3.call(
|
|
14466
|
+
parts.push(path3.call(print6, "id"));
|
|
14467
14467
|
}
|
|
14468
14468
|
return (0, lines_1.concat)(parts);
|
|
14469
14469
|
case "ImportDefaultSpecifier":
|
|
14470
14470
|
if (n.local) {
|
|
14471
|
-
return path3.call(
|
|
14471
|
+
return path3.call(print6, "local");
|
|
14472
14472
|
}
|
|
14473
|
-
return path3.call(
|
|
14473
|
+
return path3.call(print6, "id");
|
|
14474
14474
|
case "TSExportAssignment":
|
|
14475
|
-
return (0, lines_1.concat)(["export = ", path3.call(
|
|
14475
|
+
return (0, lines_1.concat)(["export = ", path3.call(print6, "expression")]);
|
|
14476
14476
|
case "ExportDeclaration":
|
|
14477
14477
|
case "ExportDefaultDeclaration":
|
|
14478
14478
|
case "ExportNamedDeclaration":
|
|
14479
|
-
return printExportDeclaration(path3, options,
|
|
14479
|
+
return printExportDeclaration(path3, options, print6);
|
|
14480
14480
|
case "ExportAllDeclaration":
|
|
14481
14481
|
parts.push("export *");
|
|
14482
14482
|
if (n.exported) {
|
|
14483
|
-
parts.push(" as ", path3.call(
|
|
14483
|
+
parts.push(" as ", path3.call(print6, "exported"));
|
|
14484
14484
|
}
|
|
14485
|
-
parts.push(" from ", path3.call(
|
|
14485
|
+
parts.push(" from ", path3.call(print6, "source"), ";");
|
|
14486
14486
|
return (0, lines_1.concat)(parts);
|
|
14487
14487
|
case "TSNamespaceExportDeclaration":
|
|
14488
|
-
parts.push("export as namespace ", path3.call(
|
|
14488
|
+
parts.push("export as namespace ", path3.call(print6, "id"));
|
|
14489
14489
|
return maybeAddSemicolon((0, lines_1.concat)(parts));
|
|
14490
14490
|
case "ExportNamespaceSpecifier":
|
|
14491
|
-
return (0, lines_1.concat)(["* as ", path3.call(
|
|
14491
|
+
return (0, lines_1.concat)(["* as ", path3.call(print6, "exported")]);
|
|
14492
14492
|
case "ExportDefaultSpecifier":
|
|
14493
|
-
return path3.call(
|
|
14493
|
+
return path3.call(print6, "exported");
|
|
14494
14494
|
case "Import":
|
|
14495
14495
|
return (0, lines_1.fromString)("import", options);
|
|
14496
14496
|
case "ImportExpression":
|
|
14497
|
-
return (0, lines_1.concat)(["import(", path3.call(
|
|
14497
|
+
return (0, lines_1.concat)(["import(", path3.call(print6, "source"), ")"]);
|
|
14498
14498
|
case "ImportDeclaration": {
|
|
14499
14499
|
parts.push("import ");
|
|
14500
14500
|
if (n.importKind && n.importKind !== "value") {
|
|
@@ -14506,9 +14506,9 @@ var require_printer2 = __commonJS({
|
|
|
14506
14506
|
path3.each(function(specifierPath) {
|
|
14507
14507
|
var spec = specifierPath.getValue();
|
|
14508
14508
|
if (spec.type === "ImportSpecifier") {
|
|
14509
|
-
bracedSpecifiers_1.push(
|
|
14509
|
+
bracedSpecifiers_1.push(print6(specifierPath));
|
|
14510
14510
|
} else if (spec.type === "ImportDefaultSpecifier" || spec.type === "ImportNamespaceSpecifier") {
|
|
14511
|
-
unbracedSpecifiers_1.push(
|
|
14511
|
+
unbracedSpecifiers_1.push(print6(specifierPath));
|
|
14512
14512
|
}
|
|
14513
14513
|
}, "specifiers");
|
|
14514
14514
|
unbracedSpecifiers_1.forEach(function(lines2, i2) {
|
|
@@ -14538,16 +14538,16 @@ var require_printer2 = __commonJS({
|
|
|
14538
14538
|
}
|
|
14539
14539
|
parts.push(" from ");
|
|
14540
14540
|
}
|
|
14541
|
-
parts.push(path3.call(
|
|
14541
|
+
parts.push(path3.call(print6, "source"), maybePrintImportAssertions(path3, options, print6), ";");
|
|
14542
14542
|
return (0, lines_1.concat)(parts);
|
|
14543
14543
|
}
|
|
14544
14544
|
case "ImportAttribute":
|
|
14545
|
-
return (0, lines_1.concat)([path3.call(
|
|
14545
|
+
return (0, lines_1.concat)([path3.call(print6, "key"), ": ", path3.call(print6, "value")]);
|
|
14546
14546
|
case "StaticBlock":
|
|
14547
14547
|
parts.push("static ");
|
|
14548
14548
|
case "BlockStatement": {
|
|
14549
14549
|
var naked_1 = path3.call(function(bodyPath) {
|
|
14550
|
-
return printStatementSequence(bodyPath, options,
|
|
14550
|
+
return printStatementSequence(bodyPath, options, print6);
|
|
14551
14551
|
}, "body");
|
|
14552
14552
|
if (naked_1.isEmpty()) {
|
|
14553
14553
|
if (!n.directives || n.directives.length === 0) {
|
|
@@ -14558,7 +14558,7 @@ var require_printer2 = __commonJS({
|
|
|
14558
14558
|
parts.push("{\n");
|
|
14559
14559
|
if (n.directives) {
|
|
14560
14560
|
path3.each(function(childPath) {
|
|
14561
|
-
parts.push(maybeAddSemicolon(
|
|
14561
|
+
parts.push(maybeAddSemicolon(print6(childPath).indent(options.tabWidth)), n.directives.length > 1 || !naked_1.isEmpty() ? "\n" : "");
|
|
14562
14562
|
}, "directives");
|
|
14563
14563
|
}
|
|
14564
14564
|
parts.push(naked_1.indent(options.tabWidth));
|
|
@@ -14568,7 +14568,7 @@ var require_printer2 = __commonJS({
|
|
|
14568
14568
|
case "ReturnStatement": {
|
|
14569
14569
|
parts.push("return");
|
|
14570
14570
|
if (n.argument) {
|
|
14571
|
-
var argLines = path3.call(
|
|
14571
|
+
var argLines = path3.call(print6, "argument");
|
|
14572
14572
|
if (argLines.startsWithComment() || argLines.length > 1 && namedTypes.JSXElement && namedTypes.JSXElement.check(n.argument)) {
|
|
14573
14573
|
parts.push(" (\n", argLines.indent(options.tabWidth), "\n)");
|
|
14574
14574
|
} else {
|
|
@@ -14580,17 +14580,17 @@ var require_printer2 = __commonJS({
|
|
|
14580
14580
|
}
|
|
14581
14581
|
case "CallExpression":
|
|
14582
14582
|
case "OptionalCallExpression":
|
|
14583
|
-
parts.push(path3.call(
|
|
14583
|
+
parts.push(path3.call(print6, "callee"));
|
|
14584
14584
|
if (n.typeParameters) {
|
|
14585
|
-
parts.push(path3.call(
|
|
14585
|
+
parts.push(path3.call(print6, "typeParameters"));
|
|
14586
14586
|
}
|
|
14587
14587
|
if (n.typeArguments) {
|
|
14588
|
-
parts.push(path3.call(
|
|
14588
|
+
parts.push(path3.call(print6, "typeArguments"));
|
|
14589
14589
|
}
|
|
14590
14590
|
if (types4.getFieldValue(n, "optional")) {
|
|
14591
14591
|
parts.push("?.");
|
|
14592
14592
|
}
|
|
14593
|
-
parts.push(printArgumentsList(path3, options,
|
|
14593
|
+
parts.push(printArgumentsList(path3, options, print6));
|
|
14594
14594
|
return (0, lines_1.concat)(parts);
|
|
14595
14595
|
case "RecordExpression":
|
|
14596
14596
|
parts.push("#");
|
|
@@ -14620,7 +14620,7 @@ var require_printer2 = __commonJS({
|
|
|
14620
14620
|
var i_1 = 0;
|
|
14621
14621
|
fields.forEach(function(field) {
|
|
14622
14622
|
path3.each(function(childPath) {
|
|
14623
|
-
var lines2 =
|
|
14623
|
+
var lines2 = print6(childPath);
|
|
14624
14624
|
if (!oneLine_1) {
|
|
14625
14625
|
lines2 = lines2.indent(options.tabWidth);
|
|
14626
14626
|
}
|
|
@@ -14657,32 +14657,32 @@ var require_printer2 = __commonJS({
|
|
|
14657
14657
|
parts[parts.length - 1] = " " + rightBrace;
|
|
14658
14658
|
}
|
|
14659
14659
|
if (n.typeAnnotation) {
|
|
14660
|
-
parts.push(path3.call(
|
|
14660
|
+
parts.push(path3.call(print6, "typeAnnotation"));
|
|
14661
14661
|
}
|
|
14662
14662
|
return (0, lines_1.concat)(parts);
|
|
14663
14663
|
}
|
|
14664
14664
|
case "PropertyPattern":
|
|
14665
14665
|
return (0, lines_1.concat)([
|
|
14666
|
-
path3.call(
|
|
14666
|
+
path3.call(print6, "key"),
|
|
14667
14667
|
": ",
|
|
14668
|
-
path3.call(
|
|
14668
|
+
path3.call(print6, "pattern")
|
|
14669
14669
|
]);
|
|
14670
14670
|
case "ObjectProperty":
|
|
14671
14671
|
case "Property": {
|
|
14672
14672
|
if (n.method || n.kind === "get" || n.kind === "set") {
|
|
14673
|
-
return printMethod(path3, options,
|
|
14673
|
+
return printMethod(path3, options, print6);
|
|
14674
14674
|
}
|
|
14675
14675
|
if (n.shorthand && n.value.type === "AssignmentPattern") {
|
|
14676
|
-
return path3.call(
|
|
14676
|
+
return path3.call(print6, "value");
|
|
14677
14677
|
}
|
|
14678
|
-
var key = path3.call(
|
|
14678
|
+
var key = path3.call(print6, "key");
|
|
14679
14679
|
if (n.computed) {
|
|
14680
14680
|
parts.push("[", key, "]");
|
|
14681
14681
|
} else {
|
|
14682
14682
|
parts.push(key);
|
|
14683
14683
|
}
|
|
14684
14684
|
if (!n.shorthand || n.key.name !== n.value.name) {
|
|
14685
|
-
parts.push(": ", path3.call(
|
|
14685
|
+
parts.push(": ", path3.call(print6, "value"));
|
|
14686
14686
|
}
|
|
14687
14687
|
return (0, lines_1.concat)(parts);
|
|
14688
14688
|
}
|
|
@@ -14690,18 +14690,18 @@ var require_printer2 = __commonJS({
|
|
|
14690
14690
|
case "ObjectMethod":
|
|
14691
14691
|
case "ClassPrivateMethod":
|
|
14692
14692
|
case "TSDeclareMethod":
|
|
14693
|
-
return printMethod(path3, options,
|
|
14693
|
+
return printMethod(path3, options, print6);
|
|
14694
14694
|
case "PrivateName":
|
|
14695
|
-
return (0, lines_1.concat)(["#", path3.call(
|
|
14695
|
+
return (0, lines_1.concat)(["#", path3.call(print6, "id")]);
|
|
14696
14696
|
case "Decorator":
|
|
14697
|
-
return (0, lines_1.concat)(["@", path3.call(
|
|
14697
|
+
return (0, lines_1.concat)(["@", path3.call(print6, "expression")]);
|
|
14698
14698
|
case "TupleExpression":
|
|
14699
14699
|
parts.push("#");
|
|
14700
14700
|
case "ArrayExpression":
|
|
14701
14701
|
case "ArrayPattern": {
|
|
14702
14702
|
var elems = n.elements;
|
|
14703
14703
|
var len_2 = elems.length;
|
|
14704
|
-
var printed_1 = path3.map(
|
|
14704
|
+
var printed_1 = path3.map(print6, "elements");
|
|
14705
14705
|
var joined = (0, lines_1.fromString)(", ").join(printed_1);
|
|
14706
14706
|
var oneLine_2 = joined.getLineLength(1) <= options.wrapColumn;
|
|
14707
14707
|
if (oneLine_2) {
|
|
@@ -14739,12 +14739,12 @@ var require_printer2 = __commonJS({
|
|
|
14739
14739
|
parts.push("]");
|
|
14740
14740
|
}
|
|
14741
14741
|
if (n.typeAnnotation) {
|
|
14742
|
-
parts.push(path3.call(
|
|
14742
|
+
parts.push(path3.call(print6, "typeAnnotation"));
|
|
14743
14743
|
}
|
|
14744
14744
|
return (0, lines_1.concat)(parts);
|
|
14745
14745
|
}
|
|
14746
14746
|
case "SequenceExpression":
|
|
14747
|
-
return (0, lines_1.fromString)(", ").join(path3.map(
|
|
14747
|
+
return (0, lines_1.fromString)(", ").join(path3.map(print6, "expressions"));
|
|
14748
14748
|
case "ThisExpression":
|
|
14749
14749
|
return (0, lines_1.fromString)("this");
|
|
14750
14750
|
case "Super":
|
|
@@ -14765,7 +14765,7 @@ var require_printer2 = __commonJS({
|
|
|
14765
14765
|
case "Literal":
|
|
14766
14766
|
return (0, lines_1.fromString)(getPossibleRaw(n) || (typeof n.value === "string" ? nodeStr(n.value, options) : n.value), options);
|
|
14767
14767
|
case "Directive":
|
|
14768
|
-
return path3.call(
|
|
14768
|
+
return path3.call(print6, "value");
|
|
14769
14769
|
case "DirectiveLiteral":
|
|
14770
14770
|
return (0, lines_1.fromString)(getPossibleRaw(n) || nodeStr(n.value, options), options);
|
|
14771
14771
|
case "InterpreterDirective":
|
|
@@ -14779,32 +14779,32 @@ var require_printer2 = __commonJS({
|
|
|
14779
14779
|
parts.push(n.operator);
|
|
14780
14780
|
if (/[a-z]$/.test(n.operator))
|
|
14781
14781
|
parts.push(" ");
|
|
14782
|
-
parts.push(path3.call(
|
|
14782
|
+
parts.push(path3.call(print6, "argument"));
|
|
14783
14783
|
return (0, lines_1.concat)(parts);
|
|
14784
14784
|
case "UpdateExpression":
|
|
14785
|
-
parts.push(path3.call(
|
|
14785
|
+
parts.push(path3.call(print6, "argument"), n.operator);
|
|
14786
14786
|
if (n.prefix)
|
|
14787
14787
|
parts.reverse();
|
|
14788
14788
|
return (0, lines_1.concat)(parts);
|
|
14789
14789
|
case "ConditionalExpression":
|
|
14790
14790
|
return (0, lines_1.concat)([
|
|
14791
|
-
path3.call(
|
|
14791
|
+
path3.call(print6, "test"),
|
|
14792
14792
|
" ? ",
|
|
14793
|
-
path3.call(
|
|
14793
|
+
path3.call(print6, "consequent"),
|
|
14794
14794
|
" : ",
|
|
14795
|
-
path3.call(
|
|
14795
|
+
path3.call(print6, "alternate")
|
|
14796
14796
|
]);
|
|
14797
14797
|
case "NewExpression": {
|
|
14798
|
-
parts.push("new ", path3.call(
|
|
14798
|
+
parts.push("new ", path3.call(print6, "callee"));
|
|
14799
14799
|
if (n.typeParameters) {
|
|
14800
|
-
parts.push(path3.call(
|
|
14800
|
+
parts.push(path3.call(print6, "typeParameters"));
|
|
14801
14801
|
}
|
|
14802
14802
|
if (n.typeArguments) {
|
|
14803
|
-
parts.push(path3.call(
|
|
14803
|
+
parts.push(path3.call(print6, "typeArguments"));
|
|
14804
14804
|
}
|
|
14805
14805
|
var args = n.arguments;
|
|
14806
14806
|
if (args) {
|
|
14807
|
-
parts.push(printArgumentsList(path3, options,
|
|
14807
|
+
parts.push(printArgumentsList(path3, options, print6));
|
|
14808
14808
|
}
|
|
14809
14809
|
return (0, lines_1.concat)(parts);
|
|
14810
14810
|
}
|
|
@@ -14815,7 +14815,7 @@ var require_printer2 = __commonJS({
|
|
|
14815
14815
|
parts.push(n.kind, " ");
|
|
14816
14816
|
var maxLen_1 = 0;
|
|
14817
14817
|
var printed = path3.map(function(childPath) {
|
|
14818
|
-
var lines2 =
|
|
14818
|
+
var lines2 = print6(childPath);
|
|
14819
14819
|
maxLen_1 = Math.max(lines2.length, maxLen_1);
|
|
14820
14820
|
return lines2;
|
|
14821
14821
|
}, "declarations");
|
|
@@ -14834,30 +14834,30 @@ var require_printer2 = __commonJS({
|
|
|
14834
14834
|
}
|
|
14835
14835
|
case "VariableDeclarator":
|
|
14836
14836
|
return n.init ? (0, lines_1.fromString)(" = ").join([
|
|
14837
|
-
path3.call(
|
|
14838
|
-
path3.call(
|
|
14839
|
-
]) : path3.call(
|
|
14837
|
+
path3.call(print6, "id"),
|
|
14838
|
+
path3.call(print6, "init")
|
|
14839
|
+
]) : path3.call(print6, "id");
|
|
14840
14840
|
case "WithStatement":
|
|
14841
14841
|
return (0, lines_1.concat)([
|
|
14842
14842
|
"with (",
|
|
14843
|
-
path3.call(
|
|
14843
|
+
path3.call(print6, "object"),
|
|
14844
14844
|
") ",
|
|
14845
|
-
path3.call(
|
|
14845
|
+
path3.call(print6, "body")
|
|
14846
14846
|
]);
|
|
14847
14847
|
case "IfStatement": {
|
|
14848
|
-
var con = adjustClause(path3.call(
|
|
14849
|
-
parts.push("if (", path3.call(
|
|
14848
|
+
var con = adjustClause(path3.call(print6, "consequent"), options);
|
|
14849
|
+
parts.push("if (", path3.call(print6, "test"), ")", con);
|
|
14850
14850
|
if (n.alternate)
|
|
14851
|
-
parts.push(endsWithBrace(con) ? " else" : "\nelse", adjustClause(path3.call(
|
|
14851
|
+
parts.push(endsWithBrace(con) ? " else" : "\nelse", adjustClause(path3.call(print6, "alternate"), options));
|
|
14852
14852
|
return (0, lines_1.concat)(parts);
|
|
14853
14853
|
}
|
|
14854
14854
|
case "ForStatement": {
|
|
14855
|
-
var init = path3.call(
|
|
14855
|
+
var init = path3.call(print6, "init");
|
|
14856
14856
|
var sep2 = init.length > 1 ? ";\n" : "; ";
|
|
14857
14857
|
var forParen = "for (";
|
|
14858
|
-
var indented = (0, lines_1.fromString)(sep2).join([init, path3.call(
|
|
14858
|
+
var indented = (0, lines_1.fromString)(sep2).join([init, path3.call(print6, "test"), path3.call(print6, "update")]).indentTail(forParen.length);
|
|
14859
14859
|
var head = (0, lines_1.concat)([forParen, indented, ")"]);
|
|
14860
|
-
var clause = adjustClause(path3.call(
|
|
14860
|
+
var clause = adjustClause(path3.call(print6, "body"), options);
|
|
14861
14861
|
parts.push(head);
|
|
14862
14862
|
if (head.length > 1) {
|
|
14863
14863
|
parts.push("\n");
|
|
@@ -14869,18 +14869,18 @@ var require_printer2 = __commonJS({
|
|
|
14869
14869
|
case "WhileStatement":
|
|
14870
14870
|
return (0, lines_1.concat)([
|
|
14871
14871
|
"while (",
|
|
14872
|
-
path3.call(
|
|
14872
|
+
path3.call(print6, "test"),
|
|
14873
14873
|
")",
|
|
14874
|
-
adjustClause(path3.call(
|
|
14874
|
+
adjustClause(path3.call(print6, "body"), options)
|
|
14875
14875
|
]);
|
|
14876
14876
|
case "ForInStatement":
|
|
14877
14877
|
return (0, lines_1.concat)([
|
|
14878
14878
|
n.each ? "for each (" : "for (",
|
|
14879
|
-
path3.call(
|
|
14879
|
+
path3.call(print6, "left"),
|
|
14880
14880
|
" in ",
|
|
14881
|
-
path3.call(
|
|
14881
|
+
path3.call(print6, "right"),
|
|
14882
14882
|
")",
|
|
14883
|
-
adjustClause(path3.call(
|
|
14883
|
+
adjustClause(path3.call(print6, "body"), options)
|
|
14884
14884
|
]);
|
|
14885
14885
|
case "ForOfStatement":
|
|
14886
14886
|
case "ForAwaitStatement":
|
|
@@ -14888,122 +14888,122 @@ var require_printer2 = __commonJS({
|
|
|
14888
14888
|
if (n.await || n.type === "ForAwaitStatement") {
|
|
14889
14889
|
parts.push("await ");
|
|
14890
14890
|
}
|
|
14891
|
-
parts.push("(", path3.call(
|
|
14891
|
+
parts.push("(", path3.call(print6, "left"), " of ", path3.call(print6, "right"), ")", adjustClause(path3.call(print6, "body"), options));
|
|
14892
14892
|
return (0, lines_1.concat)(parts);
|
|
14893
14893
|
case "DoWhileStatement": {
|
|
14894
14894
|
var doBody = (0, lines_1.concat)([
|
|
14895
14895
|
"do",
|
|
14896
|
-
adjustClause(path3.call(
|
|
14896
|
+
adjustClause(path3.call(print6, "body"), options)
|
|
14897
14897
|
]);
|
|
14898
14898
|
parts.push(doBody);
|
|
14899
14899
|
if (endsWithBrace(doBody))
|
|
14900
14900
|
parts.push(" while");
|
|
14901
14901
|
else
|
|
14902
14902
|
parts.push("\nwhile");
|
|
14903
|
-
parts.push(" (", path3.call(
|
|
14903
|
+
parts.push(" (", path3.call(print6, "test"), ");");
|
|
14904
14904
|
return (0, lines_1.concat)(parts);
|
|
14905
14905
|
}
|
|
14906
14906
|
case "DoExpression": {
|
|
14907
14907
|
var statements = path3.call(function(bodyPath) {
|
|
14908
|
-
return printStatementSequence(bodyPath, options,
|
|
14908
|
+
return printStatementSequence(bodyPath, options, print6);
|
|
14909
14909
|
}, "body");
|
|
14910
14910
|
return (0, lines_1.concat)(["do {\n", statements.indent(options.tabWidth), "\n}"]);
|
|
14911
14911
|
}
|
|
14912
14912
|
case "BreakStatement":
|
|
14913
14913
|
parts.push("break");
|
|
14914
14914
|
if (n.label)
|
|
14915
|
-
parts.push(" ", path3.call(
|
|
14915
|
+
parts.push(" ", path3.call(print6, "label"));
|
|
14916
14916
|
parts.push(";");
|
|
14917
14917
|
return (0, lines_1.concat)(parts);
|
|
14918
14918
|
case "ContinueStatement":
|
|
14919
14919
|
parts.push("continue");
|
|
14920
14920
|
if (n.label)
|
|
14921
|
-
parts.push(" ", path3.call(
|
|
14921
|
+
parts.push(" ", path3.call(print6, "label"));
|
|
14922
14922
|
parts.push(";");
|
|
14923
14923
|
return (0, lines_1.concat)(parts);
|
|
14924
14924
|
case "LabeledStatement":
|
|
14925
14925
|
return (0, lines_1.concat)([
|
|
14926
|
-
path3.call(
|
|
14926
|
+
path3.call(print6, "label"),
|
|
14927
14927
|
":\n",
|
|
14928
|
-
path3.call(
|
|
14928
|
+
path3.call(print6, "body")
|
|
14929
14929
|
]);
|
|
14930
14930
|
case "TryStatement":
|
|
14931
|
-
parts.push("try ", path3.call(
|
|
14931
|
+
parts.push("try ", path3.call(print6, "block"));
|
|
14932
14932
|
if (n.handler) {
|
|
14933
|
-
parts.push(" ", path3.call(
|
|
14933
|
+
parts.push(" ", path3.call(print6, "handler"));
|
|
14934
14934
|
} else if (n.handlers) {
|
|
14935
14935
|
path3.each(function(handlerPath) {
|
|
14936
|
-
parts.push(" ",
|
|
14936
|
+
parts.push(" ", print6(handlerPath));
|
|
14937
14937
|
}, "handlers");
|
|
14938
14938
|
}
|
|
14939
14939
|
if (n.finalizer) {
|
|
14940
|
-
parts.push(" finally ", path3.call(
|
|
14940
|
+
parts.push(" finally ", path3.call(print6, "finalizer"));
|
|
14941
14941
|
}
|
|
14942
14942
|
return (0, lines_1.concat)(parts);
|
|
14943
14943
|
case "CatchClause":
|
|
14944
14944
|
parts.push("catch ");
|
|
14945
14945
|
if (n.param) {
|
|
14946
|
-
parts.push("(", path3.call(
|
|
14946
|
+
parts.push("(", path3.call(print6, "param"));
|
|
14947
14947
|
}
|
|
14948
14948
|
if (n.guard) {
|
|
14949
|
-
parts.push(" if ", path3.call(
|
|
14949
|
+
parts.push(" if ", path3.call(print6, "guard"));
|
|
14950
14950
|
}
|
|
14951
14951
|
if (n.param) {
|
|
14952
14952
|
parts.push(") ");
|
|
14953
14953
|
}
|
|
14954
|
-
parts.push(path3.call(
|
|
14954
|
+
parts.push(path3.call(print6, "body"));
|
|
14955
14955
|
return (0, lines_1.concat)(parts);
|
|
14956
14956
|
case "ThrowStatement":
|
|
14957
|
-
return (0, lines_1.concat)(["throw ", path3.call(
|
|
14957
|
+
return (0, lines_1.concat)(["throw ", path3.call(print6, "argument"), ";"]);
|
|
14958
14958
|
case "SwitchStatement":
|
|
14959
14959
|
return (0, lines_1.concat)([
|
|
14960
14960
|
"switch (",
|
|
14961
|
-
path3.call(
|
|
14961
|
+
path3.call(print6, "discriminant"),
|
|
14962
14962
|
") {\n",
|
|
14963
|
-
(0, lines_1.fromString)("\n").join(path3.map(
|
|
14963
|
+
(0, lines_1.fromString)("\n").join(path3.map(print6, "cases")),
|
|
14964
14964
|
"\n}"
|
|
14965
14965
|
]);
|
|
14966
14966
|
case "SwitchCase":
|
|
14967
14967
|
if (n.test)
|
|
14968
|
-
parts.push("case ", path3.call(
|
|
14968
|
+
parts.push("case ", path3.call(print6, "test"), ":");
|
|
14969
14969
|
else
|
|
14970
14970
|
parts.push("default:");
|
|
14971
14971
|
if (n.consequent.length > 0) {
|
|
14972
14972
|
parts.push("\n", path3.call(function(consequentPath) {
|
|
14973
|
-
return printStatementSequence(consequentPath, options,
|
|
14973
|
+
return printStatementSequence(consequentPath, options, print6);
|
|
14974
14974
|
}, "consequent").indent(options.tabWidth));
|
|
14975
14975
|
}
|
|
14976
14976
|
return (0, lines_1.concat)(parts);
|
|
14977
14977
|
case "DebuggerStatement":
|
|
14978
14978
|
return (0, lines_1.fromString)("debugger;");
|
|
14979
14979
|
case "JSXAttribute":
|
|
14980
|
-
parts.push(path3.call(
|
|
14980
|
+
parts.push(path3.call(print6, "name"));
|
|
14981
14981
|
if (n.value)
|
|
14982
|
-
parts.push("=", path3.call(
|
|
14982
|
+
parts.push("=", path3.call(print6, "value"));
|
|
14983
14983
|
return (0, lines_1.concat)(parts);
|
|
14984
14984
|
case "JSXIdentifier":
|
|
14985
14985
|
return (0, lines_1.fromString)(n.name, options);
|
|
14986
14986
|
case "JSXNamespacedName":
|
|
14987
14987
|
return (0, lines_1.fromString)(":").join([
|
|
14988
|
-
path3.call(
|
|
14989
|
-
path3.call(
|
|
14988
|
+
path3.call(print6, "namespace"),
|
|
14989
|
+
path3.call(print6, "name")
|
|
14990
14990
|
]);
|
|
14991
14991
|
case "JSXMemberExpression":
|
|
14992
14992
|
return (0, lines_1.fromString)(".").join([
|
|
14993
|
-
path3.call(
|
|
14994
|
-
path3.call(
|
|
14993
|
+
path3.call(print6, "object"),
|
|
14994
|
+
path3.call(print6, "property")
|
|
14995
14995
|
]);
|
|
14996
14996
|
case "JSXSpreadAttribute":
|
|
14997
|
-
return (0, lines_1.concat)(["{...", path3.call(
|
|
14997
|
+
return (0, lines_1.concat)(["{...", path3.call(print6, "argument"), "}"]);
|
|
14998
14998
|
case "JSXSpreadChild":
|
|
14999
|
-
return (0, lines_1.concat)(["{...", path3.call(
|
|
14999
|
+
return (0, lines_1.concat)(["{...", path3.call(print6, "expression"), "}"]);
|
|
15000
15000
|
case "JSXExpressionContainer":
|
|
15001
|
-
return (0, lines_1.concat)(["{", path3.call(
|
|
15001
|
+
return (0, lines_1.concat)(["{", path3.call(print6, "expression"), "}"]);
|
|
15002
15002
|
case "JSXElement":
|
|
15003
15003
|
case "JSXFragment": {
|
|
15004
15004
|
var openingPropName = "opening" + (n.type === "JSXElement" ? "Element" : "Fragment");
|
|
15005
15005
|
var closingPropName = "closing" + (n.type === "JSXElement" ? "Element" : "Fragment");
|
|
15006
|
-
var openingLines = path3.call(
|
|
15006
|
+
var openingLines = path3.call(print6, openingPropName);
|
|
15007
15007
|
if (n[openingPropName].selfClosing) {
|
|
15008
15008
|
assert_1.default.ok(!n[closingPropName], "unexpected " + closingPropName + " element in self-closing " + n.type);
|
|
15009
15009
|
return openingLines;
|
|
@@ -15017,16 +15017,16 @@ var require_printer2 = __commonJS({
|
|
|
15017
15017
|
return "\n";
|
|
15018
15018
|
}
|
|
15019
15019
|
}
|
|
15020
|
-
return
|
|
15020
|
+
return print6(childPath);
|
|
15021
15021
|
}, "children")).indentTail(options.tabWidth);
|
|
15022
|
-
var closingLines = path3.call(
|
|
15022
|
+
var closingLines = path3.call(print6, closingPropName);
|
|
15023
15023
|
return (0, lines_1.concat)([openingLines, childLines, closingLines]);
|
|
15024
15024
|
}
|
|
15025
15025
|
case "JSXOpeningElement": {
|
|
15026
|
-
parts.push("<", path3.call(
|
|
15026
|
+
parts.push("<", path3.call(print6, "name"));
|
|
15027
15027
|
var attrParts_1 = [];
|
|
15028
15028
|
path3.each(function(attrPath) {
|
|
15029
|
-
attrParts_1.push(" ",
|
|
15029
|
+
attrParts_1.push(" ", print6(attrPath));
|
|
15030
15030
|
}, "attributes");
|
|
15031
15031
|
var attrLines = (0, lines_1.concat)(attrParts_1);
|
|
15032
15032
|
var needLineWrap = attrLines.length > 1 || attrLines.getLineLength(1) > options.wrapColumn;
|
|
@@ -15043,7 +15043,7 @@ var require_printer2 = __commonJS({
|
|
|
15043
15043
|
return (0, lines_1.concat)(parts);
|
|
15044
15044
|
}
|
|
15045
15045
|
case "JSXClosingElement":
|
|
15046
|
-
return (0, lines_1.concat)(["</", path3.call(
|
|
15046
|
+
return (0, lines_1.concat)(["</", path3.call(print6, "name"), ">"]);
|
|
15047
15047
|
case "JSXOpeningFragment":
|
|
15048
15048
|
return (0, lines_1.fromString)("<>");
|
|
15049
15049
|
case "JSXClosingFragment":
|
|
@@ -15054,9 +15054,9 @@ var require_printer2 = __commonJS({
|
|
|
15054
15054
|
return (0, lines_1.fromString)("");
|
|
15055
15055
|
case "TypeAnnotatedIdentifier":
|
|
15056
15056
|
return (0, lines_1.concat)([
|
|
15057
|
-
path3.call(
|
|
15057
|
+
path3.call(print6, "annotation"),
|
|
15058
15058
|
" ",
|
|
15059
|
-
path3.call(
|
|
15059
|
+
path3.call(print6, "identifier")
|
|
15060
15060
|
]);
|
|
15061
15061
|
case "ClassBody":
|
|
15062
15062
|
if (n.body.length === 0) {
|
|
@@ -15065,12 +15065,12 @@ var require_printer2 = __commonJS({
|
|
|
15065
15065
|
return (0, lines_1.concat)([
|
|
15066
15066
|
"{\n",
|
|
15067
15067
|
path3.call(function(bodyPath) {
|
|
15068
|
-
return printStatementSequence(bodyPath, options,
|
|
15068
|
+
return printStatementSequence(bodyPath, options, print6);
|
|
15069
15069
|
}, "body").indent(options.tabWidth),
|
|
15070
15070
|
"\n}"
|
|
15071
15071
|
]);
|
|
15072
15072
|
case "ClassPropertyDefinition":
|
|
15073
|
-
parts.push("static ", path3.call(
|
|
15073
|
+
parts.push("static ", path3.call(print6, "definition"));
|
|
15074
15074
|
if (!namedTypes.MethodDefinition.check(n.definition))
|
|
15075
15075
|
parts.push(";");
|
|
15076
15076
|
return (0, lines_1.concat)(parts);
|
|
@@ -15091,12 +15091,12 @@ var require_printer2 = __commonJS({
|
|
|
15091
15091
|
if (n.readonly) {
|
|
15092
15092
|
parts.push("readonly ");
|
|
15093
15093
|
}
|
|
15094
|
-
var key = path3.call(
|
|
15094
|
+
var key = path3.call(print6, "key");
|
|
15095
15095
|
if (n.computed) {
|
|
15096
15096
|
key = (0, lines_1.concat)(["[", key, "]"]);
|
|
15097
15097
|
}
|
|
15098
15098
|
if (n.variance) {
|
|
15099
|
-
key = (0, lines_1.concat)([printVariance(path3,
|
|
15099
|
+
key = (0, lines_1.concat)([printVariance(path3, print6), key]);
|
|
15100
15100
|
}
|
|
15101
15101
|
parts.push(key);
|
|
15102
15102
|
if (n.optional) {
|
|
@@ -15106,10 +15106,10 @@ var require_printer2 = __commonJS({
|
|
|
15106
15106
|
parts.push("!");
|
|
15107
15107
|
}
|
|
15108
15108
|
if (n.typeAnnotation) {
|
|
15109
|
-
parts.push(path3.call(
|
|
15109
|
+
parts.push(path3.call(print6, "typeAnnotation"));
|
|
15110
15110
|
}
|
|
15111
15111
|
if (n.value) {
|
|
15112
|
-
parts.push(" = ", path3.call(
|
|
15112
|
+
parts.push(" = ", path3.call(print6, "value"));
|
|
15113
15113
|
}
|
|
15114
15114
|
parts.push(";");
|
|
15115
15115
|
return (0, lines_1.concat)(parts);
|
|
@@ -15118,21 +15118,21 @@ var require_printer2 = __commonJS({
|
|
|
15118
15118
|
if (n.static) {
|
|
15119
15119
|
parts.push("static ");
|
|
15120
15120
|
}
|
|
15121
|
-
parts.push(path3.call(
|
|
15121
|
+
parts.push(path3.call(print6, "key"));
|
|
15122
15122
|
if (n.typeAnnotation) {
|
|
15123
|
-
parts.push(path3.call(
|
|
15123
|
+
parts.push(path3.call(print6, "typeAnnotation"));
|
|
15124
15124
|
}
|
|
15125
15125
|
if (n.value) {
|
|
15126
|
-
parts.push(" = ", path3.call(
|
|
15126
|
+
parts.push(" = ", path3.call(print6, "value"));
|
|
15127
15127
|
}
|
|
15128
15128
|
parts.push(";");
|
|
15129
15129
|
return (0, lines_1.concat)(parts);
|
|
15130
15130
|
case "ClassAccessorProperty": {
|
|
15131
15131
|
parts.push.apply(parts, tslib_1.__spreadArray(tslib_1.__spreadArray([], printClassMemberModifiers(n), false), ["accessor "], false));
|
|
15132
15132
|
if (n.computed) {
|
|
15133
|
-
parts.push("[", path3.call(
|
|
15133
|
+
parts.push("[", path3.call(print6, "key"), "]");
|
|
15134
15134
|
} else {
|
|
15135
|
-
parts.push(path3.call(
|
|
15135
|
+
parts.push(path3.call(print6, "key"));
|
|
15136
15136
|
}
|
|
15137
15137
|
if (n.optional) {
|
|
15138
15138
|
parts.push("?");
|
|
@@ -15141,10 +15141,10 @@ var require_printer2 = __commonJS({
|
|
|
15141
15141
|
parts.push("!");
|
|
15142
15142
|
}
|
|
15143
15143
|
if (n.typeAnnotation) {
|
|
15144
|
-
parts.push(path3.call(
|
|
15144
|
+
parts.push(path3.call(print6, "typeAnnotation"));
|
|
15145
15145
|
}
|
|
15146
15146
|
if (n.value) {
|
|
15147
|
-
parts.push(" = ", path3.call(
|
|
15147
|
+
parts.push(" = ", path3.call(print6, "value"));
|
|
15148
15148
|
}
|
|
15149
15149
|
parts.push(";");
|
|
15150
15150
|
return (0, lines_1.concat)(parts);
|
|
@@ -15160,21 +15160,21 @@ var require_printer2 = __commonJS({
|
|
|
15160
15160
|
}
|
|
15161
15161
|
parts.push("class");
|
|
15162
15162
|
if (n.id) {
|
|
15163
|
-
parts.push(" ", path3.call(
|
|
15163
|
+
parts.push(" ", path3.call(print6, "id"));
|
|
15164
15164
|
}
|
|
15165
15165
|
if (n.typeParameters) {
|
|
15166
|
-
parts.push(path3.call(
|
|
15166
|
+
parts.push(path3.call(print6, "typeParameters"));
|
|
15167
15167
|
}
|
|
15168
15168
|
if (n.superClass) {
|
|
15169
|
-
parts.push(" extends ", path3.call(
|
|
15169
|
+
parts.push(" extends ", path3.call(print6, "superClass"), path3.call(print6, "superTypeParameters"));
|
|
15170
15170
|
}
|
|
15171
15171
|
if (n.extends && n.extends.length > 0) {
|
|
15172
|
-
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path3.map(
|
|
15172
|
+
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path3.map(print6, "extends")));
|
|
15173
15173
|
}
|
|
15174
15174
|
if (n["implements"] && n["implements"].length > 0) {
|
|
15175
|
-
parts.push(" implements ", (0, lines_1.fromString)(", ").join(path3.map(
|
|
15175
|
+
parts.push(" implements ", (0, lines_1.fromString)(", ").join(path3.map(print6, "implements")));
|
|
15176
15176
|
}
|
|
15177
|
-
parts.push(" ", path3.call(
|
|
15177
|
+
parts.push(" ", path3.call(print6, "body"));
|
|
15178
15178
|
if (n.type === "DeclareClass") {
|
|
15179
15179
|
return printFlowDeclaration(path3, parts);
|
|
15180
15180
|
} else {
|
|
@@ -15183,11 +15183,11 @@ var require_printer2 = __commonJS({
|
|
|
15183
15183
|
case "TemplateElement":
|
|
15184
15184
|
return (0, lines_1.fromString)(n.value.raw, options).lockIndentTail();
|
|
15185
15185
|
case "TemplateLiteral": {
|
|
15186
|
-
var expressions_1 = path3.map(
|
|
15186
|
+
var expressions_1 = path3.map(print6, "expressions");
|
|
15187
15187
|
parts.push("`");
|
|
15188
15188
|
path3.each(function(childPath) {
|
|
15189
15189
|
var i2 = childPath.getName();
|
|
15190
|
-
parts.push(
|
|
15190
|
+
parts.push(print6(childPath));
|
|
15191
15191
|
if (i2 < expressions_1.length) {
|
|
15192
15192
|
parts.push("${", expressions_1[i2], "}");
|
|
15193
15193
|
}
|
|
@@ -15196,7 +15196,7 @@ var require_printer2 = __commonJS({
|
|
|
15196
15196
|
return (0, lines_1.concat)(parts).lockIndentTail();
|
|
15197
15197
|
}
|
|
15198
15198
|
case "TaggedTemplateExpression":
|
|
15199
|
-
return (0, lines_1.concat)([path3.call(
|
|
15199
|
+
return (0, lines_1.concat)([path3.call(print6, "tag"), path3.call(print6, "quasi")]);
|
|
15200
15200
|
case "Node":
|
|
15201
15201
|
case "Printable":
|
|
15202
15202
|
case "SourceLocation":
|
|
@@ -15230,7 +15230,7 @@ var require_printer2 = __commonJS({
|
|
|
15230
15230
|
if (n.typeAnnotation.type !== "FunctionTypeAnnotation") {
|
|
15231
15231
|
parts.push(": ");
|
|
15232
15232
|
}
|
|
15233
|
-
parts.push(path3.call(
|
|
15233
|
+
parts.push(path3.call(print6, "typeAnnotation"));
|
|
15234
15234
|
return (0, lines_1.concat)(parts);
|
|
15235
15235
|
}
|
|
15236
15236
|
return (0, lines_1.fromString)("");
|
|
@@ -15244,9 +15244,9 @@ var require_printer2 = __commonJS({
|
|
|
15244
15244
|
case "MixedTypeAnnotation":
|
|
15245
15245
|
return (0, lines_1.fromString)("mixed", options);
|
|
15246
15246
|
case "ArrayTypeAnnotation":
|
|
15247
|
-
return (0, lines_1.concat)([path3.call(
|
|
15247
|
+
return (0, lines_1.concat)([path3.call(print6, "elementType"), "[]"]);
|
|
15248
15248
|
case "TupleTypeAnnotation": {
|
|
15249
|
-
var printed_2 = path3.map(
|
|
15249
|
+
var printed_2 = path3.map(print6, "types");
|
|
15250
15250
|
var joined = (0, lines_1.fromString)(", ").join(printed_2);
|
|
15251
15251
|
var oneLine_3 = joined.getLineLength(1) <= options.wrapColumn;
|
|
15252
15252
|
if (oneLine_3) {
|
|
@@ -15293,38 +15293,38 @@ var require_printer2 = __commonJS({
|
|
|
15293
15293
|
case "InterfaceTypeAnnotation":
|
|
15294
15294
|
parts.push("interface");
|
|
15295
15295
|
if (n.extends && n.extends.length > 0) {
|
|
15296
|
-
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path3.map(
|
|
15296
|
+
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path3.map(print6, "extends")));
|
|
15297
15297
|
}
|
|
15298
|
-
parts.push(" ", path3.call(
|
|
15298
|
+
parts.push(" ", path3.call(print6, "body"));
|
|
15299
15299
|
return (0, lines_1.concat)(parts);
|
|
15300
15300
|
case "DeclareFunction":
|
|
15301
15301
|
return printFlowDeclaration(path3, [
|
|
15302
15302
|
"function ",
|
|
15303
|
-
path3.call(
|
|
15303
|
+
path3.call(print6, "id"),
|
|
15304
15304
|
";"
|
|
15305
15305
|
]);
|
|
15306
15306
|
case "DeclareModule":
|
|
15307
15307
|
return printFlowDeclaration(path3, [
|
|
15308
15308
|
"module ",
|
|
15309
|
-
path3.call(
|
|
15309
|
+
path3.call(print6, "id"),
|
|
15310
15310
|
" ",
|
|
15311
|
-
path3.call(
|
|
15311
|
+
path3.call(print6, "body")
|
|
15312
15312
|
]);
|
|
15313
15313
|
case "DeclareModuleExports":
|
|
15314
15314
|
return printFlowDeclaration(path3, [
|
|
15315
15315
|
"module.exports",
|
|
15316
|
-
path3.call(
|
|
15316
|
+
path3.call(print6, "typeAnnotation")
|
|
15317
15317
|
]);
|
|
15318
15318
|
case "DeclareVariable":
|
|
15319
|
-
return printFlowDeclaration(path3, ["var ", path3.call(
|
|
15319
|
+
return printFlowDeclaration(path3, ["var ", path3.call(print6, "id"), ";"]);
|
|
15320
15320
|
case "DeclareExportDeclaration":
|
|
15321
15321
|
case "DeclareExportAllDeclaration":
|
|
15322
|
-
return (0, lines_1.concat)(["declare ", printExportDeclaration(path3, options,
|
|
15322
|
+
return (0, lines_1.concat)(["declare ", printExportDeclaration(path3, options, print6)]);
|
|
15323
15323
|
case "EnumDeclaration":
|
|
15324
15324
|
return (0, lines_1.concat)([
|
|
15325
15325
|
"enum ",
|
|
15326
|
-
path3.call(
|
|
15327
|
-
path3.call(
|
|
15326
|
+
path3.call(print6, "id"),
|
|
15327
|
+
path3.call(print6, "body")
|
|
15328
15328
|
]);
|
|
15329
15329
|
case "EnumBooleanBody":
|
|
15330
15330
|
case "EnumNumberBody":
|
|
@@ -15336,24 +15336,24 @@ var require_printer2 = __commonJS({
|
|
|
15336
15336
|
n.type.slice(4, -4).toLowerCase()
|
|
15337
15337
|
);
|
|
15338
15338
|
}
|
|
15339
|
-
parts.push(" {\n", (0, lines_1.fromString)("\n").join(path3.map(
|
|
15339
|
+
parts.push(" {\n", (0, lines_1.fromString)("\n").join(path3.map(print6, "members")).indent(options.tabWidth), "\n}");
|
|
15340
15340
|
return (0, lines_1.concat)(parts);
|
|
15341
15341
|
}
|
|
15342
15342
|
case "EnumDefaultedMember":
|
|
15343
|
-
return (0, lines_1.concat)([path3.call(
|
|
15343
|
+
return (0, lines_1.concat)([path3.call(print6, "id"), ","]);
|
|
15344
15344
|
case "EnumBooleanMember":
|
|
15345
15345
|
case "EnumNumberMember":
|
|
15346
15346
|
case "EnumStringMember":
|
|
15347
15347
|
return (0, lines_1.concat)([
|
|
15348
|
-
path3.call(
|
|
15348
|
+
path3.call(print6, "id"),
|
|
15349
15349
|
" = ",
|
|
15350
|
-
path3.call(
|
|
15350
|
+
path3.call(print6, "init"),
|
|
15351
15351
|
","
|
|
15352
15352
|
]);
|
|
15353
15353
|
case "InferredPredicate":
|
|
15354
15354
|
return (0, lines_1.fromString)("%checks", options);
|
|
15355
15355
|
case "DeclaredPredicate":
|
|
15356
|
-
return (0, lines_1.concat)(["%checks(", path3.call(
|
|
15356
|
+
return (0, lines_1.concat)(["%checks(", path3.call(print6, "value"), ")"]);
|
|
15357
15357
|
case "FunctionTypeAnnotation": {
|
|
15358
15358
|
var parent = path3.getParentNode(0);
|
|
15359
15359
|
var isArrowFunctionTypeAnnotation = !(namedTypes.ObjectTypeCallProperty.check(parent) || namedTypes.ObjectTypeInternalSlot.check(parent) && parent.method || namedTypes.DeclareFunction.check(path3.getParentNode(2)));
|
|
@@ -15363,14 +15363,14 @@ var require_printer2 = __commonJS({
|
|
|
15363
15363
|
}
|
|
15364
15364
|
var hasTypeParameters = !!n.typeParameters;
|
|
15365
15365
|
var needsParens = hasTypeParameters || n.params.length !== 1 || n.params[0].name;
|
|
15366
|
-
parts.push(hasTypeParameters ? path3.call(
|
|
15366
|
+
parts.push(hasTypeParameters ? path3.call(print6, "typeParameters") : "", needsParens ? "(" : "", printFunctionParams(path3, options, print6), needsParens ? ")" : "");
|
|
15367
15367
|
if (n.returnType) {
|
|
15368
|
-
parts.push(isArrowFunctionTypeAnnotation ? " => " : ": ", path3.call(
|
|
15368
|
+
parts.push(isArrowFunctionTypeAnnotation ? " => " : ": ", path3.call(print6, "returnType"));
|
|
15369
15369
|
}
|
|
15370
15370
|
return (0, lines_1.concat)(parts);
|
|
15371
15371
|
}
|
|
15372
15372
|
case "FunctionTypeParam": {
|
|
15373
|
-
var name = path3.call(
|
|
15373
|
+
var name = path3.call(print6, "name");
|
|
15374
15374
|
parts.push(name);
|
|
15375
15375
|
if (n.optional) {
|
|
15376
15376
|
parts.push("?");
|
|
@@ -15378,13 +15378,13 @@ var require_printer2 = __commonJS({
|
|
|
15378
15378
|
if (name.infos[0].line) {
|
|
15379
15379
|
parts.push(": ");
|
|
15380
15380
|
}
|
|
15381
|
-
parts.push(path3.call(
|
|
15381
|
+
parts.push(path3.call(print6, "typeAnnotation"));
|
|
15382
15382
|
return (0, lines_1.concat)(parts);
|
|
15383
15383
|
}
|
|
15384
15384
|
case "GenericTypeAnnotation":
|
|
15385
15385
|
return (0, lines_1.concat)([
|
|
15386
|
-
path3.call(
|
|
15387
|
-
path3.call(
|
|
15386
|
+
path3.call(print6, "id"),
|
|
15387
|
+
path3.call(print6, "typeParameters")
|
|
15388
15388
|
]);
|
|
15389
15389
|
case "DeclareInterface":
|
|
15390
15390
|
parts.push("declare ");
|
|
@@ -15393,24 +15393,24 @@ var require_printer2 = __commonJS({
|
|
|
15393
15393
|
if (n.declare) {
|
|
15394
15394
|
parts.push("declare ");
|
|
15395
15395
|
}
|
|
15396
|
-
parts.push("interface ", path3.call(
|
|
15396
|
+
parts.push("interface ", path3.call(print6, "id"), path3.call(print6, "typeParameters"), " ");
|
|
15397
15397
|
if (n["extends"] && n["extends"].length > 0) {
|
|
15398
|
-
parts.push("extends ", (0, lines_1.fromString)(", ").join(path3.map(
|
|
15398
|
+
parts.push("extends ", (0, lines_1.fromString)(", ").join(path3.map(print6, "extends")), " ");
|
|
15399
15399
|
}
|
|
15400
15400
|
if (n.body) {
|
|
15401
|
-
parts.push(path3.call(
|
|
15401
|
+
parts.push(path3.call(print6, "body"));
|
|
15402
15402
|
}
|
|
15403
15403
|
return (0, lines_1.concat)(parts);
|
|
15404
15404
|
case "ClassImplements":
|
|
15405
15405
|
case "InterfaceExtends":
|
|
15406
15406
|
return (0, lines_1.concat)([
|
|
15407
|
-
path3.call(
|
|
15408
|
-
path3.call(
|
|
15407
|
+
path3.call(print6, "id"),
|
|
15408
|
+
path3.call(print6, "typeParameters")
|
|
15409
15409
|
]);
|
|
15410
15410
|
case "IntersectionTypeAnnotation":
|
|
15411
|
-
return (0, lines_1.fromString)(" & ").join(path3.map(
|
|
15411
|
+
return (0, lines_1.fromString)(" & ").join(path3.map(print6, "types"));
|
|
15412
15412
|
case "NullableTypeAnnotation":
|
|
15413
|
-
return (0, lines_1.concat)(["?", path3.call(
|
|
15413
|
+
return (0, lines_1.concat)(["?", path3.call(print6, "typeAnnotation")]);
|
|
15414
15414
|
case "NullLiteralTypeAnnotation":
|
|
15415
15415
|
return (0, lines_1.fromString)("null", options);
|
|
15416
15416
|
case "ThisTypeAnnotation":
|
|
@@ -15418,40 +15418,40 @@ var require_printer2 = __commonJS({
|
|
|
15418
15418
|
case "NumberTypeAnnotation":
|
|
15419
15419
|
return (0, lines_1.fromString)("number", options);
|
|
15420
15420
|
case "ObjectTypeCallProperty":
|
|
15421
|
-
return path3.call(
|
|
15421
|
+
return path3.call(print6, "value");
|
|
15422
15422
|
case "ObjectTypeIndexer":
|
|
15423
15423
|
if (n.static) {
|
|
15424
15424
|
parts.push("static ");
|
|
15425
15425
|
}
|
|
15426
|
-
parts.push(printVariance(path3,
|
|
15426
|
+
parts.push(printVariance(path3, print6), "[");
|
|
15427
15427
|
if (n.id) {
|
|
15428
|
-
parts.push(path3.call(
|
|
15428
|
+
parts.push(path3.call(print6, "id"), ": ");
|
|
15429
15429
|
}
|
|
15430
|
-
parts.push(path3.call(
|
|
15430
|
+
parts.push(path3.call(print6, "key"), "]: ", path3.call(print6, "value"));
|
|
15431
15431
|
return (0, lines_1.concat)(parts);
|
|
15432
15432
|
case "ObjectTypeProperty":
|
|
15433
15433
|
return (0, lines_1.concat)([
|
|
15434
|
-
printVariance(path3,
|
|
15435
|
-
path3.call(
|
|
15434
|
+
printVariance(path3, print6),
|
|
15435
|
+
path3.call(print6, "key"),
|
|
15436
15436
|
n.optional ? "?" : "",
|
|
15437
15437
|
": ",
|
|
15438
|
-
path3.call(
|
|
15438
|
+
path3.call(print6, "value")
|
|
15439
15439
|
]);
|
|
15440
15440
|
case "ObjectTypeInternalSlot":
|
|
15441
15441
|
return (0, lines_1.concat)([
|
|
15442
15442
|
n.static ? "static " : "",
|
|
15443
15443
|
"[[",
|
|
15444
|
-
path3.call(
|
|
15444
|
+
path3.call(print6, "id"),
|
|
15445
15445
|
"]]",
|
|
15446
15446
|
n.optional ? "?" : "",
|
|
15447
15447
|
n.value.type !== "FunctionTypeAnnotation" ? ": " : "",
|
|
15448
|
-
path3.call(
|
|
15448
|
+
path3.call(print6, "value")
|
|
15449
15449
|
]);
|
|
15450
15450
|
case "QualifiedTypeIdentifier":
|
|
15451
15451
|
return (0, lines_1.concat)([
|
|
15452
|
-
path3.call(
|
|
15452
|
+
path3.call(print6, "qualification"),
|
|
15453
15453
|
".",
|
|
15454
|
-
path3.call(
|
|
15454
|
+
path3.call(print6, "id")
|
|
15455
15455
|
]);
|
|
15456
15456
|
case "StringLiteralTypeAnnotation":
|
|
15457
15457
|
return (0, lines_1.fromString)(nodeStr(n.value, options), options);
|
|
@@ -15468,36 +15468,36 @@ var require_printer2 = __commonJS({
|
|
|
15468
15468
|
case "TypeAlias":
|
|
15469
15469
|
return (0, lines_1.concat)([
|
|
15470
15470
|
"type ",
|
|
15471
|
-
path3.call(
|
|
15472
|
-
path3.call(
|
|
15471
|
+
path3.call(print6, "id"),
|
|
15472
|
+
path3.call(print6, "typeParameters"),
|
|
15473
15473
|
" = ",
|
|
15474
|
-
path3.call(
|
|
15474
|
+
path3.call(print6, "right"),
|
|
15475
15475
|
";"
|
|
15476
15476
|
]);
|
|
15477
15477
|
case "DeclareOpaqueType":
|
|
15478
15478
|
parts.push("declare ");
|
|
15479
15479
|
case "OpaqueType":
|
|
15480
|
-
parts.push("opaque type ", path3.call(
|
|
15480
|
+
parts.push("opaque type ", path3.call(print6, "id"), path3.call(print6, "typeParameters"));
|
|
15481
15481
|
if (n["supertype"]) {
|
|
15482
|
-
parts.push(": ", path3.call(
|
|
15482
|
+
parts.push(": ", path3.call(print6, "supertype"));
|
|
15483
15483
|
}
|
|
15484
15484
|
if (n["impltype"]) {
|
|
15485
|
-
parts.push(" = ", path3.call(
|
|
15485
|
+
parts.push(" = ", path3.call(print6, "impltype"));
|
|
15486
15486
|
}
|
|
15487
15487
|
parts.push(";");
|
|
15488
15488
|
return (0, lines_1.concat)(parts);
|
|
15489
15489
|
case "TypeCastExpression":
|
|
15490
15490
|
return (0, lines_1.concat)([
|
|
15491
15491
|
"(",
|
|
15492
|
-
path3.call(
|
|
15493
|
-
path3.call(
|
|
15492
|
+
path3.call(print6, "expression"),
|
|
15493
|
+
path3.call(print6, "typeAnnotation"),
|
|
15494
15494
|
")"
|
|
15495
15495
|
]);
|
|
15496
15496
|
case "TypeParameterDeclaration":
|
|
15497
15497
|
case "TypeParameterInstantiation":
|
|
15498
15498
|
return (0, lines_1.concat)([
|
|
15499
15499
|
"<",
|
|
15500
|
-
(0, lines_1.fromString)(", ").join(path3.map(
|
|
15500
|
+
(0, lines_1.fromString)(", ").join(path3.map(print6, "params")),
|
|
15501
15501
|
">"
|
|
15502
15502
|
]);
|
|
15503
15503
|
case "Variance":
|
|
@@ -15510,32 +15510,32 @@ var require_printer2 = __commonJS({
|
|
|
15510
15510
|
return (0, lines_1.fromString)("");
|
|
15511
15511
|
case "TypeParameter":
|
|
15512
15512
|
if (n.variance) {
|
|
15513
|
-
parts.push(printVariance(path3,
|
|
15513
|
+
parts.push(printVariance(path3, print6));
|
|
15514
15514
|
}
|
|
15515
|
-
parts.push(path3.call(
|
|
15515
|
+
parts.push(path3.call(print6, "name"));
|
|
15516
15516
|
if (n.bound) {
|
|
15517
|
-
parts.push(path3.call(
|
|
15517
|
+
parts.push(path3.call(print6, "bound"));
|
|
15518
15518
|
}
|
|
15519
15519
|
if (n["default"]) {
|
|
15520
|
-
parts.push("=", path3.call(
|
|
15520
|
+
parts.push("=", path3.call(print6, "default"));
|
|
15521
15521
|
}
|
|
15522
15522
|
return (0, lines_1.concat)(parts);
|
|
15523
15523
|
case "TypeofTypeAnnotation":
|
|
15524
15524
|
return (0, lines_1.concat)([
|
|
15525
15525
|
(0, lines_1.fromString)("typeof ", options),
|
|
15526
|
-
path3.call(
|
|
15526
|
+
path3.call(print6, "argument")
|
|
15527
15527
|
]);
|
|
15528
15528
|
case "IndexedAccessType":
|
|
15529
15529
|
case "OptionalIndexedAccessType":
|
|
15530
15530
|
return (0, lines_1.concat)([
|
|
15531
|
-
path3.call(
|
|
15531
|
+
path3.call(print6, "objectType"),
|
|
15532
15532
|
n.optional ? "?." : "",
|
|
15533
15533
|
"[",
|
|
15534
|
-
path3.call(
|
|
15534
|
+
path3.call(print6, "indexType"),
|
|
15535
15535
|
"]"
|
|
15536
15536
|
]);
|
|
15537
15537
|
case "UnionTypeAnnotation":
|
|
15538
|
-
return (0, lines_1.fromString)(" | ").join(path3.map(
|
|
15538
|
+
return (0, lines_1.fromString)(" | ").join(path3.map(print6, "types"));
|
|
15539
15539
|
case "VoidTypeAnnotation":
|
|
15540
15540
|
return (0, lines_1.fromString)("void", options);
|
|
15541
15541
|
case "NullTypeAnnotation":
|
|
@@ -15575,77 +15575,77 @@ var require_printer2 = __commonJS({
|
|
|
15575
15575
|
case "TSNeverKeyword":
|
|
15576
15576
|
return (0, lines_1.fromString)("never", options);
|
|
15577
15577
|
case "TSArrayType":
|
|
15578
|
-
return (0, lines_1.concat)([path3.call(
|
|
15578
|
+
return (0, lines_1.concat)([path3.call(print6, "elementType"), "[]"]);
|
|
15579
15579
|
case "TSLiteralType":
|
|
15580
|
-
return path3.call(
|
|
15580
|
+
return path3.call(print6, "literal");
|
|
15581
15581
|
case "TSUnionType":
|
|
15582
|
-
return (0, lines_1.fromString)(" | ").join(path3.map(
|
|
15582
|
+
return (0, lines_1.fromString)(" | ").join(path3.map(print6, "types"));
|
|
15583
15583
|
case "TSIntersectionType":
|
|
15584
|
-
return (0, lines_1.fromString)(" & ").join(path3.map(
|
|
15584
|
+
return (0, lines_1.fromString)(" & ").join(path3.map(print6, "types"));
|
|
15585
15585
|
case "TSConditionalType":
|
|
15586
|
-
parts.push(path3.call(
|
|
15586
|
+
parts.push(path3.call(print6, "checkType"), " extends ", path3.call(print6, "extendsType"), " ? ", path3.call(print6, "trueType"), " : ", path3.call(print6, "falseType"));
|
|
15587
15587
|
return (0, lines_1.concat)(parts);
|
|
15588
15588
|
case "TSInferType":
|
|
15589
|
-
parts.push("infer ", path3.call(
|
|
15589
|
+
parts.push("infer ", path3.call(print6, "typeParameter"));
|
|
15590
15590
|
return (0, lines_1.concat)(parts);
|
|
15591
15591
|
case "TSParenthesizedType":
|
|
15592
|
-
return (0, lines_1.concat)(["(", path3.call(
|
|
15592
|
+
return (0, lines_1.concat)(["(", path3.call(print6, "typeAnnotation"), ")"]);
|
|
15593
15593
|
case "TSFunctionType":
|
|
15594
15594
|
return (0, lines_1.concat)([
|
|
15595
|
-
path3.call(
|
|
15595
|
+
path3.call(print6, "typeParameters"),
|
|
15596
15596
|
"(",
|
|
15597
|
-
printFunctionParams(path3, options,
|
|
15597
|
+
printFunctionParams(path3, options, print6),
|
|
15598
15598
|
") => ",
|
|
15599
|
-
path3.call(
|
|
15599
|
+
path3.call(print6, "typeAnnotation", "typeAnnotation")
|
|
15600
15600
|
]);
|
|
15601
15601
|
case "TSConstructorType":
|
|
15602
15602
|
return (0, lines_1.concat)([
|
|
15603
15603
|
"new ",
|
|
15604
|
-
path3.call(
|
|
15604
|
+
path3.call(print6, "typeParameters"),
|
|
15605
15605
|
"(",
|
|
15606
|
-
printFunctionParams(path3, options,
|
|
15606
|
+
printFunctionParams(path3, options, print6),
|
|
15607
15607
|
") => ",
|
|
15608
|
-
path3.call(
|
|
15608
|
+
path3.call(print6, "typeAnnotation", "typeAnnotation")
|
|
15609
15609
|
]);
|
|
15610
15610
|
case "TSMappedType": {
|
|
15611
|
-
parts.push(n.readonly ? "readonly " : "", "[", path3.call(
|
|
15611
|
+
parts.push(n.readonly ? "readonly " : "", "[", path3.call(print6, "typeParameter"), "]", n.optional ? "?" : "");
|
|
15612
15612
|
if (n.typeAnnotation) {
|
|
15613
|
-
parts.push(": ", path3.call(
|
|
15613
|
+
parts.push(": ", path3.call(print6, "typeAnnotation"), ";");
|
|
15614
15614
|
}
|
|
15615
15615
|
return (0, lines_1.concat)(["{\n", (0, lines_1.concat)(parts).indent(options.tabWidth), "\n}"]);
|
|
15616
15616
|
}
|
|
15617
15617
|
case "TSTupleType":
|
|
15618
15618
|
return (0, lines_1.concat)([
|
|
15619
15619
|
"[",
|
|
15620
|
-
(0, lines_1.fromString)(", ").join(path3.map(
|
|
15620
|
+
(0, lines_1.fromString)(", ").join(path3.map(print6, "elementTypes")),
|
|
15621
15621
|
"]"
|
|
15622
15622
|
]);
|
|
15623
15623
|
case "TSNamedTupleMember":
|
|
15624
|
-
parts.push(path3.call(
|
|
15624
|
+
parts.push(path3.call(print6, "label"));
|
|
15625
15625
|
if (n.optional) {
|
|
15626
15626
|
parts.push("?");
|
|
15627
15627
|
}
|
|
15628
|
-
parts.push(": ", path3.call(
|
|
15628
|
+
parts.push(": ", path3.call(print6, "elementType"));
|
|
15629
15629
|
return (0, lines_1.concat)(parts);
|
|
15630
15630
|
case "TSRestType":
|
|
15631
|
-
return (0, lines_1.concat)(["...", path3.call(
|
|
15631
|
+
return (0, lines_1.concat)(["...", path3.call(print6, "typeAnnotation")]);
|
|
15632
15632
|
case "TSOptionalType":
|
|
15633
|
-
return (0, lines_1.concat)([path3.call(
|
|
15633
|
+
return (0, lines_1.concat)([path3.call(print6, "typeAnnotation"), "?"]);
|
|
15634
15634
|
case "TSIndexedAccessType":
|
|
15635
15635
|
return (0, lines_1.concat)([
|
|
15636
|
-
path3.call(
|
|
15636
|
+
path3.call(print6, "objectType"),
|
|
15637
15637
|
"[",
|
|
15638
|
-
path3.call(
|
|
15638
|
+
path3.call(print6, "indexType"),
|
|
15639
15639
|
"]"
|
|
15640
15640
|
]);
|
|
15641
15641
|
case "TSTypeOperator":
|
|
15642
15642
|
return (0, lines_1.concat)([
|
|
15643
|
-
path3.call(
|
|
15643
|
+
path3.call(print6, "operator"),
|
|
15644
15644
|
" ",
|
|
15645
|
-
path3.call(
|
|
15645
|
+
path3.call(print6, "typeAnnotation")
|
|
15646
15646
|
]);
|
|
15647
15647
|
case "TSTypeLiteral": {
|
|
15648
|
-
var members = (0, lines_1.fromString)("\n").join(path3.map(
|
|
15648
|
+
var members = (0, lines_1.fromString)("\n").join(path3.map(print6, "members").map(function(member) {
|
|
15649
15649
|
if (lastNonSpaceCharacter(member) !== ";") {
|
|
15650
15650
|
return member.concat(";");
|
|
15651
15651
|
}
|
|
@@ -15658,13 +15658,13 @@ var require_printer2 = __commonJS({
|
|
|
15658
15658
|
return (0, lines_1.concat)(parts);
|
|
15659
15659
|
}
|
|
15660
15660
|
case "TSEnumMember":
|
|
15661
|
-
parts.push(path3.call(
|
|
15661
|
+
parts.push(path3.call(print6, "id"));
|
|
15662
15662
|
if (n.initializer) {
|
|
15663
|
-
parts.push(" = ", path3.call(
|
|
15663
|
+
parts.push(" = ", path3.call(print6, "initializer"));
|
|
15664
15664
|
}
|
|
15665
15665
|
return (0, lines_1.concat)(parts);
|
|
15666
15666
|
case "TSTypeQuery":
|
|
15667
|
-
return (0, lines_1.concat)(["typeof ", path3.call(
|
|
15667
|
+
return (0, lines_1.concat)(["typeof ", path3.call(print6, "exprName")]);
|
|
15668
15668
|
case "TSParameterProperty":
|
|
15669
15669
|
if (n.accessibility) {
|
|
15670
15670
|
parts.push(n.accessibility, " ");
|
|
@@ -15678,119 +15678,119 @@ var require_printer2 = __commonJS({
|
|
|
15678
15678
|
if (n.readonly) {
|
|
15679
15679
|
parts.push("readonly ");
|
|
15680
15680
|
}
|
|
15681
|
-
parts.push(path3.call(
|
|
15681
|
+
parts.push(path3.call(print6, "parameter"));
|
|
15682
15682
|
return (0, lines_1.concat)(parts);
|
|
15683
15683
|
case "TSTypeReference":
|
|
15684
15684
|
return (0, lines_1.concat)([
|
|
15685
|
-
path3.call(
|
|
15686
|
-
path3.call(
|
|
15685
|
+
path3.call(print6, "typeName"),
|
|
15686
|
+
path3.call(print6, "typeParameters")
|
|
15687
15687
|
]);
|
|
15688
15688
|
case "TSQualifiedName":
|
|
15689
|
-
return (0, lines_1.concat)([path3.call(
|
|
15689
|
+
return (0, lines_1.concat)([path3.call(print6, "left"), ".", path3.call(print6, "right")]);
|
|
15690
15690
|
case "TSAsExpression":
|
|
15691
15691
|
case "TSSatisfiesExpression": {
|
|
15692
|
-
var expression = path3.call(
|
|
15693
|
-
parts.push(expression, n.type === "TSSatisfiesExpression" ? " satisfies " : " as ", path3.call(
|
|
15692
|
+
var expression = path3.call(print6, "expression");
|
|
15693
|
+
parts.push(expression, n.type === "TSSatisfiesExpression" ? " satisfies " : " as ", path3.call(print6, "typeAnnotation"));
|
|
15694
15694
|
return (0, lines_1.concat)(parts);
|
|
15695
15695
|
}
|
|
15696
15696
|
case "TSTypeCastExpression":
|
|
15697
15697
|
return (0, lines_1.concat)([
|
|
15698
|
-
path3.call(
|
|
15699
|
-
path3.call(
|
|
15698
|
+
path3.call(print6, "expression"),
|
|
15699
|
+
path3.call(print6, "typeAnnotation")
|
|
15700
15700
|
]);
|
|
15701
15701
|
case "TSNonNullExpression":
|
|
15702
|
-
return (0, lines_1.concat)([path3.call(
|
|
15702
|
+
return (0, lines_1.concat)([path3.call(print6, "expression"), "!"]);
|
|
15703
15703
|
case "TSTypeAnnotation":
|
|
15704
|
-
return (0, lines_1.concat)([": ", path3.call(
|
|
15704
|
+
return (0, lines_1.concat)([": ", path3.call(print6, "typeAnnotation")]);
|
|
15705
15705
|
case "TSIndexSignature":
|
|
15706
15706
|
return (0, lines_1.concat)([
|
|
15707
15707
|
n.readonly ? "readonly " : "",
|
|
15708
15708
|
"[",
|
|
15709
|
-
path3.map(
|
|
15709
|
+
path3.map(print6, "parameters"),
|
|
15710
15710
|
"]",
|
|
15711
|
-
path3.call(
|
|
15711
|
+
path3.call(print6, "typeAnnotation")
|
|
15712
15712
|
]);
|
|
15713
15713
|
case "TSPropertySignature":
|
|
15714
|
-
parts.push(printVariance(path3,
|
|
15714
|
+
parts.push(printVariance(path3, print6), n.readonly ? "readonly " : "");
|
|
15715
15715
|
if (n.computed) {
|
|
15716
|
-
parts.push("[", path3.call(
|
|
15716
|
+
parts.push("[", path3.call(print6, "key"), "]");
|
|
15717
15717
|
} else {
|
|
15718
|
-
parts.push(path3.call(
|
|
15718
|
+
parts.push(path3.call(print6, "key"));
|
|
15719
15719
|
}
|
|
15720
|
-
parts.push(n.optional ? "?" : "", path3.call(
|
|
15720
|
+
parts.push(n.optional ? "?" : "", path3.call(print6, "typeAnnotation"));
|
|
15721
15721
|
return (0, lines_1.concat)(parts);
|
|
15722
15722
|
case "TSMethodSignature":
|
|
15723
15723
|
if (n.computed) {
|
|
15724
|
-
parts.push("[", path3.call(
|
|
15724
|
+
parts.push("[", path3.call(print6, "key"), "]");
|
|
15725
15725
|
} else {
|
|
15726
|
-
parts.push(path3.call(
|
|
15726
|
+
parts.push(path3.call(print6, "key"));
|
|
15727
15727
|
}
|
|
15728
15728
|
if (n.optional) {
|
|
15729
15729
|
parts.push("?");
|
|
15730
15730
|
}
|
|
15731
|
-
parts.push(path3.call(
|
|
15731
|
+
parts.push(path3.call(print6, "typeParameters"), "(", printFunctionParams(path3, options, print6), ")", path3.call(print6, "typeAnnotation"));
|
|
15732
15732
|
return (0, lines_1.concat)(parts);
|
|
15733
15733
|
case "TSTypePredicate":
|
|
15734
15734
|
if (n.asserts) {
|
|
15735
15735
|
parts.push("asserts ");
|
|
15736
15736
|
}
|
|
15737
|
-
parts.push(path3.call(
|
|
15737
|
+
parts.push(path3.call(print6, "parameterName"));
|
|
15738
15738
|
if (n.typeAnnotation) {
|
|
15739
|
-
parts.push(" is ", path3.call(
|
|
15739
|
+
parts.push(" is ", path3.call(print6, "typeAnnotation", "typeAnnotation"));
|
|
15740
15740
|
}
|
|
15741
15741
|
return (0, lines_1.concat)(parts);
|
|
15742
15742
|
case "TSCallSignatureDeclaration":
|
|
15743
15743
|
return (0, lines_1.concat)([
|
|
15744
|
-
path3.call(
|
|
15744
|
+
path3.call(print6, "typeParameters"),
|
|
15745
15745
|
"(",
|
|
15746
|
-
printFunctionParams(path3, options,
|
|
15746
|
+
printFunctionParams(path3, options, print6),
|
|
15747
15747
|
")",
|
|
15748
|
-
path3.call(
|
|
15748
|
+
path3.call(print6, "typeAnnotation")
|
|
15749
15749
|
]);
|
|
15750
15750
|
case "TSConstructSignatureDeclaration":
|
|
15751
15751
|
if (n.typeParameters) {
|
|
15752
|
-
parts.push("new", path3.call(
|
|
15752
|
+
parts.push("new", path3.call(print6, "typeParameters"));
|
|
15753
15753
|
} else {
|
|
15754
15754
|
parts.push("new ");
|
|
15755
15755
|
}
|
|
15756
|
-
parts.push("(", printFunctionParams(path3, options,
|
|
15756
|
+
parts.push("(", printFunctionParams(path3, options, print6), ")", path3.call(print6, "typeAnnotation"));
|
|
15757
15757
|
return (0, lines_1.concat)(parts);
|
|
15758
15758
|
case "TSTypeAliasDeclaration":
|
|
15759
15759
|
return (0, lines_1.concat)([
|
|
15760
15760
|
n.declare ? "declare " : "",
|
|
15761
15761
|
"type ",
|
|
15762
|
-
path3.call(
|
|
15763
|
-
path3.call(
|
|
15762
|
+
path3.call(print6, "id"),
|
|
15763
|
+
path3.call(print6, "typeParameters"),
|
|
15764
15764
|
" = ",
|
|
15765
|
-
path3.call(
|
|
15765
|
+
path3.call(print6, "typeAnnotation"),
|
|
15766
15766
|
";"
|
|
15767
15767
|
]);
|
|
15768
15768
|
case "TSTypeParameter": {
|
|
15769
|
-
parts.push(path3.call(
|
|
15769
|
+
parts.push(path3.call(print6, "name"));
|
|
15770
15770
|
var parent = path3.getParentNode(0);
|
|
15771
15771
|
var isInMappedType = namedTypes.TSMappedType.check(parent);
|
|
15772
15772
|
if (n.constraint) {
|
|
15773
|
-
parts.push(isInMappedType ? " in " : " extends ", path3.call(
|
|
15773
|
+
parts.push(isInMappedType ? " in " : " extends ", path3.call(print6, "constraint"));
|
|
15774
15774
|
}
|
|
15775
15775
|
if (n["default"]) {
|
|
15776
|
-
parts.push(" = ", path3.call(
|
|
15776
|
+
parts.push(" = ", path3.call(print6, "default"));
|
|
15777
15777
|
}
|
|
15778
15778
|
return (0, lines_1.concat)(parts);
|
|
15779
15779
|
}
|
|
15780
15780
|
case "TSTypeAssertion": {
|
|
15781
|
-
parts.push("<", path3.call(
|
|
15781
|
+
parts.push("<", path3.call(print6, "typeAnnotation"), "> ", path3.call(print6, "expression"));
|
|
15782
15782
|
return (0, lines_1.concat)(parts);
|
|
15783
15783
|
}
|
|
15784
15784
|
case "TSTypeParameterDeclaration":
|
|
15785
15785
|
case "TSTypeParameterInstantiation":
|
|
15786
15786
|
return (0, lines_1.concat)([
|
|
15787
15787
|
"<",
|
|
15788
|
-
(0, lines_1.fromString)(", ").join(path3.map(
|
|
15788
|
+
(0, lines_1.fromString)(", ").join(path3.map(print6, "params")),
|
|
15789
15789
|
">"
|
|
15790
15790
|
]);
|
|
15791
15791
|
case "TSEnumDeclaration": {
|
|
15792
|
-
parts.push(n.declare ? "declare " : "", n.const ? "const " : "", "enum ", path3.call(
|
|
15793
|
-
var memberLines = (0, lines_1.fromString)(",\n").join(path3.map(
|
|
15792
|
+
parts.push(n.declare ? "declare " : "", n.const ? "const " : "", "enum ", path3.call(print6, "id"));
|
|
15793
|
+
var memberLines = (0, lines_1.fromString)(",\n").join(path3.map(print6, "members"));
|
|
15794
15794
|
if (memberLines.isEmpty()) {
|
|
15795
15795
|
parts.push(" {}");
|
|
15796
15796
|
} else {
|
|
@@ -15800,11 +15800,11 @@ var require_printer2 = __commonJS({
|
|
|
15800
15800
|
}
|
|
15801
15801
|
case "TSExpressionWithTypeArguments":
|
|
15802
15802
|
return (0, lines_1.concat)([
|
|
15803
|
-
path3.call(
|
|
15804
|
-
path3.call(
|
|
15803
|
+
path3.call(print6, "expression"),
|
|
15804
|
+
path3.call(print6, "typeParameters")
|
|
15805
15805
|
]);
|
|
15806
15806
|
case "TSInterfaceBody": {
|
|
15807
|
-
var lines = (0, lines_1.fromString)("\n").join(path3.map(
|
|
15807
|
+
var lines = (0, lines_1.fromString)("\n").join(path3.map(print6, "body").map(function(element) {
|
|
15808
15808
|
if (lastNonSpaceCharacter(element) !== ";") {
|
|
15809
15809
|
return element.concat(";");
|
|
15810
15810
|
}
|
|
@@ -15816,22 +15816,22 @@ var require_printer2 = __commonJS({
|
|
|
15816
15816
|
return (0, lines_1.concat)(["{\n", lines.indent(options.tabWidth), "\n}"]);
|
|
15817
15817
|
}
|
|
15818
15818
|
case "TSImportType":
|
|
15819
|
-
parts.push("import(", path3.call(
|
|
15819
|
+
parts.push("import(", path3.call(print6, "argument"), ")");
|
|
15820
15820
|
if (n.qualifier) {
|
|
15821
|
-
parts.push(".", path3.call(
|
|
15821
|
+
parts.push(".", path3.call(print6, "qualifier"));
|
|
15822
15822
|
}
|
|
15823
15823
|
if (n.typeParameters) {
|
|
15824
|
-
parts.push(path3.call(
|
|
15824
|
+
parts.push(path3.call(print6, "typeParameters"));
|
|
15825
15825
|
}
|
|
15826
15826
|
return (0, lines_1.concat)(parts);
|
|
15827
15827
|
case "TSImportEqualsDeclaration":
|
|
15828
15828
|
if (n.isExport) {
|
|
15829
15829
|
parts.push("export ");
|
|
15830
15830
|
}
|
|
15831
|
-
parts.push("import ", path3.call(
|
|
15831
|
+
parts.push("import ", path3.call(print6, "id"), " = ", path3.call(print6, "moduleReference"));
|
|
15832
15832
|
return maybeAddSemicolon((0, lines_1.concat)(parts));
|
|
15833
15833
|
case "TSExternalModuleReference":
|
|
15834
|
-
return (0, lines_1.concat)(["require(", path3.call(
|
|
15834
|
+
return (0, lines_1.concat)(["require(", path3.call(print6, "expression"), ")"]);
|
|
15835
15835
|
case "TSModuleDeclaration": {
|
|
15836
15836
|
var parent = path3.getParentNode();
|
|
15837
15837
|
if (parent.type === "TSModuleDeclaration") {
|
|
@@ -15856,16 +15856,16 @@ var require_printer2 = __commonJS({
|
|
|
15856
15856
|
}
|
|
15857
15857
|
}
|
|
15858
15858
|
}
|
|
15859
|
-
parts.push(path3.call(
|
|
15859
|
+
parts.push(path3.call(print6, "id"));
|
|
15860
15860
|
if (n.body) {
|
|
15861
15861
|
parts.push(" ");
|
|
15862
|
-
parts.push(path3.call(
|
|
15862
|
+
parts.push(path3.call(print6, "body"));
|
|
15863
15863
|
}
|
|
15864
15864
|
return (0, lines_1.concat)(parts);
|
|
15865
15865
|
}
|
|
15866
15866
|
case "TSModuleBlock": {
|
|
15867
15867
|
var naked = path3.call(function(bodyPath) {
|
|
15868
|
-
return printStatementSequence(bodyPath, options,
|
|
15868
|
+
return printStatementSequence(bodyPath, options, print6);
|
|
15869
15869
|
}, "body");
|
|
15870
15870
|
if (naked.isEmpty()) {
|
|
15871
15871
|
parts.push("{}");
|
|
@@ -15875,11 +15875,11 @@ var require_printer2 = __commonJS({
|
|
|
15875
15875
|
return (0, lines_1.concat)(parts);
|
|
15876
15876
|
}
|
|
15877
15877
|
case "TSInstantiationExpression": {
|
|
15878
|
-
parts.push(path3.call(
|
|
15878
|
+
parts.push(path3.call(print6, "expression"), path3.call(print6, "typeParameters"));
|
|
15879
15879
|
return (0, lines_1.concat)(parts);
|
|
15880
15880
|
}
|
|
15881
15881
|
case "V8IntrinsicIdentifier":
|
|
15882
|
-
return (0, lines_1.concat)(["%", path3.call(
|
|
15882
|
+
return (0, lines_1.concat)(["%", path3.call(print6, "name")]);
|
|
15883
15883
|
case "TopicReference":
|
|
15884
15884
|
return (0, lines_1.fromString)("#");
|
|
15885
15885
|
case "ClassHeritage":
|
|
@@ -15929,7 +15929,7 @@ var require_printer2 = __commonJS({
|
|
|
15929
15929
|
}
|
|
15930
15930
|
return (0, lines_1.concat)(parts);
|
|
15931
15931
|
}
|
|
15932
|
-
function printStatementSequence(path3, options,
|
|
15932
|
+
function printStatementSequence(path3, options, print6) {
|
|
15933
15933
|
var filtered = [];
|
|
15934
15934
|
var sawComment = false;
|
|
15935
15935
|
var sawStatement = false;
|
|
@@ -15950,7 +15950,7 @@ var require_printer2 = __commonJS({
|
|
|
15950
15950
|
}
|
|
15951
15951
|
filtered.push({
|
|
15952
15952
|
node: stmt,
|
|
15953
|
-
printed:
|
|
15953
|
+
printed: print6(stmtPath)
|
|
15954
15954
|
});
|
|
15955
15955
|
});
|
|
15956
15956
|
if (sawComment) {
|
|
@@ -16042,7 +16042,7 @@ var require_printer2 = __commonJS({
|
|
|
16042
16042
|
}
|
|
16043
16043
|
return parts;
|
|
16044
16044
|
}
|
|
16045
|
-
function printMethod(path3, options,
|
|
16045
|
+
function printMethod(path3, options, print6) {
|
|
16046
16046
|
var node = path3.getNode();
|
|
16047
16047
|
var kind = node.kind;
|
|
16048
16048
|
var parts = [];
|
|
@@ -16060,7 +16060,7 @@ var require_printer2 = __commonJS({
|
|
|
16060
16060
|
if (kind === "get" || kind === "set") {
|
|
16061
16061
|
parts.push(kind, " ");
|
|
16062
16062
|
}
|
|
16063
|
-
var key = path3.call(
|
|
16063
|
+
var key = path3.call(print6, "key");
|
|
16064
16064
|
if (node.computed) {
|
|
16065
16065
|
key = (0, lines_1.concat)(["[", key, "]"]);
|
|
16066
16066
|
}
|
|
@@ -16069,26 +16069,26 @@ var require_printer2 = __commonJS({
|
|
|
16069
16069
|
parts.push("?");
|
|
16070
16070
|
}
|
|
16071
16071
|
if (node === nodeValue) {
|
|
16072
|
-
parts.push(path3.call(
|
|
16072
|
+
parts.push(path3.call(print6, "typeParameters"), "(", printFunctionParams(path3, options, print6), ")", path3.call(print6, "returnType"));
|
|
16073
16073
|
if (node.body) {
|
|
16074
|
-
parts.push(" ", path3.call(
|
|
16074
|
+
parts.push(" ", path3.call(print6, "body"));
|
|
16075
16075
|
} else {
|
|
16076
16076
|
parts.push(";");
|
|
16077
16077
|
}
|
|
16078
16078
|
} else {
|
|
16079
|
-
parts.push(path3.call(
|
|
16080
|
-
return printFunctionParams(valuePath, options,
|
|
16081
|
-
}, "value"), ")", path3.call(
|
|
16079
|
+
parts.push(path3.call(print6, "value", "typeParameters"), "(", path3.call(function(valuePath) {
|
|
16080
|
+
return printFunctionParams(valuePath, options, print6);
|
|
16081
|
+
}, "value"), ")", path3.call(print6, "value", "returnType"));
|
|
16082
16082
|
if (nodeValue.body) {
|
|
16083
|
-
parts.push(" ", path3.call(
|
|
16083
|
+
parts.push(" ", path3.call(print6, "value", "body"));
|
|
16084
16084
|
} else {
|
|
16085
16085
|
parts.push(";");
|
|
16086
16086
|
}
|
|
16087
16087
|
}
|
|
16088
16088
|
return (0, lines_1.concat)(parts);
|
|
16089
16089
|
}
|
|
16090
|
-
function printArgumentsList(path3, options,
|
|
16091
|
-
var printed = path3.map(
|
|
16090
|
+
function printArgumentsList(path3, options, print6) {
|
|
16091
|
+
var printed = path3.map(print6, "arguments");
|
|
16092
16092
|
var trailingComma = util.isTrailingCommaEnabled(options, "parameters");
|
|
16093
16093
|
var joined = (0, lines_1.fromString)(", ").join(printed);
|
|
16094
16094
|
if (joined.getLineLength(1) > options.wrapColumn) {
|
|
@@ -16101,28 +16101,28 @@ var require_printer2 = __commonJS({
|
|
|
16101
16101
|
}
|
|
16102
16102
|
return (0, lines_1.concat)(["(", joined, ")"]);
|
|
16103
16103
|
}
|
|
16104
|
-
function printFunctionParams(path3, options,
|
|
16104
|
+
function printFunctionParams(path3, options, print6) {
|
|
16105
16105
|
var fun = path3.getValue();
|
|
16106
16106
|
var params;
|
|
16107
16107
|
var printed = [];
|
|
16108
16108
|
if (fun.params) {
|
|
16109
16109
|
params = fun.params;
|
|
16110
|
-
printed = path3.map(
|
|
16110
|
+
printed = path3.map(print6, "params");
|
|
16111
16111
|
} else if (fun.parameters) {
|
|
16112
16112
|
params = fun.parameters;
|
|
16113
|
-
printed = path3.map(
|
|
16113
|
+
printed = path3.map(print6, "parameters");
|
|
16114
16114
|
}
|
|
16115
16115
|
if (fun.defaults) {
|
|
16116
16116
|
path3.each(function(defExprPath) {
|
|
16117
16117
|
var i2 = defExprPath.getName();
|
|
16118
16118
|
var p = printed[i2];
|
|
16119
16119
|
if (p && defExprPath.getValue()) {
|
|
16120
|
-
printed[i2] = (0, lines_1.concat)([p, " = ",
|
|
16120
|
+
printed[i2] = (0, lines_1.concat)([p, " = ", print6(defExprPath)]);
|
|
16121
16121
|
}
|
|
16122
16122
|
}, "defaults");
|
|
16123
16123
|
}
|
|
16124
16124
|
if (fun.rest) {
|
|
16125
|
-
printed.push((0, lines_1.concat)(["...", path3.call(
|
|
16125
|
+
printed.push((0, lines_1.concat)(["...", path3.call(print6, "rest")]));
|
|
16126
16126
|
}
|
|
16127
16127
|
var joined = (0, lines_1.fromString)(", ").join(printed);
|
|
16128
16128
|
if (joined.length > 1 || joined.getLineLength(1) > options.wrapColumn) {
|
|
@@ -16136,11 +16136,11 @@ var require_printer2 = __commonJS({
|
|
|
16136
16136
|
}
|
|
16137
16137
|
return joined;
|
|
16138
16138
|
}
|
|
16139
|
-
function maybePrintImportAssertions(path3, options,
|
|
16139
|
+
function maybePrintImportAssertions(path3, options, print6) {
|
|
16140
16140
|
var n = path3.getValue();
|
|
16141
16141
|
if (n.assertions && n.assertions.length > 0) {
|
|
16142
16142
|
var parts = [" assert {"];
|
|
16143
|
-
var printed = path3.map(
|
|
16143
|
+
var printed = path3.map(print6, "assertions");
|
|
16144
16144
|
var flat = (0, lines_1.fromString)(", ").join(printed);
|
|
16145
16145
|
if (flat.length > 1 || flat.getLineLength(1) > options.wrapColumn) {
|
|
16146
16146
|
parts.push("\n", (0, lines_1.fromString)(",\n").join(printed).indent(options.tabWidth), "\n}");
|
|
@@ -16151,7 +16151,7 @@ var require_printer2 = __commonJS({
|
|
|
16151
16151
|
}
|
|
16152
16152
|
return (0, lines_1.fromString)("");
|
|
16153
16153
|
}
|
|
16154
|
-
function printExportDeclaration(path3, options,
|
|
16154
|
+
function printExportDeclaration(path3, options, print6) {
|
|
16155
16155
|
var decl = path3.getValue();
|
|
16156
16156
|
var parts = ["export "];
|
|
16157
16157
|
if (decl.exportKind && decl.exportKind === "type") {
|
|
@@ -16165,7 +16165,7 @@ var require_printer2 = __commonJS({
|
|
|
16165
16165
|
parts.push("default ");
|
|
16166
16166
|
}
|
|
16167
16167
|
if (decl.declaration) {
|
|
16168
|
-
parts.push(path3.call(
|
|
16168
|
+
parts.push(path3.call(print6, "declaration"));
|
|
16169
16169
|
} else if (decl.specifiers) {
|
|
16170
16170
|
if (decl.specifiers.length === 1 && decl.specifiers[0].type === "ExportBatchSpecifier") {
|
|
16171
16171
|
parts.push("*");
|
|
@@ -16177,9 +16177,9 @@ var require_printer2 = __commonJS({
|
|
|
16177
16177
|
path3.each(function(specifierPath) {
|
|
16178
16178
|
var spec = specifierPath.getValue();
|
|
16179
16179
|
if (spec.type === "ExportDefaultSpecifier") {
|
|
16180
|
-
unbracedSpecifiers_2.push(
|
|
16180
|
+
unbracedSpecifiers_2.push(print6(specifierPath));
|
|
16181
16181
|
} else {
|
|
16182
|
-
bracedSpecifiers_2.push(
|
|
16182
|
+
bracedSpecifiers_2.push(print6(specifierPath));
|
|
16183
16183
|
}
|
|
16184
16184
|
}, "specifiers");
|
|
16185
16185
|
unbracedSpecifiers_2.forEach(function(lines2, i2) {
|
|
@@ -16208,10 +16208,10 @@ var require_printer2 = __commonJS({
|
|
|
16208
16208
|
}
|
|
16209
16209
|
}
|
|
16210
16210
|
} else {
|
|
16211
|
-
parts.push(shouldPrintSpaces ? "{ " : "{", (0, lines_1.fromString)(", ").join(path3.map(
|
|
16211
|
+
parts.push(shouldPrintSpaces ? "{ " : "{", (0, lines_1.fromString)(", ").join(path3.map(print6, "specifiers")), shouldPrintSpaces ? " }" : "}");
|
|
16212
16212
|
}
|
|
16213
16213
|
if (decl.source) {
|
|
16214
|
-
parts.push(" from ", path3.call(
|
|
16214
|
+
parts.push(" from ", path3.call(print6, "source"), maybePrintImportAssertions(path3, options, print6));
|
|
16215
16215
|
}
|
|
16216
16216
|
}
|
|
16217
16217
|
var lines = (0, lines_1.concat)(parts);
|
|
@@ -16229,7 +16229,7 @@ var require_printer2 = __commonJS({
|
|
|
16229
16229
|
}
|
|
16230
16230
|
return (0, lines_1.concat)(parts);
|
|
16231
16231
|
}
|
|
16232
|
-
function printVariance(path3,
|
|
16232
|
+
function printVariance(path3, print6) {
|
|
16233
16233
|
return path3.call(function(variancePath) {
|
|
16234
16234
|
var value = variancePath.getValue();
|
|
16235
16235
|
if (value) {
|
|
@@ -16239,7 +16239,7 @@ var require_printer2 = __commonJS({
|
|
|
16239
16239
|
if (value === "minus") {
|
|
16240
16240
|
return (0, lines_1.fromString)("-");
|
|
16241
16241
|
}
|
|
16242
|
-
return
|
|
16242
|
+
return print6(variancePath);
|
|
16243
16243
|
}
|
|
16244
16244
|
return (0, lines_1.fromString)("");
|
|
16245
16245
|
}, "variance");
|
|
@@ -16326,10 +16326,10 @@ var require_main4 = __commonJS({
|
|
|
16326
16326
|
Object.defineProperty(exports, "visit", { enumerable: true, get: function() {
|
|
16327
16327
|
return ast_types_1.visit;
|
|
16328
16328
|
} });
|
|
16329
|
-
function
|
|
16329
|
+
function print6(node, options) {
|
|
16330
16330
|
return new printer_1.Printer(options).print(node);
|
|
16331
16331
|
}
|
|
16332
|
-
exports.print =
|
|
16332
|
+
exports.print = print6;
|
|
16333
16333
|
function prettyPrint(node, options) {
|
|
16334
16334
|
return new printer_1.Printer(options).printGenerically(node);
|
|
16335
16335
|
}
|
|
@@ -16353,7 +16353,7 @@ var require_main4 = __commonJS({
|
|
|
16353
16353
|
function runString(code, transformer, options) {
|
|
16354
16354
|
var writeback = options && options.writeback || defaultWriteback;
|
|
16355
16355
|
transformer((0, parser_1.parse)(code, options), function(node) {
|
|
16356
|
-
writeback(
|
|
16356
|
+
writeback(print6(node, options).code);
|
|
16357
16357
|
});
|
|
16358
16358
|
}
|
|
16359
16359
|
}
|
|
@@ -16419,6 +16419,7 @@ var import_node_util4 = require("node:util");
|
|
|
16419
16419
|
var graphql3 = __toESM(require("graphql"), 1);
|
|
16420
16420
|
var graphql4 = __toESM(require("graphql"), 1);
|
|
16421
16421
|
var graphql5 = __toESM(require("graphql"), 1);
|
|
16422
|
+
var graphql6 = __toESM(require("graphql"), 1);
|
|
16422
16423
|
var import_meta = {};
|
|
16423
16424
|
var require2 = (0, import_module.createRequire)(import_meta.url);
|
|
16424
16425
|
var __create2 = Object.create;
|
|
@@ -29868,14 +29869,14 @@ var require_lib3 = __commonJS2({
|
|
|
29868
29869
|
this.preserveSpace = !!preserveSpace;
|
|
29869
29870
|
}
|
|
29870
29871
|
};
|
|
29871
|
-
var
|
|
29872
|
+
var types5 = {
|
|
29872
29873
|
brace: new TokContext("{"),
|
|
29873
29874
|
j_oTag: new TokContext("<tag"),
|
|
29874
29875
|
j_cTag: new TokContext("</tag"),
|
|
29875
29876
|
j_expr: new TokContext("<tag>...</tag>", true)
|
|
29876
29877
|
};
|
|
29877
29878
|
{
|
|
29878
|
-
|
|
29879
|
+
types5.template = new TokContext("`", true);
|
|
29879
29880
|
}
|
|
29880
29881
|
var beforeExpr = true;
|
|
29881
29882
|
var startsExpr = true;
|
|
@@ -30413,17 +30414,17 @@ var require_lib3 = __commonJS2({
|
|
|
30413
30414
|
context.pop();
|
|
30414
30415
|
};
|
|
30415
30416
|
tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = (context) => {
|
|
30416
|
-
context.push(
|
|
30417
|
+
context.push(types5.brace);
|
|
30417
30418
|
};
|
|
30418
30419
|
tokenTypes[22].updateContext = (context) => {
|
|
30419
|
-
if (context[context.length - 1] ===
|
|
30420
|
+
if (context[context.length - 1] === types5.template) {
|
|
30420
30421
|
context.pop();
|
|
30421
30422
|
} else {
|
|
30422
|
-
context.push(
|
|
30423
|
+
context.push(types5.template);
|
|
30423
30424
|
}
|
|
30424
30425
|
};
|
|
30425
30426
|
tokenTypes[142].updateContext = (context) => {
|
|
30426
|
-
context.push(
|
|
30427
|
+
context.push(types5.j_expr, types5.j_oTag);
|
|
30427
30428
|
};
|
|
30428
30429
|
}
|
|
30429
30430
|
var nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC";
|
|
@@ -30983,7 +30984,7 @@ var require_lib3 = __commonJS2({
|
|
|
30983
30984
|
this.end = 0;
|
|
30984
30985
|
this.lastTokEndLoc = null;
|
|
30985
30986
|
this.lastTokStartLoc = null;
|
|
30986
|
-
this.context = [
|
|
30987
|
+
this.context = [types5.brace];
|
|
30987
30988
|
this.firstInvalidTemplateEscapePos = null;
|
|
30988
30989
|
this.strictErrors = /* @__PURE__ */ new Map();
|
|
30989
30990
|
this.tokensLength = 0;
|
|
@@ -34810,7 +34811,7 @@ var require_lib3 = __commonJS2({
|
|
|
34810
34811
|
context
|
|
34811
34812
|
} = this.state;
|
|
34812
34813
|
const currentContext = context[context.length - 1];
|
|
34813
|
-
if (currentContext ===
|
|
34814
|
+
if (currentContext === types5.j_oTag || currentContext === types5.j_expr) {
|
|
34814
34815
|
context.pop();
|
|
34815
34816
|
}
|
|
34816
34817
|
}
|
|
@@ -35832,9 +35833,9 @@ var require_lib3 = __commonJS2({
|
|
|
35832
35833
|
switch (this.state.type) {
|
|
35833
35834
|
case 5:
|
|
35834
35835
|
node = this.startNode();
|
|
35835
|
-
this.setContext(
|
|
35836
|
+
this.setContext(types5.brace);
|
|
35836
35837
|
this.next();
|
|
35837
|
-
node = this.jsxParseExpressionContainer(node,
|
|
35838
|
+
node = this.jsxParseExpressionContainer(node, types5.j_oTag);
|
|
35838
35839
|
if (node.expression.type === "JSXEmptyExpression") {
|
|
35839
35840
|
this.raise(JsxErrors.AttributeIsEmpty, node);
|
|
35840
35841
|
}
|
|
@@ -35853,7 +35854,7 @@ var require_lib3 = __commonJS2({
|
|
|
35853
35854
|
jsxParseSpreadChild(node) {
|
|
35854
35855
|
this.next();
|
|
35855
35856
|
node.expression = this.parseExpression();
|
|
35856
|
-
this.setContext(
|
|
35857
|
+
this.setContext(types5.j_expr);
|
|
35857
35858
|
this.state.canStartJSXElement = true;
|
|
35858
35859
|
this.expect(8);
|
|
35859
35860
|
return this.finishNode(node, "JSXSpreadChild");
|
|
@@ -35873,11 +35874,11 @@ var require_lib3 = __commonJS2({
|
|
|
35873
35874
|
jsxParseAttribute() {
|
|
35874
35875
|
const node = this.startNode();
|
|
35875
35876
|
if (this.match(5)) {
|
|
35876
|
-
this.setContext(
|
|
35877
|
+
this.setContext(types5.brace);
|
|
35877
35878
|
this.next();
|
|
35878
35879
|
this.expect(21);
|
|
35879
35880
|
node.argument = this.parseMaybeAssignAllowIn();
|
|
35880
|
-
this.setContext(
|
|
35881
|
+
this.setContext(types5.j_oTag);
|
|
35881
35882
|
this.state.canStartJSXElement = true;
|
|
35882
35883
|
this.expect(8);
|
|
35883
35884
|
return this.finishNode(node, "JSXSpreadAttribute");
|
|
@@ -35936,12 +35937,12 @@ var require_lib3 = __commonJS2({
|
|
|
35936
35937
|
break;
|
|
35937
35938
|
case 5: {
|
|
35938
35939
|
const node2 = this.startNode();
|
|
35939
|
-
this.setContext(
|
|
35940
|
+
this.setContext(types5.brace);
|
|
35940
35941
|
this.next();
|
|
35941
35942
|
if (this.match(21)) {
|
|
35942
35943
|
children.push(this.jsxParseSpreadChild(node2));
|
|
35943
35944
|
} else {
|
|
35944
|
-
children.push(this.jsxParseExpressionContainer(node2,
|
|
35945
|
+
children.push(this.jsxParseExpressionContainer(node2, types5.j_expr));
|
|
35945
35946
|
}
|
|
35946
35947
|
break;
|
|
35947
35948
|
}
|
|
@@ -36006,11 +36007,11 @@ var require_lib3 = __commonJS2({
|
|
|
36006
36007
|
}
|
|
36007
36008
|
getTokenFromCode(code2) {
|
|
36008
36009
|
const context = this.curContext();
|
|
36009
|
-
if (context ===
|
|
36010
|
+
if (context === types5.j_expr) {
|
|
36010
36011
|
this.jsxReadToken();
|
|
36011
36012
|
return;
|
|
36012
36013
|
}
|
|
36013
|
-
if (context ===
|
|
36014
|
+
if (context === types5.j_oTag || context === types5.j_cTag) {
|
|
36014
36015
|
if (isIdentifierStart(code2)) {
|
|
36015
36016
|
this.jsxReadWord();
|
|
36016
36017
|
return;
|
|
@@ -36020,7 +36021,7 @@ var require_lib3 = __commonJS2({
|
|
|
36020
36021
|
this.finishToken(143);
|
|
36021
36022
|
return;
|
|
36022
36023
|
}
|
|
36023
|
-
if ((code2 === 34 || code2 === 39) && context ===
|
|
36024
|
+
if ((code2 === 34 || code2 === 39) && context === types5.j_oTag) {
|
|
36024
36025
|
this.jsxReadString(code2);
|
|
36025
36026
|
return;
|
|
36026
36027
|
}
|
|
@@ -36038,17 +36039,17 @@ var require_lib3 = __commonJS2({
|
|
|
36038
36039
|
type
|
|
36039
36040
|
} = this.state;
|
|
36040
36041
|
if (type === 56 && prevType === 142) {
|
|
36041
|
-
context.splice(-2, 2,
|
|
36042
|
+
context.splice(-2, 2, types5.j_cTag);
|
|
36042
36043
|
this.state.canStartJSXElement = false;
|
|
36043
36044
|
} else if (type === 142) {
|
|
36044
|
-
context.push(
|
|
36045
|
+
context.push(types5.j_oTag);
|
|
36045
36046
|
} else if (type === 143) {
|
|
36046
36047
|
const out = context[context.length - 1];
|
|
36047
|
-
if (out ===
|
|
36048
|
+
if (out === types5.j_oTag && prevType === 56 || out === types5.j_cTag) {
|
|
36048
36049
|
context.pop();
|
|
36049
|
-
this.state.canStartJSXElement = context[context.length - 1] ===
|
|
36050
|
+
this.state.canStartJSXElement = context[context.length - 1] === types5.j_expr;
|
|
36050
36051
|
} else {
|
|
36051
|
-
this.setContext(
|
|
36052
|
+
this.setContext(types5.j_expr);
|
|
36052
36053
|
this.state.canStartJSXElement = true;
|
|
36053
36054
|
}
|
|
36054
36055
|
} else {
|
|
@@ -37423,14 +37424,14 @@ var require_lib3 = __commonJS2({
|
|
|
37423
37424
|
tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
|
|
37424
37425
|
const node = this.startNode();
|
|
37425
37426
|
const hasLeadingOperator = this.eat(operator);
|
|
37426
|
-
const
|
|
37427
|
+
const types6 = [];
|
|
37427
37428
|
do {
|
|
37428
|
-
|
|
37429
|
+
types6.push(parseConstituentType());
|
|
37429
37430
|
} while (this.eat(operator));
|
|
37430
|
-
if (
|
|
37431
|
-
return
|
|
37431
|
+
if (types6.length === 1 && !hasLeadingOperator) {
|
|
37432
|
+
return types6[0];
|
|
37432
37433
|
}
|
|
37433
|
-
node.types =
|
|
37434
|
+
node.types = types6;
|
|
37434
37435
|
return this.finishNode(node, kind);
|
|
37435
37436
|
}
|
|
37436
37437
|
tsParseIntersectionTypeOrHigher() {
|
|
@@ -37994,7 +37995,7 @@ var require_lib3 = __commonJS2({
|
|
|
37994
37995
|
}));
|
|
37995
37996
|
if (node.params.length === 0) {
|
|
37996
37997
|
this.raise(TSErrors.EmptyTypeArguments, node);
|
|
37997
|
-
} else if (!this.state.inType && this.curContext() ===
|
|
37998
|
+
} else if (!this.state.inType && this.curContext() === types5.brace) {
|
|
37998
37999
|
this.reScan_lt_gt();
|
|
37999
38000
|
}
|
|
38000
38001
|
this.expect(48);
|
|
@@ -38620,7 +38621,7 @@ var require_lib3 = __commonJS2({
|
|
|
38620
38621
|
context
|
|
38621
38622
|
} = this.state;
|
|
38622
38623
|
const currentContext = context[context.length - 1];
|
|
38623
|
-
if (currentContext ===
|
|
38624
|
+
if (currentContext === types5.j_oTag || currentContext === types5.j_expr) {
|
|
38624
38625
|
context.pop();
|
|
38625
38626
|
}
|
|
38626
38627
|
}
|
|
@@ -43748,9 +43749,9 @@ var require_shared = __commonJS2({
|
|
|
43748
43749
|
var tslib_1 = require_tslib();
|
|
43749
43750
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
43750
43751
|
function default_1(fork) {
|
|
43751
|
-
var
|
|
43752
|
-
var Type =
|
|
43753
|
-
var builtin =
|
|
43752
|
+
var types5 = fork.use(types_1.default);
|
|
43753
|
+
var Type = types5.Type;
|
|
43754
|
+
var builtin = types5.builtInTypes;
|
|
43754
43755
|
var isNumber = builtin.number;
|
|
43755
43756
|
function geq(than) {
|
|
43756
43757
|
return Type.from(function(value) {
|
|
@@ -43898,9 +43899,9 @@ var require_types = __commonJS2({
|
|
|
43898
43899
|
}(BaseType);
|
|
43899
43900
|
var OrType = function(_super) {
|
|
43900
43901
|
tslib_1.__extends(OrType2, _super);
|
|
43901
|
-
function OrType2(
|
|
43902
|
+
function OrType2(types5) {
|
|
43902
43903
|
var _this = _super.call(this) || this;
|
|
43903
|
-
_this.types =
|
|
43904
|
+
_this.types = types5;
|
|
43904
43905
|
_this.kind = "OrType";
|
|
43905
43906
|
return _this;
|
|
43906
43907
|
}
|
|
@@ -44041,11 +44042,11 @@ var require_types = __commonJS2({
|
|
|
44041
44042
|
function typesPlugin(_fork) {
|
|
44042
44043
|
var Type = {
|
|
44043
44044
|
or: function() {
|
|
44044
|
-
var
|
|
44045
|
+
var types5 = [];
|
|
44045
44046
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
44046
|
-
|
|
44047
|
+
types5[_i] = arguments[_i];
|
|
44047
44048
|
}
|
|
44048
|
-
return new OrType(
|
|
44049
|
+
return new OrType(types5.map(function(type) {
|
|
44049
44050
|
return Type.from(type);
|
|
44050
44051
|
}));
|
|
44051
44052
|
},
|
|
@@ -44488,9 +44489,9 @@ var require_path2 = __commonJS2({
|
|
|
44488
44489
|
var Op = Object.prototype;
|
|
44489
44490
|
var hasOwn = Op.hasOwnProperty;
|
|
44490
44491
|
function pathPlugin(fork) {
|
|
44491
|
-
var
|
|
44492
|
-
var isArray =
|
|
44493
|
-
var isNumber =
|
|
44492
|
+
var types5 = fork.use(types_1.default);
|
|
44493
|
+
var isArray = types5.builtInTypes.array;
|
|
44494
|
+
var isNumber = types5.builtInTypes.number;
|
|
44494
44495
|
var Path = function Path2(value, parentPath, name) {
|
|
44495
44496
|
if (!(this instanceof Path2)) {
|
|
44496
44497
|
throw new Error("Path constructor cannot be invoked without 'new'");
|
|
@@ -44790,13 +44791,13 @@ var require_scope = __commonJS2({
|
|
|
44790
44791
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
44791
44792
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
44792
44793
|
function scopePlugin(fork) {
|
|
44793
|
-
var
|
|
44794
|
-
var Type =
|
|
44795
|
-
var namedTypes =
|
|
44794
|
+
var types5 = fork.use(types_1.default);
|
|
44795
|
+
var Type = types5.Type;
|
|
44796
|
+
var namedTypes = types5.namedTypes;
|
|
44796
44797
|
var Node = namedTypes.Node;
|
|
44797
44798
|
var Expression = namedTypes.Expression;
|
|
44798
|
-
var isArray =
|
|
44799
|
-
var b =
|
|
44799
|
+
var isArray = types5.builtInTypes.array;
|
|
44800
|
+
var b = types5.builders;
|
|
44800
44801
|
var Scope = function Scope2(path3, parentScope) {
|
|
44801
44802
|
if (!(this instanceof Scope2)) {
|
|
44802
44803
|
throw new Error("Scope constructor cannot be invoked without 'new'");
|
|
@@ -44859,7 +44860,7 @@ var require_scope = __commonJS2({
|
|
|
44859
44860
|
++index;
|
|
44860
44861
|
}
|
|
44861
44862
|
var name = prefix + index;
|
|
44862
|
-
return this.bindings[name] =
|
|
44863
|
+
return this.bindings[name] = types5.builders.identifier(name);
|
|
44863
44864
|
};
|
|
44864
44865
|
Sp.injectTemporary = function(identifier, init) {
|
|
44865
44866
|
identifier || (identifier = this.declareTemporary());
|
|
@@ -44935,7 +44936,7 @@ var require_scope = __commonJS2({
|
|
|
44935
44936
|
bindings
|
|
44936
44937
|
);
|
|
44937
44938
|
} else if (Node.check(node) && !Expression.check(node)) {
|
|
44938
|
-
|
|
44939
|
+
types5.eachField(node, function(name, child) {
|
|
44939
44940
|
var childPath = path3.get(name);
|
|
44940
44941
|
if (!pathHasValue(childPath, child)) {
|
|
44941
44942
|
throw new Error("");
|
|
@@ -45013,24 +45014,24 @@ var require_scope = __commonJS2({
|
|
|
45013
45014
|
addPattern(patternPath.get("argument"), bindings);
|
|
45014
45015
|
}
|
|
45015
45016
|
}
|
|
45016
|
-
function addTypePattern(patternPath,
|
|
45017
|
+
function addTypePattern(patternPath, types6) {
|
|
45017
45018
|
var pattern = patternPath.value;
|
|
45018
45019
|
namedTypes.Pattern.assert(pattern);
|
|
45019
45020
|
if (namedTypes.Identifier.check(pattern)) {
|
|
45020
|
-
if (hasOwn.call(
|
|
45021
|
-
|
|
45021
|
+
if (hasOwn.call(types6, pattern.name)) {
|
|
45022
|
+
types6[pattern.name].push(patternPath);
|
|
45022
45023
|
} else {
|
|
45023
|
-
|
|
45024
|
+
types6[pattern.name] = [patternPath];
|
|
45024
45025
|
}
|
|
45025
45026
|
}
|
|
45026
45027
|
}
|
|
45027
|
-
function addTypeParameter(parameterPath,
|
|
45028
|
+
function addTypeParameter(parameterPath, types6) {
|
|
45028
45029
|
var parameter = parameterPath.value;
|
|
45029
45030
|
FlowOrTSTypeParameterType.assert(parameter);
|
|
45030
|
-
if (hasOwn.call(
|
|
45031
|
-
|
|
45031
|
+
if (hasOwn.call(types6, parameter.name)) {
|
|
45032
|
+
types6[parameter.name].push(parameterPath);
|
|
45032
45033
|
} else {
|
|
45033
|
-
|
|
45034
|
+
types6[parameter.name] = [parameterPath];
|
|
45034
45035
|
}
|
|
45035
45036
|
}
|
|
45036
45037
|
Sp.lookup = function(name) {
|
|
@@ -45069,11 +45070,11 @@ var require_node_path = __commonJS2({
|
|
|
45069
45070
|
var scope_1 = tslib_1.__importDefault(require_scope());
|
|
45070
45071
|
var shared_1 = require_shared();
|
|
45071
45072
|
function nodePathPlugin(fork) {
|
|
45072
|
-
var
|
|
45073
|
-
var n =
|
|
45074
|
-
var b =
|
|
45075
|
-
var isNumber =
|
|
45076
|
-
var isArray =
|
|
45073
|
+
var types5 = fork.use(types_1.default);
|
|
45074
|
+
var n = types5.namedTypes;
|
|
45075
|
+
var b = types5.builders;
|
|
45076
|
+
var isNumber = types5.builtInTypes.number;
|
|
45077
|
+
var isArray = types5.builtInTypes.array;
|
|
45077
45078
|
var Path = fork.use(path_1.default);
|
|
45078
45079
|
var Scope = fork.use(scope_1.default);
|
|
45079
45080
|
var NodePath = function NodePath2(value, parentPath, name) {
|
|
@@ -45164,7 +45165,7 @@ var require_node_path = __commonJS2({
|
|
|
45164
45165
|
return scope || null;
|
|
45165
45166
|
};
|
|
45166
45167
|
NPp.getValueProperty = function(name) {
|
|
45167
|
-
return
|
|
45168
|
+
return types5.getFieldValue(this.value, name);
|
|
45168
45169
|
};
|
|
45169
45170
|
NPp.needsParens = function(assumeExpressionContext) {
|
|
45170
45171
|
var pp = this.parentPath;
|
|
@@ -45306,7 +45307,7 @@ var require_node_path = __commonJS2({
|
|
|
45306
45307
|
return node.some(containsCallExpression);
|
|
45307
45308
|
}
|
|
45308
45309
|
if (n.Node.check(node)) {
|
|
45309
|
-
return
|
|
45310
|
+
return types5.someField(node, function(_name, child) {
|
|
45310
45311
|
return containsCallExpression(child);
|
|
45311
45312
|
});
|
|
45312
45313
|
}
|
|
@@ -45425,11 +45426,11 @@ var require_path_visitor = __commonJS2({
|
|
|
45425
45426
|
var shared_1 = require_shared();
|
|
45426
45427
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
45427
45428
|
function pathVisitorPlugin(fork) {
|
|
45428
|
-
var
|
|
45429
|
+
var types5 = fork.use(types_1.default);
|
|
45429
45430
|
var NodePath = fork.use(node_path_1.default);
|
|
45430
|
-
var isArray =
|
|
45431
|
-
var isObject2 =
|
|
45432
|
-
var isFunction =
|
|
45431
|
+
var isArray = types5.builtInTypes.array;
|
|
45432
|
+
var isObject2 = types5.builtInTypes.object;
|
|
45433
|
+
var isFunction = types5.builtInTypes.function;
|
|
45433
45434
|
var undefined2;
|
|
45434
45435
|
var PathVisitor = function PathVisitor2() {
|
|
45435
45436
|
if (!(this instanceof PathVisitor2)) {
|
|
@@ -45449,7 +45450,7 @@ var require_path_visitor = __commonJS2({
|
|
|
45449
45450
|
typeNames[methodName.slice("visit".length)] = true;
|
|
45450
45451
|
}
|
|
45451
45452
|
}
|
|
45452
|
-
var supertypeTable =
|
|
45453
|
+
var supertypeTable = types5.computeSupertypeLookupTable(typeNames);
|
|
45453
45454
|
var methodNameTable = /* @__PURE__ */ Object.create(null);
|
|
45454
45455
|
var typeNameKeys = Object.keys(supertypeTable);
|
|
45455
45456
|
var typeNameCount = typeNameKeys.length;
|
|
@@ -45568,7 +45569,7 @@ var require_path_visitor = __commonJS2({
|
|
|
45568
45569
|
path3.each(visitor.visitWithoutReset, visitor);
|
|
45569
45570
|
} else if (!isObject2.check(value)) {
|
|
45570
45571
|
} else {
|
|
45571
|
-
var childNames =
|
|
45572
|
+
var childNames = types5.getFieldNames(value);
|
|
45572
45573
|
if (visitor._shouldVisitComments && value.comments && childNames.indexOf("comments") < 0) {
|
|
45573
45574
|
childNames.push("comments");
|
|
45574
45575
|
}
|
|
@@ -45577,7 +45578,7 @@ var require_path_visitor = __commonJS2({
|
|
|
45577
45578
|
for (var i2 = 0; i2 < childCount; ++i2) {
|
|
45578
45579
|
var childName = childNames[i2];
|
|
45579
45580
|
if (!hasOwn.call(value, childName)) {
|
|
45580
|
-
value[childName] =
|
|
45581
|
+
value[childName] = types5.getFieldValue(value, childName);
|
|
45581
45582
|
}
|
|
45582
45583
|
childPaths.push(path3.get(childName));
|
|
45583
45584
|
}
|
|
@@ -45718,13 +45719,13 @@ var require_equiv = __commonJS2({
|
|
|
45718
45719
|
var shared_1 = require_shared();
|
|
45719
45720
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
45720
45721
|
function default_1(fork) {
|
|
45721
|
-
var
|
|
45722
|
-
var getFieldNames =
|
|
45723
|
-
var getFieldValue =
|
|
45724
|
-
var isArray =
|
|
45725
|
-
var isObject2 =
|
|
45726
|
-
var isDate =
|
|
45727
|
-
var isRegExp =
|
|
45722
|
+
var types5 = fork.use(types_1.default);
|
|
45723
|
+
var getFieldNames = types5.getFieldNames;
|
|
45724
|
+
var getFieldValue = types5.getFieldValue;
|
|
45725
|
+
var isArray = types5.builtInTypes.array;
|
|
45726
|
+
var isObject2 = types5.builtInTypes.object;
|
|
45727
|
+
var isDate = types5.builtInTypes.Date;
|
|
45728
|
+
var isRegExp = types5.builtInTypes.RegExp;
|
|
45728
45729
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
45729
45730
|
function astNodesAreEquivalent(a, b, problemPath) {
|
|
45730
45731
|
if (isArray.check(problemPath)) {
|
|
@@ -45875,24 +45876,24 @@ var require_fork = __commonJS2({
|
|
|
45875
45876
|
var shared_1 = require_shared();
|
|
45876
45877
|
function default_1(plugins2) {
|
|
45877
45878
|
var fork = createFork();
|
|
45878
|
-
var
|
|
45879
|
+
var types5 = fork.use(types_1.default);
|
|
45879
45880
|
plugins2.forEach(fork.use);
|
|
45880
|
-
|
|
45881
|
+
types5.finalize();
|
|
45881
45882
|
var PathVisitor = fork.use(path_visitor_1.default);
|
|
45882
45883
|
return {
|
|
45883
|
-
Type:
|
|
45884
|
-
builtInTypes:
|
|
45885
|
-
namedTypes:
|
|
45886
|
-
builders:
|
|
45887
|
-
defineMethod:
|
|
45888
|
-
getFieldNames:
|
|
45889
|
-
getFieldValue:
|
|
45890
|
-
eachField:
|
|
45891
|
-
someField:
|
|
45892
|
-
getSupertypeNames:
|
|
45893
|
-
getBuilderName:
|
|
45884
|
+
Type: types5.Type,
|
|
45885
|
+
builtInTypes: types5.builtInTypes,
|
|
45886
|
+
namedTypes: types5.namedTypes,
|
|
45887
|
+
builders: types5.builders,
|
|
45888
|
+
defineMethod: types5.defineMethod,
|
|
45889
|
+
getFieldNames: types5.getFieldNames,
|
|
45890
|
+
getFieldValue: types5.getFieldValue,
|
|
45891
|
+
eachField: types5.eachField,
|
|
45892
|
+
someField: types5.someField,
|
|
45893
|
+
getSupertypeNames: types5.getSupertypeNames,
|
|
45894
|
+
getBuilderName: types5.getBuilderName,
|
|
45894
45895
|
astNodesAreEquivalent: fork.use(equiv_1.default),
|
|
45895
|
-
finalize:
|
|
45896
|
+
finalize: types5.finalize,
|
|
45896
45897
|
Path: fork.use(path_1.default),
|
|
45897
45898
|
NodePath: fork.use(node_path_1.default),
|
|
45898
45899
|
PathVisitor,
|
|
@@ -46052,8 +46053,8 @@ var require_core2 = __commonJS2({
|
|
|
46052
46053
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
46053
46054
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46054
46055
|
function default_1(fork) {
|
|
46055
|
-
var
|
|
46056
|
-
var Type =
|
|
46056
|
+
var types5 = fork.use(types_1.default);
|
|
46057
|
+
var Type = types5.Type;
|
|
46057
46058
|
var def = Type.def;
|
|
46058
46059
|
var or = Type.or;
|
|
46059
46060
|
var shared = fork.use(shared_1.default);
|
|
@@ -46143,9 +46144,9 @@ var require_es6 = __commonJS2({
|
|
|
46143
46144
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46144
46145
|
function default_1(fork) {
|
|
46145
46146
|
fork.use(core_1.default);
|
|
46146
|
-
var
|
|
46147
|
-
var def =
|
|
46148
|
-
var or =
|
|
46147
|
+
var types5 = fork.use(types_1.default);
|
|
46148
|
+
var def = types5.Type.def;
|
|
46149
|
+
var or = types5.Type.or;
|
|
46149
46150
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46150
46151
|
def("Function").field("generator", Boolean, defaults["false"]).field("expression", Boolean, defaults["false"]).field("defaults", [or(def("Expression"), null)], defaults.emptyArray).field("rest", or(def("Identifier"), null), defaults["null"]);
|
|
46151
46152
|
def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field(
|
|
@@ -46231,8 +46232,8 @@ var require_es2017 = __commonJS2({
|
|
|
46231
46232
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46232
46233
|
function default_1(fork) {
|
|
46233
46234
|
fork.use(es2016_1.default);
|
|
46234
|
-
var
|
|
46235
|
-
var def =
|
|
46235
|
+
var types5 = fork.use(types_1.default);
|
|
46236
|
+
var def = types5.Type.def;
|
|
46236
46237
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46237
46238
|
def("Function").field("async", Boolean, defaults["false"]);
|
|
46238
46239
|
def("AwaitExpression").bases("Expression").build("argument").field("argument", def("Expression"));
|
|
@@ -46253,9 +46254,9 @@ var require_es2018 = __commonJS2({
|
|
|
46253
46254
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46254
46255
|
function default_1(fork) {
|
|
46255
46256
|
fork.use(es2017_1.default);
|
|
46256
|
-
var
|
|
46257
|
-
var def =
|
|
46258
|
-
var or =
|
|
46257
|
+
var types5 = fork.use(types_1.default);
|
|
46258
|
+
var def = types5.Type.def;
|
|
46259
|
+
var or = types5.Type.or;
|
|
46259
46260
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46260
46261
|
def("ForOfStatement").field("await", Boolean, defaults["false"]);
|
|
46261
46262
|
def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
|
|
@@ -46284,9 +46285,9 @@ var require_es2019 = __commonJS2({
|
|
|
46284
46285
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46285
46286
|
function default_1(fork) {
|
|
46286
46287
|
fork.use(es2018_1.default);
|
|
46287
|
-
var
|
|
46288
|
-
var def =
|
|
46289
|
-
var or =
|
|
46288
|
+
var types5 = fork.use(types_1.default);
|
|
46289
|
+
var def = types5.Type.def;
|
|
46290
|
+
var or = types5.Type.or;
|
|
46290
46291
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46291
46292
|
def("CatchClause").field("param", or(def("Pattern"), null), defaults["null"]);
|
|
46292
46293
|
}
|
|
@@ -46308,9 +46309,9 @@ var require_es20202 = __commonJS2({
|
|
|
46308
46309
|
function default_1(fork) {
|
|
46309
46310
|
fork.use(es2020_1.default);
|
|
46310
46311
|
fork.use(es2019_1.default);
|
|
46311
|
-
var
|
|
46312
|
-
var def =
|
|
46313
|
-
var or =
|
|
46312
|
+
var types5 = fork.use(types_1.default);
|
|
46313
|
+
var def = types5.Type.def;
|
|
46314
|
+
var or = types5.Type.or;
|
|
46314
46315
|
var shared = fork.use(shared_1.default);
|
|
46315
46316
|
var defaults = shared.defaults;
|
|
46316
46317
|
def("ImportExpression").bases("Expression").build("source").field("source", def("Expression"));
|
|
@@ -46356,8 +46357,8 @@ var require_es2022 = __commonJS2({
|
|
|
46356
46357
|
var shared_1 = require_shared();
|
|
46357
46358
|
function default_1(fork) {
|
|
46358
46359
|
fork.use(es2021_1.default);
|
|
46359
|
-
var
|
|
46360
|
-
var def =
|
|
46360
|
+
var types5 = fork.use(types_1.default);
|
|
46361
|
+
var def = types5.Type.def;
|
|
46361
46362
|
def("StaticBlock").bases("Declaration").build("body").field("body", [def("Statement")]);
|
|
46362
46363
|
}
|
|
46363
46364
|
exports.default = default_1;
|
|
@@ -46376,9 +46377,9 @@ var require_es_proposals = __commonJS2({
|
|
|
46376
46377
|
var es2022_1 = tslib_1.__importDefault(require_es2022());
|
|
46377
46378
|
function default_1(fork) {
|
|
46378
46379
|
fork.use(es2022_1.default);
|
|
46379
|
-
var
|
|
46380
|
-
var Type =
|
|
46381
|
-
var def =
|
|
46380
|
+
var types5 = fork.use(types_1.default);
|
|
46381
|
+
var Type = types5.Type;
|
|
46382
|
+
var def = types5.Type.def;
|
|
46382
46383
|
var or = Type.or;
|
|
46383
46384
|
var shared = fork.use(shared_1.default);
|
|
46384
46385
|
var defaults = shared.defaults;
|
|
@@ -46416,9 +46417,9 @@ var require_jsx = __commonJS2({
|
|
|
46416
46417
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46417
46418
|
function default_1(fork) {
|
|
46418
46419
|
fork.use(es_proposals_1.default);
|
|
46419
|
-
var
|
|
46420
|
-
var def =
|
|
46421
|
-
var or =
|
|
46420
|
+
var types5 = fork.use(types_1.default);
|
|
46421
|
+
var def = types5.Type.def;
|
|
46422
|
+
var or = types5.Type.or;
|
|
46422
46423
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46423
46424
|
def("JSXAttribute").bases("Node").build("name", "value").field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or(
|
|
46424
46425
|
def("Literal"),
|
|
@@ -46474,9 +46475,9 @@ var require_type_annotations = __commonJS2({
|
|
|
46474
46475
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
46475
46476
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46476
46477
|
function default_1(fork) {
|
|
46477
|
-
var
|
|
46478
|
-
var def =
|
|
46479
|
-
var or =
|
|
46478
|
+
var types5 = fork.use(types_1.default);
|
|
46479
|
+
var def = types5.Type.def;
|
|
46480
|
+
var or = types5.Type.or;
|
|
46480
46481
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46481
46482
|
var TypeAnnotation = or(def("TypeAnnotation"), def("TSTypeAnnotation"), null);
|
|
46482
46483
|
var TypeParamDecl = or(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null);
|
|
@@ -46509,9 +46510,9 @@ var require_flow = __commonJS2({
|
|
|
46509
46510
|
function default_1(fork) {
|
|
46510
46511
|
fork.use(es_proposals_1.default);
|
|
46511
46512
|
fork.use(type_annotations_1.default);
|
|
46512
|
-
var
|
|
46513
|
-
var def =
|
|
46514
|
-
var or =
|
|
46513
|
+
var types5 = fork.use(types_1.default);
|
|
46514
|
+
var def = types5.Type.def;
|
|
46515
|
+
var or = types5.Type.or;
|
|
46515
46516
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46516
46517
|
def("Flow").bases("Node");
|
|
46517
46518
|
def("FlowType").bases("Flow");
|
|
@@ -46623,10 +46624,10 @@ var require_esprima = __commonJS2({
|
|
|
46623
46624
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46624
46625
|
function default_1(fork) {
|
|
46625
46626
|
fork.use(es_proposals_1.default);
|
|
46626
|
-
var
|
|
46627
|
+
var types5 = fork.use(types_1.default);
|
|
46627
46628
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46628
|
-
var def =
|
|
46629
|
-
var or =
|
|
46629
|
+
var def = types5.Type.def;
|
|
46630
|
+
var or = types5.Type.or;
|
|
46630
46631
|
def("VariableDeclaration").field("declarations", [or(
|
|
46631
46632
|
def("VariableDeclarator"),
|
|
46632
46633
|
def("Identifier")
|
|
@@ -46669,11 +46670,11 @@ var require_babel_core = __commonJS2({
|
|
|
46669
46670
|
function default_1(fork) {
|
|
46670
46671
|
var _a, _b, _c, _d, _e;
|
|
46671
46672
|
fork.use(es_proposals_1.default);
|
|
46672
|
-
var
|
|
46673
|
+
var types5 = fork.use(types_1.default);
|
|
46673
46674
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46674
|
-
var def =
|
|
46675
|
-
var or =
|
|
46676
|
-
var isUndefined =
|
|
46675
|
+
var def = types5.Type.def;
|
|
46676
|
+
var or = types5.Type.or;
|
|
46677
|
+
var isUndefined = types5.builtInTypes.undefined;
|
|
46677
46678
|
def("Noop").bases("Statement").build();
|
|
46678
46679
|
def("DoExpression").bases("Expression").build("body").field("body", [def("Statement")]);
|
|
46679
46680
|
def("BindExpression").bases("Expression").build("object", "callee").field("object", or(def("Expression"), null)).field("callee", def("Expression"));
|
|
@@ -46698,7 +46699,7 @@ var require_babel_core = __commonJS2({
|
|
|
46698
46699
|
raw: String
|
|
46699
46700
|
},
|
|
46700
46701
|
function getDefault() {
|
|
46701
|
-
var value =
|
|
46702
|
+
var value = types5.getFieldValue(this, "value");
|
|
46702
46703
|
return {
|
|
46703
46704
|
rawValue: value,
|
|
46704
46705
|
raw: toRaw ? toRaw(value) : String(value)
|
|
@@ -46799,8 +46800,8 @@ var require_babel = __commonJS2({
|
|
|
46799
46800
|
var flow_1 = tslib_1.__importDefault(require_flow());
|
|
46800
46801
|
var shared_1 = require_shared();
|
|
46801
46802
|
function default_1(fork) {
|
|
46802
|
-
var
|
|
46803
|
-
var def =
|
|
46803
|
+
var types5 = fork.use(types_1.default);
|
|
46804
|
+
var def = types5.Type.def;
|
|
46804
46805
|
fork.use(babel_core_1.default);
|
|
46805
46806
|
fork.use(flow_1.default);
|
|
46806
46807
|
def("V8IntrinsicIdentifier").bases("Expression").build("name").field("name", String);
|
|
@@ -46824,12 +46825,12 @@ var require_typescript = __commonJS2({
|
|
|
46824
46825
|
function default_1(fork) {
|
|
46825
46826
|
fork.use(babel_core_1.default);
|
|
46826
46827
|
fork.use(type_annotations_1.default);
|
|
46827
|
-
var
|
|
46828
|
-
var n =
|
|
46829
|
-
var def =
|
|
46830
|
-
var or =
|
|
46828
|
+
var types5 = fork.use(types_1.default);
|
|
46829
|
+
var n = types5.namedTypes;
|
|
46830
|
+
var def = types5.Type.def;
|
|
46831
|
+
var or = types5.Type.or;
|
|
46831
46832
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46832
|
-
var StringLiteral =
|
|
46833
|
+
var StringLiteral = types5.Type.from(function(value, deep) {
|
|
46833
46834
|
if (n.StringLiteral && n.StringLiteral.check(value, deep)) {
|
|
46834
46835
|
return true;
|
|
46835
46836
|
}
|
|
@@ -48777,8 +48778,8 @@ var require_util2 = __commonJS2({
|
|
|
48777
48778
|
exports.isTrailingCommaEnabled = exports.getParentExportDeclaration = exports.isExportDeclaration = exports.fixFaultyLocations = exports.getTrueLoc = exports.composeSourceMaps = exports.copyPos = exports.comparePos = exports.getUnionOfKeys = exports.getOption = exports.isBrowser = exports.getLineTerminator = void 0;
|
|
48778
48779
|
var tslib_1 = require_tslib();
|
|
48779
48780
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
48780
|
-
var
|
|
48781
|
-
var n =
|
|
48781
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
48782
|
+
var n = types5.namedTypes;
|
|
48782
48783
|
var source_map_1 = tslib_1.__importDefault(require_source_map());
|
|
48783
48784
|
var SourceMapConsumer = source_map_1.default.SourceMapConsumer;
|
|
48784
48785
|
var SourceMapGenerator = source_map_1.default.SourceMapGenerator;
|
|
@@ -56084,10 +56085,10 @@ var require_comments = __commonJS2({
|
|
|
56084
56085
|
exports.printComments = exports.attach = void 0;
|
|
56085
56086
|
var tslib_1 = require_tslib();
|
|
56086
56087
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
56087
|
-
var
|
|
56088
|
-
var n =
|
|
56089
|
-
var isArray =
|
|
56090
|
-
var isObject2 =
|
|
56088
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
56089
|
+
var n = types5.namedTypes;
|
|
56090
|
+
var isArray = types5.builtInTypes.array;
|
|
56091
|
+
var isObject2 = types5.builtInTypes.object;
|
|
56091
56092
|
var lines_1 = require_lines();
|
|
56092
56093
|
var util_1 = require_util2();
|
|
56093
56094
|
var childNodesCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -56118,7 +56119,7 @@ var require_comments = __commonJS2({
|
|
|
56118
56119
|
if (isArray.check(node)) {
|
|
56119
56120
|
names = Object.keys(node);
|
|
56120
56121
|
} else if (isObject2.check(node)) {
|
|
56121
|
-
names =
|
|
56122
|
+
names = types5.getFieldNames(node);
|
|
56122
56123
|
} else {
|
|
56123
56124
|
return resultArray;
|
|
56124
56125
|
}
|
|
@@ -56296,7 +56297,7 @@ var require_comments = __commonJS2({
|
|
|
56296
56297
|
function printComments(path3, print6) {
|
|
56297
56298
|
var value = path3.getValue();
|
|
56298
56299
|
var innerLines = print6(path3);
|
|
56299
|
-
var comments = n.Node.check(value) &&
|
|
56300
|
+
var comments = n.Node.check(value) && types5.getFieldValue(value, "comments");
|
|
56300
56301
|
if (!comments || comments.length === 0) {
|
|
56301
56302
|
return innerLines;
|
|
56302
56303
|
}
|
|
@@ -56304,8 +56305,8 @@ var require_comments = __commonJS2({
|
|
|
56304
56305
|
var trailingParts = [innerLines];
|
|
56305
56306
|
path3.each(function(commentPath) {
|
|
56306
56307
|
var comment = commentPath.getValue();
|
|
56307
|
-
var leading =
|
|
56308
|
-
var trailing =
|
|
56308
|
+
var leading = types5.getFieldValue(comment, "leading");
|
|
56309
|
+
var trailing = types5.getFieldValue(comment, "trailing");
|
|
56309
56310
|
if (leading || trailing && !(n.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
56310
56311
|
leadingParts.push(printLeadingComment(commentPath, print6));
|
|
56311
56312
|
} else if (trailing) {
|
|
@@ -56325,10 +56326,10 @@ var require_parser = __commonJS2({
|
|
|
56325
56326
|
exports.parse = void 0;
|
|
56326
56327
|
var tslib_1 = require_tslib();
|
|
56327
56328
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
56328
|
-
var
|
|
56329
|
-
var b =
|
|
56330
|
-
var isObject2 =
|
|
56331
|
-
var isArray =
|
|
56329
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
56330
|
+
var b = types5.builders;
|
|
56331
|
+
var isObject2 = types5.builtInTypes.object;
|
|
56332
|
+
var isArray = types5.builtInTypes.array;
|
|
56332
56333
|
var options_1 = require_options();
|
|
56333
56334
|
var lines_1 = require_lines();
|
|
56334
56335
|
var comments_1 = require_comments();
|
|
@@ -56512,11 +56513,11 @@ var require_fast_path = __commonJS2({
|
|
|
56512
56513
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
56513
56514
|
var tslib_1 = require_tslib();
|
|
56514
56515
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
56515
|
-
var
|
|
56516
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
56516
56517
|
var util = tslib_1.__importStar(require_util2());
|
|
56517
|
-
var n =
|
|
56518
|
-
var isArray =
|
|
56519
|
-
var isNumber =
|
|
56518
|
+
var n = types5.namedTypes;
|
|
56519
|
+
var isArray = types5.builtInTypes.array;
|
|
56520
|
+
var isNumber = types5.builtInTypes.number;
|
|
56520
56521
|
var PRECEDENCE = {};
|
|
56521
56522
|
[
|
|
56522
56523
|
["??"],
|
|
@@ -56545,7 +56546,7 @@ var require_fast_path = __commonJS2({
|
|
|
56545
56546
|
if (obj instanceof FastPath) {
|
|
56546
56547
|
return obj.copy();
|
|
56547
56548
|
}
|
|
56548
|
-
if (obj instanceof
|
|
56549
|
+
if (obj instanceof types5.NodePath) {
|
|
56549
56550
|
var copy = Object.create(FastPath.prototype);
|
|
56550
56551
|
var stack = [obj.value];
|
|
56551
56552
|
for (var pp = void 0; pp = obj.parentPath; obj = pp)
|
|
@@ -56856,7 +56857,7 @@ var require_fast_path = __commonJS2({
|
|
|
56856
56857
|
return node.some(containsCallExpression);
|
|
56857
56858
|
}
|
|
56858
56859
|
if (n.Node.check(node)) {
|
|
56859
|
-
return
|
|
56860
|
+
return types5.someField(node, function(_name, child) {
|
|
56860
56861
|
return containsCallExpression(child);
|
|
56861
56862
|
});
|
|
56862
56863
|
}
|
|
@@ -56944,16 +56945,16 @@ var require_patcher = __commonJS2({
|
|
|
56944
56945
|
var tslib_1 = require_tslib();
|
|
56945
56946
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
56946
56947
|
var linesModule = tslib_1.__importStar(require_lines());
|
|
56947
|
-
var
|
|
56948
|
-
var Printable =
|
|
56949
|
-
var Expression =
|
|
56950
|
-
var ReturnStatement =
|
|
56951
|
-
var SourceLocation =
|
|
56948
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
56949
|
+
var Printable = types5.namedTypes.Printable;
|
|
56950
|
+
var Expression = types5.namedTypes.Expression;
|
|
56951
|
+
var ReturnStatement = types5.namedTypes.ReturnStatement;
|
|
56952
|
+
var SourceLocation = types5.namedTypes.SourceLocation;
|
|
56952
56953
|
var util_1 = require_util2();
|
|
56953
56954
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
56954
|
-
var isObject2 =
|
|
56955
|
-
var isArray =
|
|
56956
|
-
var isString =
|
|
56955
|
+
var isObject2 = types5.builtInTypes.object;
|
|
56956
|
+
var isArray = types5.builtInTypes.array;
|
|
56957
|
+
var isString = types5.builtInTypes.string;
|
|
56957
56958
|
var riskyAdjoiningCharExp = /[0-9a-z_$]/i;
|
|
56958
56959
|
var Patcher = function Patcher2(lines) {
|
|
56959
56960
|
assert_1.default.ok(this instanceof Patcher2);
|
|
@@ -57223,8 +57224,8 @@ var require_patcher = __commonJS2({
|
|
|
57223
57224
|
if (k.charAt(0) === "_") {
|
|
57224
57225
|
continue;
|
|
57225
57226
|
}
|
|
57226
|
-
newPath.stack.push(k,
|
|
57227
|
-
oldPath.stack.push(k,
|
|
57227
|
+
newPath.stack.push(k, types5.getFieldValue(newNode, k));
|
|
57228
|
+
oldPath.stack.push(k, types5.getFieldValue(oldNode, k));
|
|
57228
57229
|
var canReprint = findAnyReprints(newPath, oldPath, reprints);
|
|
57229
57230
|
newPath.stack.length -= 2;
|
|
57230
57231
|
oldPath.stack.length -= 2;
|
|
@@ -57246,16 +57247,16 @@ var require_printer = __commonJS2({
|
|
|
57246
57247
|
exports.Printer = void 0;
|
|
57247
57248
|
var tslib_1 = require_tslib();
|
|
57248
57249
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
57249
|
-
var
|
|
57250
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
57250
57251
|
var comments_1 = require_comments();
|
|
57251
57252
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
57252
57253
|
var lines_1 = require_lines();
|
|
57253
57254
|
var options_1 = require_options();
|
|
57254
57255
|
var patcher_1 = require_patcher();
|
|
57255
57256
|
var util = tslib_1.__importStar(require_util2());
|
|
57256
|
-
var namedTypes =
|
|
57257
|
-
var isString =
|
|
57258
|
-
var isObject2 =
|
|
57257
|
+
var namedTypes = types5.namedTypes;
|
|
57258
|
+
var isString = types5.builtInTypes.string;
|
|
57259
|
+
var isObject2 = types5.builtInTypes.object;
|
|
57259
57260
|
var PrintResult = function PrintResult2(code, sourceMap) {
|
|
57260
57261
|
assert_1.default.ok(this instanceof PrintResult2);
|
|
57261
57262
|
isString.assert(code);
|
|
@@ -57417,7 +57418,7 @@ var require_printer = __commonJS2({
|
|
|
57417
57418
|
case "OptionalMemberExpression": {
|
|
57418
57419
|
parts.push(path3.call(print6, "object"));
|
|
57419
57420
|
var property = path3.call(print6, "property");
|
|
57420
|
-
var optional =
|
|
57421
|
+
var optional = types5.getFieldValue(n, "optional");
|
|
57421
57422
|
if (n.computed) {
|
|
57422
57423
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
57423
57424
|
} else {
|
|
@@ -57688,7 +57689,7 @@ var require_printer = __commonJS2({
|
|
|
57688
57689
|
if (n.typeArguments) {
|
|
57689
57690
|
parts.push(path3.call(print6, "typeArguments"));
|
|
57690
57691
|
}
|
|
57691
|
-
if (
|
|
57692
|
+
if (types5.getFieldValue(n, "optional")) {
|
|
57692
57693
|
parts.push("?.");
|
|
57693
57694
|
}
|
|
57694
57695
|
parts.push(printArgumentsList(path3, options, print6));
|
|
@@ -59367,8 +59368,8 @@ var require_printer = __commonJS2({
|
|
|
59367
59368
|
});
|
|
59368
59369
|
}
|
|
59369
59370
|
function getPossibleRaw(node) {
|
|
59370
|
-
var value =
|
|
59371
|
-
var extra =
|
|
59371
|
+
var value = types5.getFieldValue(node, "value");
|
|
59372
|
+
var extra = types5.getFieldValue(node, "extra");
|
|
59372
59373
|
if (extra && typeof extra.raw === "string" && value == extra.rawValue) {
|
|
59373
59374
|
return extra.raw;
|
|
59374
59375
|
}
|
|
@@ -59414,8 +59415,8 @@ var require_main2 = __commonJS2({
|
|
|
59414
59415
|
exports.run = exports.prettyPrint = exports.print = exports.visit = exports.types = exports.parse = void 0;
|
|
59415
59416
|
var tslib_1 = require_tslib();
|
|
59416
59417
|
var fs_1 = tslib_1.__importDefault(__require("fs"));
|
|
59417
|
-
var
|
|
59418
|
-
exports.types =
|
|
59418
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
59419
|
+
exports.types = types5;
|
|
59419
59420
|
var parser_1 = require_parser();
|
|
59420
59421
|
Object.defineProperty(exports, "parse", { enumerable: true, get: function() {
|
|
59421
59422
|
return parser_1.parse;
|
|
@@ -63805,30 +63806,30 @@ var require_utils3 = __commonJS2({
|
|
|
63805
63806
|
validate2.oneOf = values;
|
|
63806
63807
|
return validate2;
|
|
63807
63808
|
}
|
|
63808
|
-
function assertNodeType(...
|
|
63809
|
+
function assertNodeType(...types5) {
|
|
63809
63810
|
function validate2(node, key, val) {
|
|
63810
|
-
for (const type of
|
|
63811
|
+
for (const type of types5) {
|
|
63811
63812
|
if ((0, _is.default)(type, val)) {
|
|
63812
63813
|
(0, _validate.validateChild)(node, key, val);
|
|
63813
63814
|
return;
|
|
63814
63815
|
}
|
|
63815
63816
|
}
|
|
63816
|
-
throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(
|
|
63817
|
+
throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types5)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`);
|
|
63817
63818
|
}
|
|
63818
|
-
validate2.oneOfNodeTypes =
|
|
63819
|
+
validate2.oneOfNodeTypes = types5;
|
|
63819
63820
|
return validate2;
|
|
63820
63821
|
}
|
|
63821
|
-
function assertNodeOrValueType(...
|
|
63822
|
+
function assertNodeOrValueType(...types5) {
|
|
63822
63823
|
function validate2(node, key, val) {
|
|
63823
|
-
for (const type of
|
|
63824
|
+
for (const type of types5) {
|
|
63824
63825
|
if (getType(val) === type || (0, _is.default)(type, val)) {
|
|
63825
63826
|
(0, _validate.validateChild)(node, key, val);
|
|
63826
63827
|
return;
|
|
63827
63828
|
}
|
|
63828
63829
|
}
|
|
63829
|
-
throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(
|
|
63830
|
+
throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types5)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`);
|
|
63830
63831
|
}
|
|
63831
|
-
validate2.oneOfNodeOrValueTypes =
|
|
63832
|
+
validate2.oneOfNodeOrValueTypes = types5;
|
|
63832
63833
|
return validate2;
|
|
63833
63834
|
}
|
|
63834
63835
|
function assertValueType(type) {
|
|
@@ -67406,7 +67407,7 @@ var require_generated2 = __commonJS2({
|
|
|
67406
67407
|
exports.tSTypeParameterInstantiation = exports.tsTypeParameterInstantiation = tsTypeParameterInstantiation;
|
|
67407
67408
|
exports.tSTypePredicate = exports.tsTypePredicate = tsTypePredicate;
|
|
67408
67409
|
exports.tSTypeQuery = exports.tsTypeQuery = tsTypeQuery;
|
|
67409
|
-
exports.tSTypeReference = exports.tsTypeReference =
|
|
67410
|
+
exports.tSTypeReference = exports.tsTypeReference = tsTypeReference2;
|
|
67410
67411
|
exports.tSUndefinedKeyword = exports.tsUndefinedKeyword = tsUndefinedKeyword;
|
|
67411
67412
|
exports.tSUnionType = exports.tsUnionType = tsUnionType;
|
|
67412
67413
|
exports.tSUnknownKeyword = exports.tsUnknownKeyword = tsUnknownKeyword;
|
|
@@ -68232,10 +68233,10 @@ var require_generated2 = __commonJS2({
|
|
|
68232
68233
|
body
|
|
68233
68234
|
});
|
|
68234
68235
|
}
|
|
68235
|
-
function intersectionTypeAnnotation(
|
|
68236
|
+
function intersectionTypeAnnotation(types5) {
|
|
68236
68237
|
return (0, _validateNode.default)({
|
|
68237
68238
|
type: "IntersectionTypeAnnotation",
|
|
68238
|
-
types:
|
|
68239
|
+
types: types5
|
|
68239
68240
|
});
|
|
68240
68241
|
}
|
|
68241
68242
|
function mixedTypeAnnotation() {
|
|
@@ -68358,10 +68359,10 @@ var require_generated2 = __commonJS2({
|
|
|
68358
68359
|
type: "ThisTypeAnnotation"
|
|
68359
68360
|
};
|
|
68360
68361
|
}
|
|
68361
|
-
function tupleTypeAnnotation(
|
|
68362
|
+
function tupleTypeAnnotation(types5) {
|
|
68362
68363
|
return (0, _validateNode.default)({
|
|
68363
68364
|
type: "TupleTypeAnnotation",
|
|
68364
|
-
types:
|
|
68365
|
+
types: types5
|
|
68365
68366
|
});
|
|
68366
68367
|
}
|
|
68367
68368
|
function typeofTypeAnnotation(argument) {
|
|
@@ -68412,10 +68413,10 @@ var require_generated2 = __commonJS2({
|
|
|
68412
68413
|
params
|
|
68413
68414
|
});
|
|
68414
68415
|
}
|
|
68415
|
-
function unionTypeAnnotation(
|
|
68416
|
+
function unionTypeAnnotation(types5) {
|
|
68416
68417
|
return (0, _validateNode.default)({
|
|
68417
68418
|
type: "UnionTypeAnnotation",
|
|
68418
|
-
types:
|
|
68419
|
+
types: types5
|
|
68419
68420
|
});
|
|
68420
68421
|
}
|
|
68421
68422
|
function variance(kind) {
|
|
@@ -68868,7 +68869,7 @@ var require_generated2 = __commonJS2({
|
|
|
68868
68869
|
typeAnnotation: typeAnnotation2
|
|
68869
68870
|
});
|
|
68870
68871
|
}
|
|
68871
|
-
function
|
|
68872
|
+
function tsTypeReference2(typeName, typeParameters = null) {
|
|
68872
68873
|
return (0, _validateNode.default)({
|
|
68873
68874
|
type: "TSTypeReference",
|
|
68874
68875
|
typeName,
|
|
@@ -68928,16 +68929,16 @@ var require_generated2 = __commonJS2({
|
|
|
68928
68929
|
optional
|
|
68929
68930
|
});
|
|
68930
68931
|
}
|
|
68931
|
-
function tsUnionType(
|
|
68932
|
+
function tsUnionType(types5) {
|
|
68932
68933
|
return (0, _validateNode.default)({
|
|
68933
68934
|
type: "TSUnionType",
|
|
68934
|
-
types:
|
|
68935
|
+
types: types5
|
|
68935
68936
|
});
|
|
68936
68937
|
}
|
|
68937
|
-
function tsIntersectionType(
|
|
68938
|
+
function tsIntersectionType(types5) {
|
|
68938
68939
|
return (0, _validateNode.default)({
|
|
68939
68940
|
type: "TSIntersectionType",
|
|
68940
|
-
types:
|
|
68941
|
+
types: types5
|
|
68941
68942
|
});
|
|
68942
68943
|
}
|
|
68943
68944
|
function tsConditionalType(checkType, extendsType, trueType, falseType) {
|
|
@@ -70538,12 +70539,12 @@ var require_removeTypeDuplicates = __commonJS2({
|
|
|
70538
70539
|
const generics = /* @__PURE__ */ new Map();
|
|
70539
70540
|
const bases = /* @__PURE__ */ new Map();
|
|
70540
70541
|
const typeGroups = /* @__PURE__ */ new Set();
|
|
70541
|
-
const
|
|
70542
|
+
const types5 = [];
|
|
70542
70543
|
for (let i2 = 0; i2 < nodes.length; i2++) {
|
|
70543
70544
|
const node = nodes[i2];
|
|
70544
70545
|
if (!node)
|
|
70545
70546
|
continue;
|
|
70546
|
-
if (
|
|
70547
|
+
if (types5.indexOf(node) >= 0) {
|
|
70547
70548
|
continue;
|
|
70548
70549
|
}
|
|
70549
70550
|
if ((0, _generated.isAnyTypeAnnotation)(node)) {
|
|
@@ -70577,15 +70578,15 @@ var require_removeTypeDuplicates = __commonJS2({
|
|
|
70577
70578
|
}
|
|
70578
70579
|
continue;
|
|
70579
70580
|
}
|
|
70580
|
-
|
|
70581
|
+
types5.push(node);
|
|
70581
70582
|
}
|
|
70582
70583
|
for (const [, baseType] of bases) {
|
|
70583
|
-
|
|
70584
|
+
types5.push(baseType);
|
|
70584
70585
|
}
|
|
70585
70586
|
for (const [, genericName] of generics) {
|
|
70586
|
-
|
|
70587
|
+
types5.push(genericName);
|
|
70587
70588
|
}
|
|
70588
|
-
return
|
|
70589
|
+
return types5;
|
|
70589
70590
|
}
|
|
70590
70591
|
}
|
|
70591
70592
|
});
|
|
@@ -70598,8 +70599,8 @@ var require_createFlowUnionType = __commonJS2({
|
|
|
70598
70599
|
exports.default = createFlowUnionType;
|
|
70599
70600
|
var _generated = require_generated2();
|
|
70600
70601
|
var _removeTypeDuplicates = require_removeTypeDuplicates();
|
|
70601
|
-
function createFlowUnionType(
|
|
70602
|
-
const flattened = (0, _removeTypeDuplicates.default)(
|
|
70602
|
+
function createFlowUnionType(types5) {
|
|
70603
|
+
const flattened = (0, _removeTypeDuplicates.default)(types5);
|
|
70603
70604
|
if (flattened.length === 1) {
|
|
70604
70605
|
return flattened[0];
|
|
70605
70606
|
} else {
|
|
@@ -70624,12 +70625,12 @@ var require_removeTypeDuplicates2 = __commonJS2({
|
|
|
70624
70625
|
const generics = /* @__PURE__ */ new Map();
|
|
70625
70626
|
const bases = /* @__PURE__ */ new Map();
|
|
70626
70627
|
const typeGroups = /* @__PURE__ */ new Set();
|
|
70627
|
-
const
|
|
70628
|
+
const types5 = [];
|
|
70628
70629
|
for (let i2 = 0; i2 < nodes.length; i2++) {
|
|
70629
70630
|
const node = nodes[i2];
|
|
70630
70631
|
if (!node)
|
|
70631
70632
|
continue;
|
|
70632
|
-
if (
|
|
70633
|
+
if (types5.indexOf(node) >= 0) {
|
|
70633
70634
|
continue;
|
|
70634
70635
|
}
|
|
70635
70636
|
if ((0, _generated.isTSAnyKeyword)(node)) {
|
|
@@ -70663,15 +70664,15 @@ var require_removeTypeDuplicates2 = __commonJS2({
|
|
|
70663
70664
|
}
|
|
70664
70665
|
continue;
|
|
70665
70666
|
}
|
|
70666
|
-
|
|
70667
|
+
types5.push(node);
|
|
70667
70668
|
}
|
|
70668
70669
|
for (const [, baseType] of bases) {
|
|
70669
|
-
|
|
70670
|
+
types5.push(baseType);
|
|
70670
70671
|
}
|
|
70671
70672
|
for (const [, genericName] of generics) {
|
|
70672
|
-
|
|
70673
|
+
types5.push(genericName);
|
|
70673
70674
|
}
|
|
70674
|
-
return
|
|
70675
|
+
return types5;
|
|
70675
70676
|
}
|
|
70676
70677
|
}
|
|
70677
70678
|
});
|
|
@@ -70686,10 +70687,10 @@ var require_createTSUnionType = __commonJS2({
|
|
|
70686
70687
|
var _removeTypeDuplicates = require_removeTypeDuplicates2();
|
|
70687
70688
|
var _index = require_generated();
|
|
70688
70689
|
function createTSUnionType(typeAnnotations) {
|
|
70689
|
-
const
|
|
70690
|
+
const types5 = typeAnnotations.map((type) => {
|
|
70690
70691
|
return (0, _index.isTSTypeAnnotation)(type) ? type.typeAnnotation : type;
|
|
70691
70692
|
});
|
|
70692
|
-
const flattened = (0, _removeTypeDuplicates.default)(
|
|
70693
|
+
const flattened = (0, _removeTypeDuplicates.default)(types5);
|
|
70693
70694
|
if (flattened.length === 1) {
|
|
70694
70695
|
return flattened[0];
|
|
70695
70696
|
} else {
|
|
@@ -74372,7 +74373,7 @@ var printDocASTReducer = {
|
|
|
74372
74373
|
leave: ({ name, interfaces, directives, fields }) => join(["interface", name, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
|
|
74373
74374
|
},
|
|
74374
74375
|
UnionTypeDefinition: {
|
|
74375
|
-
leave: ({ name, directives, types:
|
|
74376
|
+
leave: ({ name, directives, types: types5 }) => join(["union", name, join(directives, " "), wrap("= ", join(types5, " | "))], " ")
|
|
74376
74377
|
},
|
|
74377
74378
|
EnumTypeDefinition: {
|
|
74378
74379
|
leave: ({ name, directives, values }) => join(["enum", name, join(directives, " "), block(values)], " ")
|
|
@@ -74399,7 +74400,7 @@ var printDocASTReducer = {
|
|
|
74399
74400
|
leave: ({ name, interfaces, directives, fields }) => join(["extend interface", name, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
|
|
74400
74401
|
},
|
|
74401
74402
|
UnionTypeExtension: {
|
|
74402
|
-
leave: ({ name, directives, types:
|
|
74403
|
+
leave: ({ name, directives, types: types5 }) => join(["extend union", name, join(directives, " "), wrap("= ", join(types5, " | "))], " ")
|
|
74403
74404
|
},
|
|
74404
74405
|
EnumTypeExtension: {
|
|
74405
74406
|
leave: ({ name, directives, values }) => join(["extend enum", name, join(directives, " "), block(values)], " ")
|
|
@@ -74569,45 +74570,6 @@ function deepMerge(...objects) {
|
|
|
74569
74570
|
}
|
|
74570
74571
|
return mergedObj;
|
|
74571
74572
|
}
|
|
74572
|
-
async function marshalSelection({
|
|
74573
|
-
selection,
|
|
74574
|
-
data
|
|
74575
|
-
}) {
|
|
74576
|
-
const config = getCurrentConfig();
|
|
74577
|
-
if (data === null || typeof data === "undefined") {
|
|
74578
|
-
return data;
|
|
74579
|
-
}
|
|
74580
|
-
if (Array.isArray(data)) {
|
|
74581
|
-
return await Promise.all(data.map((val) => marshalSelection({ selection, data: val })));
|
|
74582
|
-
}
|
|
74583
|
-
const targetSelection = getFieldsForType(selection, data["__typename"], false);
|
|
74584
|
-
return Object.fromEntries(
|
|
74585
|
-
await Promise.all(
|
|
74586
|
-
Object.entries(data).map(async ([fieldName, value]) => {
|
|
74587
|
-
const { type, selection: selection2 } = targetSelection[fieldName];
|
|
74588
|
-
if (!type) {
|
|
74589
|
-
return [fieldName, value];
|
|
74590
|
-
}
|
|
74591
|
-
if (selection2) {
|
|
74592
|
-
return [fieldName, await marshalSelection({ selection: selection2, data: value })];
|
|
74593
|
-
}
|
|
74594
|
-
if (config.scalars?.[type]) {
|
|
74595
|
-
const marshalFn = config.scalars[type].marshal;
|
|
74596
|
-
if (!marshalFn) {
|
|
74597
|
-
throw new Error(
|
|
74598
|
-
`scalar type ${type} is missing a \`marshal\` function. see https://github.com/AlecAivazis/houdini#%EF%B8%8Fcustom-scalars`
|
|
74599
|
-
);
|
|
74600
|
-
}
|
|
74601
|
-
if (Array.isArray(value)) {
|
|
74602
|
-
return [fieldName, value.map(marshalFn)];
|
|
74603
|
-
}
|
|
74604
|
-
return [fieldName, marshalFn(value)];
|
|
74605
|
-
}
|
|
74606
|
-
return [fieldName, value];
|
|
74607
|
-
})
|
|
74608
|
-
)
|
|
74609
|
-
);
|
|
74610
|
-
}
|
|
74611
74573
|
var ArtifactKind = {
|
|
74612
74574
|
Query: "HoudiniQuery",
|
|
74613
74575
|
Subscription: "HoudiniSubscription",
|
|
@@ -74618,11 +74580,6 @@ var CompiledFragmentKind = ArtifactKind.Fragment;
|
|
|
74618
74580
|
var CompiledMutationKind = ArtifactKind.Mutation;
|
|
74619
74581
|
var CompiledQueryKind = ArtifactKind.Query;
|
|
74620
74582
|
var CompiledSubscriptionKind = ArtifactKind.Subscription;
|
|
74621
|
-
var DataSource = {
|
|
74622
|
-
Cache: "cache",
|
|
74623
|
-
Network: "network",
|
|
74624
|
-
Ssr: "ssr"
|
|
74625
|
-
};
|
|
74626
74583
|
var fragmentKey = " $fragments";
|
|
74627
74584
|
var PendingValue = Symbol("houdini_loading");
|
|
74628
74585
|
var computeKey = ({ field, args }) => {
|
|
@@ -77813,194 +77770,6 @@ function defaultComponentField({
|
|
|
77813
77770
|
}
|
|
77814
77771
|
var cache_default = new Cache();
|
|
77815
77772
|
var serverSide = typeof globalThis.window === "undefined";
|
|
77816
|
-
var documentPlugin = (kind, source) => {
|
|
77817
|
-
return () => {
|
|
77818
|
-
const sourceHandlers = source();
|
|
77819
|
-
const enterWrapper = (handler) => {
|
|
77820
|
-
return !handler ? void 0 : (ctx, handlers) => {
|
|
77821
|
-
if (ctx.artifact.kind !== kind) {
|
|
77822
|
-
return handlers.next(ctx);
|
|
77823
|
-
}
|
|
77824
|
-
return handler(ctx, handlers);
|
|
77825
|
-
};
|
|
77826
|
-
};
|
|
77827
|
-
const exitWrapper = (handler) => {
|
|
77828
|
-
return !handler ? void 0 : (ctx, handlers) => {
|
|
77829
|
-
if (ctx.artifact.kind !== kind) {
|
|
77830
|
-
return handlers.resolve(ctx);
|
|
77831
|
-
}
|
|
77832
|
-
return handler(ctx, handlers);
|
|
77833
|
-
};
|
|
77834
|
-
};
|
|
77835
|
-
return {
|
|
77836
|
-
start: enterWrapper(sourceHandlers.start),
|
|
77837
|
-
network: enterWrapper(sourceHandlers.network),
|
|
77838
|
-
afterNetwork: exitWrapper(sourceHandlers.afterNetwork),
|
|
77839
|
-
end: exitWrapper(sourceHandlers.end),
|
|
77840
|
-
catch: sourceHandlers.catch ? (ctx, handlers) => sourceHandlers.catch(ctx, handlers) : void 0,
|
|
77841
|
-
cleanup: (...args) => sourceHandlers.cleanup?.(...args)
|
|
77842
|
-
};
|
|
77843
|
-
};
|
|
77844
|
-
};
|
|
77845
|
-
var query = documentPlugin(ArtifactKind.Query, function() {
|
|
77846
|
-
let subscriptionSpec = null;
|
|
77847
|
-
let lastVariables = null;
|
|
77848
|
-
return {
|
|
77849
|
-
start(ctx, { next }) {
|
|
77850
|
-
const runtimeScalarPayload = {
|
|
77851
|
-
session: ctx.session
|
|
77852
|
-
};
|
|
77853
|
-
ctx.variables = {
|
|
77854
|
-
...lastVariables,
|
|
77855
|
-
...Object.fromEntries(
|
|
77856
|
-
Object.entries(ctx.artifact.input?.runtimeScalars ?? {}).map(
|
|
77857
|
-
([field, type]) => {
|
|
77858
|
-
const runtimeScalar = ctx.config.features?.runtimeScalars?.[type];
|
|
77859
|
-
if (!runtimeScalar) {
|
|
77860
|
-
return [field, type];
|
|
77861
|
-
}
|
|
77862
|
-
return [field, runtimeScalar.resolve(runtimeScalarPayload)];
|
|
77863
|
-
}
|
|
77864
|
-
)
|
|
77865
|
-
),
|
|
77866
|
-
...ctx.variables
|
|
77867
|
-
};
|
|
77868
|
-
next(ctx);
|
|
77869
|
-
},
|
|
77870
|
-
end(ctx, { resolve: resolve2, marshalVariables: marshalVariables2, variablesChanged: variablesChanged2 }) {
|
|
77871
|
-
if (variablesChanged2(ctx) && !ctx.cacheParams?.disableSubscriptions) {
|
|
77872
|
-
if (subscriptionSpec) {
|
|
77873
|
-
cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
|
|
77874
|
-
}
|
|
77875
|
-
lastVariables = { ...marshalVariables2(ctx) };
|
|
77876
|
-
const variables = lastVariables;
|
|
77877
|
-
subscriptionSpec = {
|
|
77878
|
-
rootType: ctx.artifact.rootType,
|
|
77879
|
-
selection: ctx.artifact.selection,
|
|
77880
|
-
variables: () => variables,
|
|
77881
|
-
set: (newValue) => {
|
|
77882
|
-
resolve2(ctx, {
|
|
77883
|
-
data: newValue,
|
|
77884
|
-
errors: null,
|
|
77885
|
-
fetching: false,
|
|
77886
|
-
partial: false,
|
|
77887
|
-
stale: false,
|
|
77888
|
-
source: DataSource.Cache,
|
|
77889
|
-
variables: ctx.variables ?? {}
|
|
77890
|
-
});
|
|
77891
|
-
}
|
|
77892
|
-
};
|
|
77893
|
-
cache_default.subscribe(subscriptionSpec, lastVariables);
|
|
77894
|
-
}
|
|
77895
|
-
resolve2(ctx);
|
|
77896
|
-
},
|
|
77897
|
-
cleanup() {
|
|
77898
|
-
if (subscriptionSpec) {
|
|
77899
|
-
cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.());
|
|
77900
|
-
lastVariables = null;
|
|
77901
|
-
}
|
|
77902
|
-
}
|
|
77903
|
-
};
|
|
77904
|
-
});
|
|
77905
|
-
var fragment = documentPlugin(ArtifactKind.Fragment, function() {
|
|
77906
|
-
let subscriptionSpec = null;
|
|
77907
|
-
let lastReference = null;
|
|
77908
|
-
return {
|
|
77909
|
-
start(ctx, { next, resolve: resolve2, variablesChanged: variablesChanged2, marshalVariables: marshalVariables2 }) {
|
|
77910
|
-
if (!ctx.stuff.parentID) {
|
|
77911
|
-
return next(ctx);
|
|
77912
|
-
}
|
|
77913
|
-
const currentReference = {
|
|
77914
|
-
parent: ctx.stuff.parentID,
|
|
77915
|
-
variables: marshalVariables2(ctx)
|
|
77916
|
-
};
|
|
77917
|
-
if (!ctx.cacheParams?.disableSubscriptions && (!deepEquals(lastReference, currentReference) || variablesChanged2(ctx))) {
|
|
77918
|
-
if (subscriptionSpec) {
|
|
77919
|
-
cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
|
|
77920
|
-
}
|
|
77921
|
-
const variables = marshalVariables2(ctx);
|
|
77922
|
-
subscriptionSpec = {
|
|
77923
|
-
rootType: ctx.artifact.rootType,
|
|
77924
|
-
selection: ctx.artifact.selection,
|
|
77925
|
-
variables: () => variables,
|
|
77926
|
-
parentID: ctx.stuff.parentID,
|
|
77927
|
-
set: (newValue) => {
|
|
77928
|
-
resolve2(ctx, {
|
|
77929
|
-
data: newValue,
|
|
77930
|
-
errors: null,
|
|
77931
|
-
fetching: false,
|
|
77932
|
-
partial: false,
|
|
77933
|
-
stale: false,
|
|
77934
|
-
source: DataSource.Cache,
|
|
77935
|
-
variables
|
|
77936
|
-
});
|
|
77937
|
-
}
|
|
77938
|
-
};
|
|
77939
|
-
cache_default.subscribe(subscriptionSpec, variables);
|
|
77940
|
-
lastReference = currentReference;
|
|
77941
|
-
}
|
|
77942
|
-
next(ctx);
|
|
77943
|
-
},
|
|
77944
|
-
cleanup() {
|
|
77945
|
-
if (subscriptionSpec) {
|
|
77946
|
-
cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.());
|
|
77947
|
-
}
|
|
77948
|
-
}
|
|
77949
|
-
};
|
|
77950
|
-
});
|
|
77951
|
-
var mutation = documentPlugin(ArtifactKind.Mutation, () => {
|
|
77952
|
-
return {
|
|
77953
|
-
async start(ctx, { next, marshalVariables: marshalVariables2 }) {
|
|
77954
|
-
const layerOptimistic = cache_default._internal_unstable.storage.createLayer(true);
|
|
77955
|
-
const optimisticResponse = ctx.stuff.optimisticResponse;
|
|
77956
|
-
let toNotify = [];
|
|
77957
|
-
if (optimisticResponse) {
|
|
77958
|
-
toNotify = cache_default.write({
|
|
77959
|
-
selection: ctx.artifact.selection,
|
|
77960
|
-
data: await marshalSelection({
|
|
77961
|
-
selection: ctx.artifact.selection,
|
|
77962
|
-
data: optimisticResponse
|
|
77963
|
-
}),
|
|
77964
|
-
variables: marshalVariables2(ctx),
|
|
77965
|
-
layer: layerOptimistic.id
|
|
77966
|
-
});
|
|
77967
|
-
}
|
|
77968
|
-
ctx.cacheParams = {
|
|
77969
|
-
...ctx.cacheParams,
|
|
77970
|
-
layer: layerOptimistic,
|
|
77971
|
-
notifySubscribers: toNotify,
|
|
77972
|
-
forceNotify: true
|
|
77973
|
-
};
|
|
77974
|
-
next(ctx);
|
|
77975
|
-
},
|
|
77976
|
-
afterNetwork(ctx, { resolve: resolve2 }) {
|
|
77977
|
-
if (ctx.cacheParams?.layer) {
|
|
77978
|
-
cache_default.clearLayer(ctx.cacheParams.layer.id);
|
|
77979
|
-
}
|
|
77980
|
-
resolve2(ctx);
|
|
77981
|
-
},
|
|
77982
|
-
end(ctx, { resolve: resolve2, value }) {
|
|
77983
|
-
const hasErrors = value.errors && value.errors.length > 0;
|
|
77984
|
-
if (hasErrors) {
|
|
77985
|
-
if (ctx.cacheParams?.layer) {
|
|
77986
|
-
cache_default.clearLayer(ctx.cacheParams.layer.id);
|
|
77987
|
-
}
|
|
77988
|
-
}
|
|
77989
|
-
if (ctx.cacheParams?.layer) {
|
|
77990
|
-
cache_default._internal_unstable.storage.resolveLayer(ctx.cacheParams.layer.id);
|
|
77991
|
-
}
|
|
77992
|
-
resolve2(ctx);
|
|
77993
|
-
},
|
|
77994
|
-
catch(ctx, { error }) {
|
|
77995
|
-
if (ctx.cacheParams?.layer) {
|
|
77996
|
-
const { layer } = ctx.cacheParams;
|
|
77997
|
-
cache_default.clearLayer(layer.id);
|
|
77998
|
-
cache_default._internal_unstable.storage.resolveLayer(layer.id);
|
|
77999
|
-
}
|
|
78000
|
-
throw error;
|
|
78001
|
-
}
|
|
78002
|
-
};
|
|
78003
|
-
});
|
|
78004
77773
|
var currentDir = dirname((0, import_node_url.fileURLToPath)(import_meta.url));
|
|
78005
77774
|
var DEFAULT_CONFIG_PATH = join2(process.cwd(), "houdini.config.js");
|
|
78006
77775
|
var emptySchema = graphql2.buildSchema("type Query { hello: String }");
|
|
@@ -78038,6 +77807,39 @@ function processComponentFieldDirective(directive) {
|
|
|
78038
77807
|
export: exportValue
|
|
78039
77808
|
};
|
|
78040
77809
|
}
|
|
77810
|
+
function unwrapType(config, type, wrappers = [], convertRuntimeScalars) {
|
|
77811
|
+
if (type.kind === "NonNullType") {
|
|
77812
|
+
return unwrapType(config, type.type, [TypeWrapper.NonNull, ...wrappers]);
|
|
77813
|
+
}
|
|
77814
|
+
if (type instanceof graphql3.GraphQLNonNull) {
|
|
77815
|
+
return unwrapType(config, type.ofType, [TypeWrapper.NonNull, ...wrappers]);
|
|
77816
|
+
}
|
|
77817
|
+
if (wrappers[0] !== TypeWrapper.NonNull) {
|
|
77818
|
+
wrappers.unshift(TypeWrapper.Nullable);
|
|
77819
|
+
}
|
|
77820
|
+
if (type.kind === "ListType") {
|
|
77821
|
+
return unwrapType(config, type.type, [TypeWrapper.List, ...wrappers]);
|
|
77822
|
+
}
|
|
77823
|
+
if (type instanceof graphql3.GraphQLList) {
|
|
77824
|
+
return unwrapType(config, type.ofType, [TypeWrapper.List, ...wrappers]);
|
|
77825
|
+
}
|
|
77826
|
+
if (convertRuntimeScalars && config.configFile.features?.runtimeScalars?.[type.name.value]) {
|
|
77827
|
+
type = config.schema.getType(
|
|
77828
|
+
config.configFile.features?.runtimeScalars?.[type.name.value].type
|
|
77829
|
+
);
|
|
77830
|
+
}
|
|
77831
|
+
const namedType = config.schema.getType(type.name.value || type.name);
|
|
77832
|
+
if (!namedType) {
|
|
77833
|
+
throw new Error("Unknown type: " + type.name.value || type.name);
|
|
77834
|
+
}
|
|
77835
|
+
return { type: namedType, wrappers };
|
|
77836
|
+
}
|
|
77837
|
+
var TypeWrapper = /* @__PURE__ */ ((TypeWrapper2) => {
|
|
77838
|
+
TypeWrapper2["Nullable"] = "Nullable";
|
|
77839
|
+
TypeWrapper2["List"] = "List";
|
|
77840
|
+
TypeWrapper2["NonNull"] = "NonNull";
|
|
77841
|
+
return TypeWrapper2;
|
|
77842
|
+
})(TypeWrapper || {});
|
|
78041
77843
|
var import_parser = __toESM2(require_lib3(), 1);
|
|
78042
77844
|
var import_recast = __toESM2(require_main2(), 1);
|
|
78043
77845
|
var import_deepmerge = __toESM2(require_cjs(), 1);
|
|
@@ -78061,7 +77863,12 @@ function deepMerge2(filepath, ...targets) {
|
|
|
78061
77863
|
}
|
|
78062
77864
|
function parseJS(str, config) {
|
|
78063
77865
|
const defaultConfig = {
|
|
78064
|
-
plugins: [
|
|
77866
|
+
plugins: [
|
|
77867
|
+
"typescript",
|
|
77868
|
+
"importAssertions",
|
|
77869
|
+
"decorators-legacy",
|
|
77870
|
+
"explicitResourceManagement"
|
|
77871
|
+
],
|
|
78065
77872
|
sourceType: "module"
|
|
78066
77873
|
};
|
|
78067
77874
|
return (0, import_parser.parse)(str || "", config ? deepMerge2("", defaultConfig, config) : defaultConfig).program;
|
|
@@ -78207,6 +78014,133 @@ function get_route_segments(route) {
|
|
|
78207
78014
|
function escape2(str) {
|
|
78208
78015
|
return str.normalize().replace(/[[\]]/g, "\\$&").replace(/%/g, "%25").replace(/\//g, "%2[Ff]").replace(/\?/g, "%3[Ff]").replace(/#/g, "%23").replace(/[.*+?^${}()|\\]/g, "\\$&");
|
|
78209
78016
|
}
|
|
78017
|
+
var recast2 = __toESM2(require_main2(), 1);
|
|
78018
|
+
var AST2 = recast2.types.builders;
|
|
78019
|
+
function unwrappedTsTypeReference(config, filepath, missingScalars, {
|
|
78020
|
+
type,
|
|
78021
|
+
wrappers
|
|
78022
|
+
}, body) {
|
|
78023
|
+
let result;
|
|
78024
|
+
if (graphql4.isScalarType(type)) {
|
|
78025
|
+
result = scalarPropertyValue(config, filepath, missingScalars, type, body, null);
|
|
78026
|
+
} else if (graphql4.isEnumType(type)) {
|
|
78027
|
+
result = enumReference(config, body, type.name);
|
|
78028
|
+
} else {
|
|
78029
|
+
result = AST2.tsTypeReference(AST2.identifier(type.name));
|
|
78030
|
+
}
|
|
78031
|
+
for (const toWrap of wrappers) {
|
|
78032
|
+
if (toWrap === "NonNull") {
|
|
78033
|
+
continue;
|
|
78034
|
+
} else if (toWrap === "Nullable") {
|
|
78035
|
+
result = nullableField(result, true);
|
|
78036
|
+
} else if (toWrap === "List") {
|
|
78037
|
+
result = AST2.tsArrayType(AST2.tsParenthesizedType(result));
|
|
78038
|
+
}
|
|
78039
|
+
}
|
|
78040
|
+
return result;
|
|
78041
|
+
}
|
|
78042
|
+
function enumReference(config, body, name) {
|
|
78043
|
+
ensureImports({
|
|
78044
|
+
config,
|
|
78045
|
+
body,
|
|
78046
|
+
import: ["ValueOf"],
|
|
78047
|
+
importKind: "type",
|
|
78048
|
+
sourceModule: "$houdini/runtime/lib/types"
|
|
78049
|
+
});
|
|
78050
|
+
return AST2.tsTypeReference(
|
|
78051
|
+
AST2.identifier("ValueOf"),
|
|
78052
|
+
AST2.tsTypeParameterInstantiation([AST2.tsTypeQuery(AST2.identifier(name))])
|
|
78053
|
+
);
|
|
78054
|
+
}
|
|
78055
|
+
function nullableField(inner, input = false) {
|
|
78056
|
+
const members = [inner, AST2.tsNullKeyword()];
|
|
78057
|
+
if (input) {
|
|
78058
|
+
members.push(AST2.tsUndefinedKeyword());
|
|
78059
|
+
}
|
|
78060
|
+
return AST2.tsUnionType(members);
|
|
78061
|
+
}
|
|
78062
|
+
function scalarPropertyValue(config, filepath, missingScalars, target, body, field) {
|
|
78063
|
+
if (config.configFile.features?.componentFields && target.name === config.componentScalar) {
|
|
78064
|
+
if (!field) {
|
|
78065
|
+
return AST2.tsNeverKeyword();
|
|
78066
|
+
}
|
|
78067
|
+
const component = config.componentFields[field.parent][field.field];
|
|
78068
|
+
const sourcePathRelative = path_exports.relative(
|
|
78069
|
+
path_exports.join(config.projectRoot, "src"),
|
|
78070
|
+
component.filepath
|
|
78071
|
+
);
|
|
78072
|
+
let sourcePathParsed = path_exports.parse(sourcePathRelative);
|
|
78073
|
+
let sourcePath = path_exports.join(sourcePathParsed.dir, sourcePathParsed.name);
|
|
78074
|
+
const localImport = ensureImports({
|
|
78075
|
+
config,
|
|
78076
|
+
body,
|
|
78077
|
+
import: "__component__" + component.fragment,
|
|
78078
|
+
sourceModule: path_exports.join(
|
|
78079
|
+
path_exports.relative(path_exports.dirname(filepath), config.projectRoot),
|
|
78080
|
+
"src",
|
|
78081
|
+
sourcePath
|
|
78082
|
+
)
|
|
78083
|
+
}) ?? "__component__" + component.fragment;
|
|
78084
|
+
const parameters = AST2.tsTypeReference(AST2.identifier("Parameters"));
|
|
78085
|
+
parameters.typeParameters = AST2.tsTypeParameterInstantiation([
|
|
78086
|
+
AST2.tsTypeQuery(AST2.identifier(localImport))
|
|
78087
|
+
]);
|
|
78088
|
+
const indexed = AST2.tsIndexedAccessType(
|
|
78089
|
+
parameters,
|
|
78090
|
+
AST2.tsLiteralType(AST2.numericLiteral(0))
|
|
78091
|
+
);
|
|
78092
|
+
const omit = AST2.tsTypeReference(AST2.identifier("Omit"));
|
|
78093
|
+
omit.typeParameters = AST2.tsTypeParameterInstantiation([
|
|
78094
|
+
indexed,
|
|
78095
|
+
AST2.tsLiteralType(AST2.stringLiteral(component.prop))
|
|
78096
|
+
]);
|
|
78097
|
+
const arg = AST2.identifier("props");
|
|
78098
|
+
arg.typeAnnotation = AST2.tsTypeAnnotation(omit);
|
|
78099
|
+
const returnType = AST2.tsTypeReference(AST2.identifier("ReturnType"));
|
|
78100
|
+
returnType.typeParameters = AST2.tsTypeParameterInstantiation([
|
|
78101
|
+
AST2.tsTypeQuery(AST2.identifier(localImport))
|
|
78102
|
+
]);
|
|
78103
|
+
const fnType = AST2.tsFunctionType([arg]);
|
|
78104
|
+
fnType.typeAnnotation = AST2.tsTypeAnnotation(returnType);
|
|
78105
|
+
return fnType;
|
|
78106
|
+
}
|
|
78107
|
+
switch (target.name) {
|
|
78108
|
+
case "String": {
|
|
78109
|
+
return AST2.tsStringKeyword();
|
|
78110
|
+
}
|
|
78111
|
+
case "Int": {
|
|
78112
|
+
return AST2.tsNumberKeyword();
|
|
78113
|
+
}
|
|
78114
|
+
case "Float": {
|
|
78115
|
+
return AST2.tsNumberKeyword();
|
|
78116
|
+
}
|
|
78117
|
+
case "Boolean": {
|
|
78118
|
+
return AST2.tsBooleanKeyword();
|
|
78119
|
+
}
|
|
78120
|
+
case "ID": {
|
|
78121
|
+
return AST2.tsStringKeyword();
|
|
78122
|
+
}
|
|
78123
|
+
default: {
|
|
78124
|
+
if (graphql4.isNonNullType(target) && "ofType" in target) {
|
|
78125
|
+
return scalarPropertyValue(
|
|
78126
|
+
config,
|
|
78127
|
+
filepath,
|
|
78128
|
+
missingScalars,
|
|
78129
|
+
target.ofType,
|
|
78130
|
+
body,
|
|
78131
|
+
field
|
|
78132
|
+
);
|
|
78133
|
+
}
|
|
78134
|
+
if (config.scalars?.[target.name]) {
|
|
78135
|
+
return AST2.tsTypeReference(AST2.identifier(config.scalars?.[target.name].type));
|
|
78136
|
+
}
|
|
78137
|
+
if (target.name !== config.componentScalar) {
|
|
78138
|
+
missingScalars.add(target.name);
|
|
78139
|
+
}
|
|
78140
|
+
return AST2.tsAnyKeyword();
|
|
78141
|
+
}
|
|
78142
|
+
}
|
|
78143
|
+
}
|
|
78210
78144
|
var WalkerBase = class {
|
|
78211
78145
|
constructor() {
|
|
78212
78146
|
this.should_skip = false;
|
|
@@ -78367,7 +78301,7 @@ async function find_graphql(config, parsedScript, walker) {
|
|
|
78367
78301
|
} else if (!documentString) {
|
|
78368
78302
|
return;
|
|
78369
78303
|
}
|
|
78370
|
-
const parsedTag =
|
|
78304
|
+
const parsedTag = graphql5.parse(documentString);
|
|
78371
78305
|
if (walker.where && !walker.where(parsedTag, { node, parent })) {
|
|
78372
78306
|
return;
|
|
78373
78307
|
}
|
|
@@ -78499,7 +78433,7 @@ function extractAnonymousQuery(config, raw, expr, propName) {
|
|
|
78499
78433
|
};
|
|
78500
78434
|
return defs.concat([
|
|
78501
78435
|
{
|
|
78502
|
-
raw:
|
|
78436
|
+
raw: graphql5.print(parsed),
|
|
78503
78437
|
parsed
|
|
78504
78438
|
}
|
|
78505
78439
|
]);
|
|
@@ -78652,7 +78586,8 @@ async function load_manifest(args) {
|
|
|
78652
78586
|
local_yoga: false
|
|
78653
78587
|
},
|
|
78654
78588
|
queries: [],
|
|
78655
|
-
layouts: []
|
|
78589
|
+
layouts: [],
|
|
78590
|
+
variables: {}
|
|
78656
78591
|
});
|
|
78657
78592
|
if (args.includeArtifacts) {
|
|
78658
78593
|
try {
|
|
@@ -78683,6 +78618,7 @@ async function walk_routes(args) {
|
|
|
78683
78618
|
const directory_contents = await fs_exports.readdir(args.filepath, {
|
|
78684
78619
|
withFileTypes: true
|
|
78685
78620
|
});
|
|
78621
|
+
const variables = { ...args.variables };
|
|
78686
78622
|
let newLayouts = args.layouts;
|
|
78687
78623
|
let newLayoutQueries = args.queries;
|
|
78688
78624
|
let layout = null;
|
|
@@ -78706,7 +78642,8 @@ async function walk_routes(args) {
|
|
|
78706
78642
|
url: args.url,
|
|
78707
78643
|
project: args.project,
|
|
78708
78644
|
type: "layout",
|
|
78709
|
-
contents: layoutQueryContents
|
|
78645
|
+
contents: layoutQueryContents,
|
|
78646
|
+
variables
|
|
78710
78647
|
});
|
|
78711
78648
|
newLayoutQueries = [...args.queries, layoutQuery.name];
|
|
78712
78649
|
}
|
|
@@ -78719,7 +78656,8 @@ async function walk_routes(args) {
|
|
|
78719
78656
|
contents: layoutViewContents,
|
|
78720
78657
|
layouts: args.layouts,
|
|
78721
78658
|
queries: newLayoutQueries,
|
|
78722
|
-
config: args.config
|
|
78659
|
+
config: args.config,
|
|
78660
|
+
variables
|
|
78723
78661
|
});
|
|
78724
78662
|
newLayouts = [...args.layouts, page_id(layout.url)];
|
|
78725
78663
|
}
|
|
@@ -78730,7 +78668,8 @@ async function walk_routes(args) {
|
|
|
78730
78668
|
url: args.url,
|
|
78731
78669
|
project: args.project,
|
|
78732
78670
|
type: "page",
|
|
78733
|
-
contents: pageQueryContents
|
|
78671
|
+
contents: pageQueryContents,
|
|
78672
|
+
variables
|
|
78734
78673
|
});
|
|
78735
78674
|
}
|
|
78736
78675
|
if (pageViewContents) {
|
|
@@ -78742,7 +78681,8 @@ async function walk_routes(args) {
|
|
|
78742
78681
|
contents: pageViewContents,
|
|
78743
78682
|
layouts: newLayouts,
|
|
78744
78683
|
queries: pageQuery ? [...newLayoutQueries, pageQuery.name] : newLayoutQueries,
|
|
78745
|
-
config: args.config
|
|
78684
|
+
config: args.config,
|
|
78685
|
+
variables
|
|
78746
78686
|
});
|
|
78747
78687
|
}
|
|
78748
78688
|
await Promise.all(
|
|
@@ -78755,7 +78695,8 @@ async function walk_routes(args) {
|
|
|
78755
78695
|
filepath: path_exports.join(args.filepath, dir.name),
|
|
78756
78696
|
url: `${args.url}${dir.name}/`,
|
|
78757
78697
|
queries: newLayoutQueries,
|
|
78758
|
-
layouts: newLayouts
|
|
78698
|
+
layouts: newLayouts,
|
|
78699
|
+
variables
|
|
78759
78700
|
});
|
|
78760
78701
|
})
|
|
78761
78702
|
);
|
|
@@ -78777,12 +78718,18 @@ async function add_view(args) {
|
|
|
78777
78718
|
url: args.url,
|
|
78778
78719
|
layouts: args.layouts,
|
|
78779
78720
|
path: path_exports.relative(args.config.projectRoot, args.path),
|
|
78780
|
-
query_options: args.queries
|
|
78721
|
+
query_options: args.queries,
|
|
78722
|
+
params: Object.fromEntries(
|
|
78723
|
+
parse_page_pattern(args.url).params.map((param) => [
|
|
78724
|
+
param.name,
|
|
78725
|
+
args.variables[param.name] ?? null
|
|
78726
|
+
])
|
|
78727
|
+
)
|
|
78781
78728
|
};
|
|
78782
78729
|
return target[id];
|
|
78783
78730
|
}
|
|
78784
78731
|
async function add_query(args) {
|
|
78785
|
-
const parsed =
|
|
78732
|
+
const parsed = graphql6.parse(args.contents);
|
|
78786
78733
|
const query2 = parsed.definitions.find(
|
|
78787
78734
|
(def) => def.kind === "OperationDefinition" && def.operation === "query"
|
|
78788
78735
|
);
|
|
@@ -78790,20 +78737,30 @@ async function add_query(args) {
|
|
|
78790
78737
|
throw new Error("No query found");
|
|
78791
78738
|
}
|
|
78792
78739
|
let loading = false;
|
|
78793
|
-
await
|
|
78740
|
+
await graphql6.visit(parsed, {
|
|
78794
78741
|
Directive(node) {
|
|
78795
78742
|
if (node.name.value === args.config.loadingDirective) {
|
|
78796
78743
|
loading = true;
|
|
78797
78744
|
}
|
|
78798
78745
|
}
|
|
78799
78746
|
});
|
|
78747
|
+
const queryVariables = Object.fromEntries(
|
|
78748
|
+
query2.variableDefinitions?.map((variable) => {
|
|
78749
|
+
const { type, wrappers } = unwrapType(args.config, variable.type, [], true);
|
|
78750
|
+
return [
|
|
78751
|
+
variable.variable.name.value,
|
|
78752
|
+
{ wrappers, type: type.name }
|
|
78753
|
+
];
|
|
78754
|
+
}) ?? []
|
|
78755
|
+
);
|
|
78756
|
+
Object.assign(args.variables, queryVariables);
|
|
78800
78757
|
const target = args.type === "page" ? args.project.page_queries : args.project.layout_queries;
|
|
78801
78758
|
target[page_id(args.url)] = {
|
|
78802
78759
|
path: path_exports.relative(args.config.routesDir, args.path),
|
|
78803
78760
|
name: query2.name.value,
|
|
78804
78761
|
url: args.url,
|
|
78805
78762
|
loading,
|
|
78806
|
-
variables:
|
|
78763
|
+
variables: queryVariables
|
|
78807
78764
|
};
|
|
78808
78765
|
return target[page_id(args.url)];
|
|
78809
78766
|
}
|
|
@@ -78857,7 +78814,18 @@ async function extractQueries(source) {
|
|
|
78857
78814
|
} else {
|
|
78858
78815
|
return [];
|
|
78859
78816
|
}
|
|
78860
|
-
return props.
|
|
78817
|
+
return props.reduce((queries, query2) => {
|
|
78818
|
+
if (query2 === "children") {
|
|
78819
|
+
return queries;
|
|
78820
|
+
}
|
|
78821
|
+
if (query2.endsWith("$handle")) {
|
|
78822
|
+
query2 = query2.substring(0, query2.length - "$handle".length);
|
|
78823
|
+
}
|
|
78824
|
+
if (queries.includes(query2)) {
|
|
78825
|
+
return queries;
|
|
78826
|
+
}
|
|
78827
|
+
return queries.concat([query2]);
|
|
78828
|
+
}, []);
|
|
78861
78829
|
}
|
|
78862
78830
|
function isSecondaryBuild() {
|
|
78863
78831
|
return process.env.HOUDINI_SECONDARY_BUILD && process.env.HOUDINI_SECONDARY_BUILD !== "false";
|
|
@@ -78868,7 +78836,7 @@ var import_node_path2 = __toESM(require("node:path"));
|
|
|
78868
78836
|
var import_vite2 = require("vite");
|
|
78869
78837
|
|
|
78870
78838
|
// src/plugin/codegen/index.ts
|
|
78871
|
-
var
|
|
78839
|
+
var graphql7 = __toESM(require("graphql"));
|
|
78872
78840
|
|
|
78873
78841
|
// src/plugin/codegen/entries/documentWrappers.ts
|
|
78874
78842
|
function generate_routing_document_wrappers({
|
|
@@ -78920,21 +78888,23 @@ async function generate_query_wrapper(args) {
|
|
|
78920
78888
|
const relative_path = path_exports.relative(path_exports.dirname(unit_path), page_path);
|
|
78921
78889
|
const component_name = "Component_" + page.id;
|
|
78922
78890
|
let source = [
|
|
78923
|
-
"import { useQueryResult } from '$houdini/plugins/houdini-react/runtime/routing'",
|
|
78891
|
+
"import { useQueryResult, PageContextProvider } from '$houdini/plugins/houdini-react/runtime/routing'",
|
|
78924
78892
|
`import ${component_name} from "${relative_path}"`
|
|
78925
78893
|
];
|
|
78926
78894
|
source.push(`export default ({ children }) => {
|
|
78927
78895
|
${""}
|
|
78928
|
-
${page.queries.map((
|
|
78896
|
+
${page.queries.map((query) => `const [${query}$data, ${query}$handle] = useQueryResult("${query}")`).join("\n")}
|
|
78929
78897
|
|
|
78930
78898
|
return (
|
|
78931
|
-
|
|
78932
|
-
|
|
78933
|
-
|
|
78899
|
+
<PageContextProvider keys={${JSON.stringify(Object.keys(page.params ?? {}))}}>
|
|
78900
|
+
<${component_name}
|
|
78901
|
+
${page.queries.map(
|
|
78902
|
+
(query) => [`${query}={${query}$data}`, `${query}$handle={${query}$handle}`].join(" ")
|
|
78934
78903
|
).join("\n")}
|
|
78935
|
-
|
|
78936
|
-
|
|
78937
|
-
|
|
78904
|
+
>
|
|
78905
|
+
{children}
|
|
78906
|
+
</${component_name}>
|
|
78907
|
+
</PageContextProvider>
|
|
78938
78908
|
)
|
|
78939
78909
|
}`);
|
|
78940
78910
|
const formatted = (await printJS(parseJS(source.join("\n"), { plugins: ["jsx"] }))).code;
|
|
@@ -79007,7 +78977,7 @@ async function generate_fallbacks({
|
|
|
79007
78977
|
project
|
|
79008
78978
|
}) {
|
|
79009
78979
|
const query_map = Object.values(project.layout_queries).concat(Object.values(project.page_queries)).reduce(
|
|
79010
|
-
(prev,
|
|
78980
|
+
(prev, query) => ({ ...prev, [query.name]: query }),
|
|
79011
78981
|
{}
|
|
79012
78982
|
);
|
|
79013
78983
|
for (const [id, page] of Object.entries(project.layouts).concat(
|
|
@@ -79016,11 +78986,11 @@ async function generate_fallbacks({
|
|
|
79016
78986
|
const layout = conventions_exports.is_layout(page.path);
|
|
79017
78987
|
const which = layout ? "layout" : "page";
|
|
79018
78988
|
const { required_queries, loading_queries } = page.queries.reduce(
|
|
79019
|
-
(prev,
|
|
79020
|
-
if (query_map[
|
|
79021
|
-
prev.loading_queries.push(
|
|
78989
|
+
(prev, query) => {
|
|
78990
|
+
if (query_map[query].loading) {
|
|
78991
|
+
prev.loading_queries.push(query);
|
|
79022
78992
|
} else {
|
|
79023
|
-
prev.required_queries.push(
|
|
78993
|
+
prev.required_queries.push(query);
|
|
79024
78994
|
}
|
|
79025
78995
|
return prev;
|
|
79026
78996
|
},
|
|
@@ -79049,11 +79019,11 @@ async function generate_fallbacks({
|
|
|
79049
79019
|
const { artifact_cache } = useRouterContext()
|
|
79050
79020
|
|
|
79051
79021
|
${""}
|
|
79052
|
-
${page.queries.map((
|
|
79022
|
+
${page.queries.map((query) => `const ${query}_artifact = artifact_cache.get("${query}")`).join("\n")}
|
|
79053
79023
|
|
|
79054
79024
|
${""}
|
|
79055
79025
|
${required_queries.map(
|
|
79056
|
-
(
|
|
79026
|
+
(query) => `const [${query}_data, ${query}_handle] = useQueryResult("${query}")`
|
|
79057
79027
|
).join("\n")}
|
|
79058
79028
|
|
|
79059
79029
|
return (
|
|
@@ -79370,6 +79340,9 @@ export function createServerAdapter(options) {
|
|
|
79370
79340
|
]);
|
|
79371
79341
|
}
|
|
79372
79342
|
|
|
79343
|
+
// src/plugin/codegen/typeRoot.ts
|
|
79344
|
+
var recast3 = __toESM(require_main4());
|
|
79345
|
+
|
|
79373
79346
|
// src/plugin/dedent.ts
|
|
79374
79347
|
function dedent(indentString, input) {
|
|
79375
79348
|
if (input === void 0) {
|
|
@@ -79409,34 +79382,32 @@ async function generate_type_root({
|
|
|
79409
79382
|
const all_queries = (page?.query_options ?? []).concat(layout?.query_options ?? []);
|
|
79410
79383
|
const relative2 = path_exports.relative(target_dir, config.rootDir);
|
|
79411
79384
|
const definition = `
|
|
79412
|
-
import { DocumentHandle } from '${relative2}/plugins/houdini-react/runtime'
|
|
79385
|
+
import { DocumentHandle, RouteProp } from '${relative2}/plugins/houdini-react/runtime'
|
|
79413
79386
|
import React from 'react'
|
|
79414
|
-
|
|
79415
79387
|
${all_queries.map(
|
|
79416
|
-
(
|
|
79417
|
-
import type { ${
|
|
79388
|
+
(query) => dedent(`
|
|
79389
|
+
import type { ${query}$result, ${query}$artifact, ${query}$input } from '${config.artifactImportPath(query).replace("$houdini", relative2)}'
|
|
79418
79390
|
|
|
79419
79391
|
`)
|
|
79420
79392
|
).join("\n")}
|
|
79421
79393
|
|
|
79422
|
-
${`
|
|
79423
|
-
|
|
79424
|
-
${!page ? "" :
|
|
79425
|
-
|
|
79426
|
-
${
|
|
79394
|
+
${`export type PageProps = {
|
|
79395
|
+
Params: ${!page ? "{}" : paramsType(config, page.params)},
|
|
79396
|
+
${!page ? "" : `
|
|
79397
|
+
` + page.query_options.map(
|
|
79398
|
+
(query) => ` ${query}: ${query}$result,
|
|
79399
|
+
${query}$handle: DocumentHandle<${query}$artifact, ${query}$result, ${query}$input>,`
|
|
79427
79400
|
).join("\n")}
|
|
79428
79401
|
}
|
|
79429
79402
|
`}
|
|
79430
79403
|
|
|
79431
|
-
${`
|
|
79432
|
-
|
|
79404
|
+
${`export type LayoutProps = {
|
|
79405
|
+
Params: ${!page ? "{}" : paramsType(config, page.params)},
|
|
79433
79406
|
children: React.ReactNode,
|
|
79434
79407
|
${!layout ? "" : layout.query_options.map(
|
|
79435
|
-
(
|
|
79436
|
-
${
|
|
79437
|
-
).join("\n")}
|
|
79438
|
-
}
|
|
79439
|
-
`}
|
|
79408
|
+
(query) => ` ${query}: ${query}$result,
|
|
79409
|
+
${query}$handle: DocumentHandle<${query}$artifact, ${query}$result, ${query}$input>,`
|
|
79410
|
+
).join("\n")}}`}
|
|
79440
79411
|
`;
|
|
79441
79412
|
await fs_exports.writeFile(path_exports.join(target_dir, "$types.d.ts"), definition);
|
|
79442
79413
|
})
|
|
@@ -79488,6 +79459,28 @@ async function writeTsconfig(config) {
|
|
|
79488
79459
|
)
|
|
79489
79460
|
);
|
|
79490
79461
|
}
|
|
79462
|
+
function paramsType(config, params) {
|
|
79463
|
+
return `{
|
|
79464
|
+
${Object.entries(params ?? {}).map(([param, typeInfo]) => {
|
|
79465
|
+
let valueString = "string";
|
|
79466
|
+
if (typeInfo) {
|
|
79467
|
+
valueString = recast3.print(
|
|
79468
|
+
unwrappedTsTypeReference(
|
|
79469
|
+
config,
|
|
79470
|
+
"",
|
|
79471
|
+
/* @__PURE__ */ new Set(),
|
|
79472
|
+
{
|
|
79473
|
+
type: config.schema.getType(typeInfo.type),
|
|
79474
|
+
wrappers: typeInfo.wrappers
|
|
79475
|
+
},
|
|
79476
|
+
[]
|
|
79477
|
+
)
|
|
79478
|
+
).code;
|
|
79479
|
+
}
|
|
79480
|
+
return `${param}: ${valueString},`;
|
|
79481
|
+
}).join(", ")}
|
|
79482
|
+
}`;
|
|
79483
|
+
}
|
|
79491
79484
|
|
|
79492
79485
|
// src/plugin/codegen/index.ts
|
|
79493
79486
|
async function routerCodegen({
|
|
@@ -79500,10 +79493,10 @@ async function routerCodegen({
|
|
|
79500
79493
|
if (!document.artifact?.hasComponents) {
|
|
79501
79494
|
continue;
|
|
79502
79495
|
}
|
|
79503
|
-
const typeInfo = new
|
|
79504
|
-
|
|
79496
|
+
const typeInfo = new graphql7.TypeInfo(config.schema);
|
|
79497
|
+
graphql7.visit(
|
|
79505
79498
|
document.document,
|
|
79506
|
-
|
|
79499
|
+
graphql7.visitWithTypeInfo(typeInfo, {
|
|
79507
79500
|
FragmentSpread(node) {
|
|
79508
79501
|
const directive = node.directives?.find(
|
|
79509
79502
|
(directive2) => directive2.name.value === config.componentFieldDirective
|
|
@@ -79573,12 +79566,12 @@ ${Object.entries(manifest3.pages).map(([id, page]) => {
|
|
|
79573
79566
|
|
|
79574
79567
|
${""}
|
|
79575
79568
|
documents: {
|
|
79576
|
-
${queries.map((
|
|
79577
|
-
const artifact_path = config.artifactImportPath(
|
|
79578
|
-
return `${
|
|
79569
|
+
${queries.map((query) => {
|
|
79570
|
+
const artifact_path = config.artifactImportPath(query);
|
|
79571
|
+
return `${query}: {
|
|
79579
79572
|
artifact: () => import("${path_exports.relative(from, artifact_path)}"),
|
|
79580
|
-
loading: ${JSON.stringify(query_name_map[
|
|
79581
|
-
variables: ${JSON.stringify(query_name_map[
|
|
79573
|
+
loading: ${JSON.stringify(query_name_map[query]?.loading)},
|
|
79574
|
+
variables: ${JSON.stringify(query_name_map[query]?.variables)}
|
|
79582
79575
|
}`;
|
|
79583
79576
|
}).join(",\n ")}
|
|
79584
79577
|
},
|
|
@@ -79626,8 +79619,8 @@ async function extractDocuments({
|
|
|
79626
79619
|
}
|
|
79627
79620
|
|
|
79628
79621
|
// src/plugin/transform.ts
|
|
79629
|
-
var
|
|
79630
|
-
var
|
|
79622
|
+
var recast4 = __toESM(require_main4());
|
|
79623
|
+
var AST3 = recast4.types.builders;
|
|
79631
79624
|
async function transformFile(page) {
|
|
79632
79625
|
if (!page.filepath.endsWith(".tsx") && !page.filepath.endsWith(".jsx")) {
|
|
79633
79626
|
return { code: page.content, map: page.map };
|
|
@@ -79642,7 +79635,7 @@ async function transformFile(page) {
|
|
|
79642
79635
|
body: script.body
|
|
79643
79636
|
});
|
|
79644
79637
|
const properties = [
|
|
79645
|
-
|
|
79638
|
+
AST3.objectProperty(AST3.stringLiteral("artifact"), AST3.identifier(artifactID))
|
|
79646
79639
|
];
|
|
79647
79640
|
const { paginated, componentFields } = page.config.localDocumentData(parsedDocument);
|
|
79648
79641
|
if (paginated) {
|
|
@@ -79658,9 +79651,9 @@ async function transformFile(page) {
|
|
|
79658
79651
|
});
|
|
79659
79652
|
}
|
|
79660
79653
|
properties.push(
|
|
79661
|
-
|
|
79662
|
-
|
|
79663
|
-
|
|
79654
|
+
AST3.objectProperty(
|
|
79655
|
+
AST3.stringLiteral("refetchArtifact"),
|
|
79656
|
+
AST3.identifier(refetchArtifactName)
|
|
79664
79657
|
)
|
|
79665
79658
|
);
|
|
79666
79659
|
}
|
|
@@ -79679,7 +79672,7 @@ async function transformFile(page) {
|
|
|
79679
79672
|
import: null
|
|
79680
79673
|
});
|
|
79681
79674
|
}
|
|
79682
|
-
node.replaceWith(
|
|
79675
|
+
node.replaceWith(AST3.objectExpression(properties));
|
|
79683
79676
|
}
|
|
79684
79677
|
});
|
|
79685
79678
|
return printJS(script);
|
|
@@ -79802,12 +79795,12 @@ var vite_default = {
|
|
|
79802
79795
|
const queryName = parsedPath.name;
|
|
79803
79796
|
if (which === "pages") {
|
|
79804
79797
|
const page = manifest.pages[queryName];
|
|
79805
|
-
const pendingQueries = page.queries.filter((
|
|
79806
|
-
const page2 = Object.values(manifest.page_queries).find((q) => q.name ===
|
|
79798
|
+
const pendingQueries = page.queries.filter((query) => {
|
|
79799
|
+
const page2 = Object.values(manifest.page_queries).find((q) => q.name === query);
|
|
79807
79800
|
if (page2) {
|
|
79808
79801
|
return page2.loading;
|
|
79809
79802
|
}
|
|
79810
|
-
const layout = Object.values(manifest.layout_queries).find((q) => q.name ===
|
|
79803
|
+
const layout = Object.values(manifest.layout_queries).find((q) => q.name === query);
|
|
79811
79804
|
return layout?.loading;
|
|
79812
79805
|
});
|
|
79813
79806
|
return `
|
|
@@ -79837,6 +79830,15 @@ var vite_default = {
|
|
|
79837
79830
|
})
|
|
79838
79831
|
window.__houdini__hydration__layer__ ??= window.__houdini__cache__._internal_unstable.storage.createLayer(true)
|
|
79839
79832
|
|
|
79833
|
+
// link up the cache we just created with the client
|
|
79834
|
+
window.__houdini__client__.setCache(window.__houdini__cache__)
|
|
79835
|
+
|
|
79836
|
+
// hydrate the cache with the information from the initial payload
|
|
79837
|
+
window.__houdini__cache__?.hydrate(
|
|
79838
|
+
window.__houdini__initial__cache__,
|
|
79839
|
+
window.__houdini__hydration__layer__
|
|
79840
|
+
)
|
|
79841
|
+
|
|
79840
79842
|
// the artifacts are the source of the zip (without them, we can't prime either cache)
|
|
79841
79843
|
for (const [artifactName, artifact] of Object.entries(window.__houdini__pending_artifacts__ ?? {})) {
|
|
79842
79844
|
// save the value in the initial artifact cache
|
|
@@ -79845,13 +79847,14 @@ var vite_default = {
|
|
|
79845
79847
|
// if we also have data for the artifact, save it in the initial data cache
|
|
79846
79848
|
if (window.__houdini__pending_data__?.[artifactName]) {
|
|
79847
79849
|
const variables = window.__houdini__pending_variables__[artifactName]
|
|
79850
|
+
|
|
79848
79851
|
if (artifact.hasComponents) {
|
|
79849
79852
|
// we need to walk down the artifacts selection and instantiate any component fields
|
|
79850
79853
|
injectComponents({
|
|
79851
79854
|
cache: window.__houdini__cache__,
|
|
79852
79855
|
selection: artifact.selection,
|
|
79853
79856
|
data: window.__houdini__pending_data__[artifactName],
|
|
79854
|
-
variables
|
|
79857
|
+
variables,
|
|
79855
79858
|
})
|
|
79856
79859
|
}
|
|
79857
79860
|
|
|
@@ -79859,10 +79862,16 @@ var vite_default = {
|
|
|
79859
79862
|
const observer = window.__houdini__client__.observe({
|
|
79860
79863
|
artifact,
|
|
79861
79864
|
cache: window.__houdini__cache__,
|
|
79862
|
-
initialValue: window.
|
|
79865
|
+
initialValue: window.__houdini__cache__.read({selection: artifact.selection, variables}).data,
|
|
79863
79866
|
initialVariables: variables,
|
|
79864
79867
|
})
|
|
79865
79868
|
|
|
79869
|
+
// initialize the observer we just created
|
|
79870
|
+
observer.send({
|
|
79871
|
+
setup: true,
|
|
79872
|
+
variables,
|
|
79873
|
+
})
|
|
79874
|
+
|
|
79866
79875
|
// save it in the cache
|
|
79867
79876
|
initialData[artifactName] = observer
|
|
79868
79877
|
initialVariables[artifactName] = variables
|
|
@@ -79883,12 +79892,6 @@ var vite_default = {
|
|
|
79883
79892
|
})
|
|
79884
79893
|
}
|
|
79885
79894
|
|
|
79886
|
-
// hydrate the cache with the information from the initial payload
|
|
79887
|
-
window.__houdini__cache__?.hydrate(
|
|
79888
|
-
window.__houdini__initial__cache__,
|
|
79889
|
-
window.__houdini__hydration__layer__
|
|
79890
|
-
)
|
|
79891
|
-
|
|
79892
79895
|
// get the initial url from the window
|
|
79893
79896
|
const url = window.location.pathname
|
|
79894
79897
|
|