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
|
@@ -13147,12 +13147,12 @@ var require_comments2 = __commonJS({
|
|
|
13147
13147
|
comment.trailing = true;
|
|
13148
13148
|
addCommentHelper(node, comment);
|
|
13149
13149
|
}
|
|
13150
|
-
function printLeadingComment(commentPath,
|
|
13150
|
+
function printLeadingComment(commentPath, print6) {
|
|
13151
13151
|
var comment = commentPath.getValue();
|
|
13152
13152
|
n.Comment.assert(comment);
|
|
13153
13153
|
var loc = comment.loc;
|
|
13154
13154
|
var lines = loc && loc.lines;
|
|
13155
|
-
var parts = [
|
|
13155
|
+
var parts = [print6(commentPath)];
|
|
13156
13156
|
if (comment.trailing) {
|
|
13157
13157
|
parts.push("\n");
|
|
13158
13158
|
} else if (lines instanceof lines_1.Lines) {
|
|
@@ -13167,7 +13167,7 @@ var require_comments2 = __commonJS({
|
|
|
13167
13167
|
}
|
|
13168
13168
|
return (0, lines_1.concat)(parts);
|
|
13169
13169
|
}
|
|
13170
|
-
function printTrailingComment(commentPath,
|
|
13170
|
+
function printTrailingComment(commentPath, print6) {
|
|
13171
13171
|
var comment = commentPath.getValue(commentPath);
|
|
13172
13172
|
n.Comment.assert(comment);
|
|
13173
13173
|
var loc = comment.loc;
|
|
@@ -13182,12 +13182,12 @@ var require_comments2 = __commonJS({
|
|
|
13182
13182
|
parts.push(new Array(leadingSpace.length).join("\n"));
|
|
13183
13183
|
}
|
|
13184
13184
|
}
|
|
13185
|
-
parts.push(
|
|
13185
|
+
parts.push(print6(commentPath));
|
|
13186
13186
|
return (0, lines_1.concat)(parts);
|
|
13187
13187
|
}
|
|
13188
|
-
function printComments(path3,
|
|
13188
|
+
function printComments(path3, print6) {
|
|
13189
13189
|
var value = path3.getValue();
|
|
13190
|
-
var innerLines =
|
|
13190
|
+
var innerLines = print6(path3);
|
|
13191
13191
|
var comments = n.Node.check(value) && types4.getFieldValue(value, "comments");
|
|
13192
13192
|
if (!comments || comments.length === 0) {
|
|
13193
13193
|
return innerLines;
|
|
@@ -13199,9 +13199,9 @@ var require_comments2 = __commonJS({
|
|
|
13199
13199
|
var leading = types4.getFieldValue(comment, "leading");
|
|
13200
13200
|
var trailing = types4.getFieldValue(comment, "trailing");
|
|
13201
13201
|
if (leading || trailing && !(n.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
13202
|
-
leadingParts.push(printLeadingComment(commentPath,
|
|
13202
|
+
leadingParts.push(printLeadingComment(commentPath, print6));
|
|
13203
13203
|
} else if (trailing) {
|
|
13204
|
-
trailingParts.push(printTrailingComment(commentPath,
|
|
13204
|
+
trailingParts.push(printTrailingComment(commentPath, print6));
|
|
13205
13205
|
}
|
|
13206
13206
|
}, "comments");
|
|
13207
13207
|
leadingParts.push.apply(leadingParts, trailingParts);
|
|
@@ -13892,7 +13892,7 @@ var require_patcher2 = __commonJS({
|
|
|
13892
13892
|
};
|
|
13893
13893
|
exports.Patcher = Patcher;
|
|
13894
13894
|
var Pp = Patcher.prototype;
|
|
13895
|
-
Pp.tryToReprintComments = function(newNode, oldNode,
|
|
13895
|
+
Pp.tryToReprintComments = function(newNode, oldNode, print6) {
|
|
13896
13896
|
var patcher = this;
|
|
13897
13897
|
if (!newNode.comments && !oldNode.comments) {
|
|
13898
13898
|
return true;
|
|
@@ -13909,7 +13909,7 @@ var require_patcher2 = __commonJS({
|
|
|
13909
13909
|
assert_1.default.ok(oldComment.leading || oldComment.trailing);
|
|
13910
13910
|
patcher.replace(
|
|
13911
13911
|
oldComment.loc,
|
|
13912
|
-
|
|
13912
|
+
print6(reprint.newPath).indentTail(oldComment.loc.indent)
|
|
13913
13913
|
);
|
|
13914
13914
|
});
|
|
13915
13915
|
}
|
|
@@ -13956,17 +13956,17 @@ var require_patcher2 = __commonJS({
|
|
|
13956
13956
|
var reprints = [];
|
|
13957
13957
|
if (!lines || !findReprints(path3, reprints))
|
|
13958
13958
|
return;
|
|
13959
|
-
return function(
|
|
13959
|
+
return function(print6) {
|
|
13960
13960
|
var patcher = new Patcher(lines);
|
|
13961
13961
|
reprints.forEach(function(reprint) {
|
|
13962
13962
|
var newNode = reprint.newPath.getValue();
|
|
13963
13963
|
var oldNode = reprint.oldPath.getValue();
|
|
13964
13964
|
SourceLocation.assert(oldNode.loc, true);
|
|
13965
|
-
var needToPrintNewPathWithComments = !patcher.tryToReprintComments(newNode, oldNode,
|
|
13965
|
+
var needToPrintNewPathWithComments = !patcher.tryToReprintComments(newNode, oldNode, print6);
|
|
13966
13966
|
if (needToPrintNewPathWithComments) {
|
|
13967
13967
|
patcher.deleteComments(oldNode);
|
|
13968
13968
|
}
|
|
13969
|
-
var newLines =
|
|
13969
|
+
var newLines = print6(reprint.newPath, {
|
|
13970
13970
|
includeComments: needToPrintNewPathWithComments,
|
|
13971
13971
|
avoidRootParens: oldNode.type === newNode.type && reprint.oldPath.hasParens()
|
|
13972
13972
|
}).indentTail(oldNode.loc.indent);
|
|
@@ -14183,10 +14183,10 @@ var require_printer2 = __commonJS({
|
|
|
14183
14183
|
function makePrintFunctionWith(options, overrides) {
|
|
14184
14184
|
options = Object.assign({}, options, overrides);
|
|
14185
14185
|
return function(path3) {
|
|
14186
|
-
return
|
|
14186
|
+
return print6(path3, options);
|
|
14187
14187
|
};
|
|
14188
14188
|
}
|
|
14189
|
-
function
|
|
14189
|
+
function print6(path3, options) {
|
|
14190
14190
|
assert_1.default.ok(path3 instanceof fast_path_1.default);
|
|
14191
14191
|
options = options || {};
|
|
14192
14192
|
if (options.includeComments) {
|
|
@@ -14202,7 +14202,7 @@ var require_printer2 = __commonJS({
|
|
|
14202
14202
|
}
|
|
14203
14203
|
}
|
|
14204
14204
|
var reprinter = (0, patcher_1.getReprinter)(path3);
|
|
14205
|
-
var lines = reprinter ? reprinter(
|
|
14205
|
+
var lines = reprinter ? reprinter(print6) : genericPrint(path3, config, options, makePrintFunctionWith(options, {
|
|
14206
14206
|
includeComments: true,
|
|
14207
14207
|
avoidRootParens: false
|
|
14208
14208
|
}));
|
|
@@ -14213,7 +14213,7 @@ var require_printer2 = __commonJS({
|
|
|
14213
14213
|
if (!ast) {
|
|
14214
14214
|
return emptyPrintResult;
|
|
14215
14215
|
}
|
|
14216
|
-
var lines =
|
|
14216
|
+
var lines = print6(fast_path_1.default.from(ast), {
|
|
14217
14217
|
includeComments: true,
|
|
14218
14218
|
avoidRootParens: false
|
|
14219
14219
|
});
|
|
@@ -14266,7 +14266,7 @@ var require_printer2 = __commonJS({
|
|
|
14266
14266
|
}
|
|
14267
14267
|
return (0, lines_1.concat)(parts);
|
|
14268
14268
|
}
|
|
14269
|
-
function genericPrintNoParens(path3, options,
|
|
14269
|
+
function genericPrintNoParens(path3, options, print6) {
|
|
14270
14270
|
var n = path3.getValue();
|
|
14271
14271
|
if (!n) {
|
|
14272
14272
|
return (0, lines_1.fromString)("");
|
|
@@ -14278,45 +14278,45 @@ var require_printer2 = __commonJS({
|
|
|
14278
14278
|
var parts = [];
|
|
14279
14279
|
switch (n.type) {
|
|
14280
14280
|
case "File":
|
|
14281
|
-
return path3.call(
|
|
14281
|
+
return path3.call(print6, "program");
|
|
14282
14282
|
case "Program":
|
|
14283
14283
|
if (n.directives) {
|
|
14284
14284
|
path3.each(function(childPath) {
|
|
14285
|
-
parts.push(
|
|
14285
|
+
parts.push(print6(childPath), ";\n");
|
|
14286
14286
|
}, "directives");
|
|
14287
14287
|
}
|
|
14288
14288
|
if (n.interpreter) {
|
|
14289
|
-
parts.push(path3.call(
|
|
14289
|
+
parts.push(path3.call(print6, "interpreter"));
|
|
14290
14290
|
}
|
|
14291
14291
|
parts.push(path3.call(function(bodyPath) {
|
|
14292
|
-
return printStatementSequence(bodyPath, options,
|
|
14292
|
+
return printStatementSequence(bodyPath, options, print6);
|
|
14293
14293
|
}, "body"));
|
|
14294
14294
|
return (0, lines_1.concat)(parts);
|
|
14295
14295
|
case "Noop":
|
|
14296
14296
|
case "EmptyStatement":
|
|
14297
14297
|
return (0, lines_1.fromString)("");
|
|
14298
14298
|
case "ExpressionStatement":
|
|
14299
|
-
return (0, lines_1.concat)([path3.call(
|
|
14299
|
+
return (0, lines_1.concat)([path3.call(print6, "expression"), ";"]);
|
|
14300
14300
|
case "ParenthesizedExpression":
|
|
14301
|
-
return (0, lines_1.concat)(["(", path3.call(
|
|
14301
|
+
return (0, lines_1.concat)(["(", path3.call(print6, "expression"), ")"]);
|
|
14302
14302
|
case "BinaryExpression":
|
|
14303
14303
|
case "LogicalExpression":
|
|
14304
14304
|
case "AssignmentExpression":
|
|
14305
14305
|
return (0, lines_1.fromString)(" ").join([
|
|
14306
|
-
path3.call(
|
|
14306
|
+
path3.call(print6, "left"),
|
|
14307
14307
|
n.operator,
|
|
14308
|
-
path3.call(
|
|
14308
|
+
path3.call(print6, "right")
|
|
14309
14309
|
]);
|
|
14310
14310
|
case "AssignmentPattern":
|
|
14311
14311
|
return (0, lines_1.concat)([
|
|
14312
|
-
path3.call(
|
|
14312
|
+
path3.call(print6, "left"),
|
|
14313
14313
|
" = ",
|
|
14314
|
-
path3.call(
|
|
14314
|
+
path3.call(print6, "right")
|
|
14315
14315
|
]);
|
|
14316
14316
|
case "MemberExpression":
|
|
14317
14317
|
case "OptionalMemberExpression": {
|
|
14318
|
-
parts.push(path3.call(
|
|
14319
|
-
var property = path3.call(
|
|
14318
|
+
parts.push(path3.call(print6, "object"));
|
|
14319
|
+
var property = path3.call(print6, "property");
|
|
14320
14320
|
var optional = types4.getFieldValue(n, "optional");
|
|
14321
14321
|
if (n.computed) {
|
|
14322
14322
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
@@ -14326,18 +14326,18 @@ var require_printer2 = __commonJS({
|
|
|
14326
14326
|
return (0, lines_1.concat)(parts);
|
|
14327
14327
|
}
|
|
14328
14328
|
case "ChainExpression":
|
|
14329
|
-
return path3.call(
|
|
14329
|
+
return path3.call(print6, "expression");
|
|
14330
14330
|
case "MetaProperty":
|
|
14331
14331
|
return (0, lines_1.concat)([
|
|
14332
|
-
path3.call(
|
|
14332
|
+
path3.call(print6, "meta"),
|
|
14333
14333
|
".",
|
|
14334
|
-
path3.call(
|
|
14334
|
+
path3.call(print6, "property")
|
|
14335
14335
|
]);
|
|
14336
14336
|
case "BindExpression":
|
|
14337
14337
|
if (n.object) {
|
|
14338
|
-
parts.push(path3.call(
|
|
14338
|
+
parts.push(path3.call(print6, "object"));
|
|
14339
14339
|
}
|
|
14340
|
-
parts.push("::", path3.call(
|
|
14340
|
+
parts.push("::", path3.call(print6, "callee"));
|
|
14341
14341
|
return (0, lines_1.concat)(parts);
|
|
14342
14342
|
case "Path":
|
|
14343
14343
|
return (0, lines_1.fromString)(".").join(n.body);
|
|
@@ -14345,7 +14345,7 @@ var require_printer2 = __commonJS({
|
|
|
14345
14345
|
return (0, lines_1.concat)([
|
|
14346
14346
|
(0, lines_1.fromString)(n.name, options),
|
|
14347
14347
|
n.optional ? "?" : "",
|
|
14348
|
-
path3.call(
|
|
14348
|
+
path3.call(print6, "typeAnnotation")
|
|
14349
14349
|
]);
|
|
14350
14350
|
case "SpreadElement":
|
|
14351
14351
|
case "SpreadElementPattern":
|
|
@@ -14356,8 +14356,8 @@ var require_printer2 = __commonJS({
|
|
|
14356
14356
|
case "RestElement":
|
|
14357
14357
|
return (0, lines_1.concat)([
|
|
14358
14358
|
"...",
|
|
14359
|
-
path3.call(
|
|
14360
|
-
path3.call(
|
|
14359
|
+
path3.call(print6, "argument"),
|
|
14360
|
+
path3.call(print6, "typeAnnotation")
|
|
14361
14361
|
]);
|
|
14362
14362
|
case "FunctionDeclaration":
|
|
14363
14363
|
case "FunctionExpression":
|
|
@@ -14372,15 +14372,15 @@ var require_printer2 = __commonJS({
|
|
|
14372
14372
|
if (n.generator)
|
|
14373
14373
|
parts.push("*");
|
|
14374
14374
|
if (n.id) {
|
|
14375
|
-
parts.push(" ", path3.call(
|
|
14375
|
+
parts.push(" ", path3.call(print6, "id"), path3.call(print6, "typeParameters"));
|
|
14376
14376
|
} else {
|
|
14377
14377
|
if (n.typeParameters) {
|
|
14378
|
-
parts.push(path3.call(
|
|
14378
|
+
parts.push(path3.call(print6, "typeParameters"));
|
|
14379
14379
|
}
|
|
14380
14380
|
}
|
|
14381
|
-
parts.push("(", printFunctionParams(path3, options,
|
|
14381
|
+
parts.push("(", printFunctionParams(path3, options, print6), ")", path3.call(print6, "returnType"));
|
|
14382
14382
|
if (n.body) {
|
|
14383
|
-
parts.push(" ", path3.call(
|
|
14383
|
+
parts.push(" ", path3.call(print6, "body"));
|
|
14384
14384
|
}
|
|
14385
14385
|
return (0, lines_1.concat)(parts);
|
|
14386
14386
|
case "ArrowFunctionExpression":
|
|
@@ -14388,44 +14388,44 @@ var require_printer2 = __commonJS({
|
|
|
14388
14388
|
parts.push("async ");
|
|
14389
14389
|
}
|
|
14390
14390
|
if (n.typeParameters) {
|
|
14391
|
-
parts.push(path3.call(
|
|
14391
|
+
parts.push(path3.call(print6, "typeParameters"));
|
|
14392
14392
|
}
|
|
14393
14393
|
if (!options.arrowParensAlways && n.params.length === 1 && !n.rest && n.params[0].type === "Identifier" && !n.params[0].typeAnnotation && !n.returnType) {
|
|
14394
|
-
parts.push(path3.call(
|
|
14394
|
+
parts.push(path3.call(print6, "params", 0));
|
|
14395
14395
|
} else {
|
|
14396
|
-
parts.push("(", printFunctionParams(path3, options,
|
|
14396
|
+
parts.push("(", printFunctionParams(path3, options, print6), ")", path3.call(print6, "returnType"));
|
|
14397
14397
|
}
|
|
14398
|
-
parts.push(" => ", path3.call(
|
|
14398
|
+
parts.push(" => ", path3.call(print6, "body"));
|
|
14399
14399
|
return (0, lines_1.concat)(parts);
|
|
14400
14400
|
case "MethodDefinition":
|
|
14401
|
-
return printMethod(path3, options,
|
|
14401
|
+
return printMethod(path3, options, print6);
|
|
14402
14402
|
case "YieldExpression":
|
|
14403
14403
|
parts.push("yield");
|
|
14404
14404
|
if (n.delegate)
|
|
14405
14405
|
parts.push("*");
|
|
14406
14406
|
if (n.argument)
|
|
14407
|
-
parts.push(" ", path3.call(
|
|
14407
|
+
parts.push(" ", path3.call(print6, "argument"));
|
|
14408
14408
|
return (0, lines_1.concat)(parts);
|
|
14409
14409
|
case "AwaitExpression":
|
|
14410
14410
|
parts.push("await");
|
|
14411
14411
|
if (n.all)
|
|
14412
14412
|
parts.push("*");
|
|
14413
14413
|
if (n.argument)
|
|
14414
|
-
parts.push(" ", path3.call(
|
|
14414
|
+
parts.push(" ", path3.call(print6, "argument"));
|
|
14415
14415
|
return (0, lines_1.concat)(parts);
|
|
14416
14416
|
case "ModuleExpression":
|
|
14417
14417
|
return (0, lines_1.concat)([
|
|
14418
14418
|
"module {\n",
|
|
14419
|
-
path3.call(
|
|
14419
|
+
path3.call(print6, "body").indent(options.tabWidth),
|
|
14420
14420
|
"\n}"
|
|
14421
14421
|
]);
|
|
14422
14422
|
case "ModuleDeclaration":
|
|
14423
|
-
parts.push("module", path3.call(
|
|
14423
|
+
parts.push("module", path3.call(print6, "id"));
|
|
14424
14424
|
if (n.source) {
|
|
14425
14425
|
assert_1.default.ok(!n.body);
|
|
14426
|
-
parts.push("from", path3.call(
|
|
14426
|
+
parts.push("from", path3.call(print6, "source"));
|
|
14427
14427
|
} else {
|
|
14428
|
-
parts.push(path3.call(
|
|
14428
|
+
parts.push(path3.call(print6, "body"));
|
|
14429
14429
|
}
|
|
14430
14430
|
return (0, lines_1.fromString)(" ").join(parts);
|
|
14431
14431
|
case "ImportSpecifier":
|
|
@@ -14433,27 +14433,27 @@ var require_printer2 = __commonJS({
|
|
|
14433
14433
|
parts.push(n.importKind + " ");
|
|
14434
14434
|
}
|
|
14435
14435
|
if (n.imported) {
|
|
14436
|
-
parts.push(path3.call(
|
|
14436
|
+
parts.push(path3.call(print6, "imported"));
|
|
14437
14437
|
if (n.local && n.local.name !== n.imported.name) {
|
|
14438
|
-
parts.push(" as ", path3.call(
|
|
14438
|
+
parts.push(" as ", path3.call(print6, "local"));
|
|
14439
14439
|
}
|
|
14440
14440
|
} else if (n.id) {
|
|
14441
|
-
parts.push(path3.call(
|
|
14441
|
+
parts.push(path3.call(print6, "id"));
|
|
14442
14442
|
if (n.name) {
|
|
14443
|
-
parts.push(" as ", path3.call(
|
|
14443
|
+
parts.push(" as ", path3.call(print6, "name"));
|
|
14444
14444
|
}
|
|
14445
14445
|
}
|
|
14446
14446
|
return (0, lines_1.concat)(parts);
|
|
14447
14447
|
case "ExportSpecifier":
|
|
14448
14448
|
if (n.local) {
|
|
14449
|
-
parts.push(path3.call(
|
|
14449
|
+
parts.push(path3.call(print6, "local"));
|
|
14450
14450
|
if (n.exported && n.exported.name !== n.local.name) {
|
|
14451
|
-
parts.push(" as ", path3.call(
|
|
14451
|
+
parts.push(" as ", path3.call(print6, "exported"));
|
|
14452
14452
|
}
|
|
14453
14453
|
} else if (n.id) {
|
|
14454
|
-
parts.push(path3.call(
|
|
14454
|
+
parts.push(path3.call(print6, "id"));
|
|
14455
14455
|
if (n.name) {
|
|
14456
|
-
parts.push(" as ", path3.call(
|
|
14456
|
+
parts.push(" as ", path3.call(print6, "name"));
|
|
14457
14457
|
}
|
|
14458
14458
|
}
|
|
14459
14459
|
return (0, lines_1.concat)(parts);
|
|
@@ -14462,40 +14462,40 @@ var require_printer2 = __commonJS({
|
|
|
14462
14462
|
case "ImportNamespaceSpecifier":
|
|
14463
14463
|
parts.push("* as ");
|
|
14464
14464
|
if (n.local) {
|
|
14465
|
-
parts.push(path3.call(
|
|
14465
|
+
parts.push(path3.call(print6, "local"));
|
|
14466
14466
|
} else if (n.id) {
|
|
14467
|
-
parts.push(path3.call(
|
|
14467
|
+
parts.push(path3.call(print6, "id"));
|
|
14468
14468
|
}
|
|
14469
14469
|
return (0, lines_1.concat)(parts);
|
|
14470
14470
|
case "ImportDefaultSpecifier":
|
|
14471
14471
|
if (n.local) {
|
|
14472
|
-
return path3.call(
|
|
14472
|
+
return path3.call(print6, "local");
|
|
14473
14473
|
}
|
|
14474
|
-
return path3.call(
|
|
14474
|
+
return path3.call(print6, "id");
|
|
14475
14475
|
case "TSExportAssignment":
|
|
14476
|
-
return (0, lines_1.concat)(["export = ", path3.call(
|
|
14476
|
+
return (0, lines_1.concat)(["export = ", path3.call(print6, "expression")]);
|
|
14477
14477
|
case "ExportDeclaration":
|
|
14478
14478
|
case "ExportDefaultDeclaration":
|
|
14479
14479
|
case "ExportNamedDeclaration":
|
|
14480
|
-
return printExportDeclaration(path3, options,
|
|
14480
|
+
return printExportDeclaration(path3, options, print6);
|
|
14481
14481
|
case "ExportAllDeclaration":
|
|
14482
14482
|
parts.push("export *");
|
|
14483
14483
|
if (n.exported) {
|
|
14484
|
-
parts.push(" as ", path3.call(
|
|
14484
|
+
parts.push(" as ", path3.call(print6, "exported"));
|
|
14485
14485
|
}
|
|
14486
|
-
parts.push(" from ", path3.call(
|
|
14486
|
+
parts.push(" from ", path3.call(print6, "source"), ";");
|
|
14487
14487
|
return (0, lines_1.concat)(parts);
|
|
14488
14488
|
case "TSNamespaceExportDeclaration":
|
|
14489
|
-
parts.push("export as namespace ", path3.call(
|
|
14489
|
+
parts.push("export as namespace ", path3.call(print6, "id"));
|
|
14490
14490
|
return maybeAddSemicolon((0, lines_1.concat)(parts));
|
|
14491
14491
|
case "ExportNamespaceSpecifier":
|
|
14492
|
-
return (0, lines_1.concat)(["* as ", path3.call(
|
|
14492
|
+
return (0, lines_1.concat)(["* as ", path3.call(print6, "exported")]);
|
|
14493
14493
|
case "ExportDefaultSpecifier":
|
|
14494
|
-
return path3.call(
|
|
14494
|
+
return path3.call(print6, "exported");
|
|
14495
14495
|
case "Import":
|
|
14496
14496
|
return (0, lines_1.fromString)("import", options);
|
|
14497
14497
|
case "ImportExpression":
|
|
14498
|
-
return (0, lines_1.concat)(["import(", path3.call(
|
|
14498
|
+
return (0, lines_1.concat)(["import(", path3.call(print6, "source"), ")"]);
|
|
14499
14499
|
case "ImportDeclaration": {
|
|
14500
14500
|
parts.push("import ");
|
|
14501
14501
|
if (n.importKind && n.importKind !== "value") {
|
|
@@ -14507,9 +14507,9 @@ var require_printer2 = __commonJS({
|
|
|
14507
14507
|
path3.each(function(specifierPath) {
|
|
14508
14508
|
var spec = specifierPath.getValue();
|
|
14509
14509
|
if (spec.type === "ImportSpecifier") {
|
|
14510
|
-
bracedSpecifiers_1.push(
|
|
14510
|
+
bracedSpecifiers_1.push(print6(specifierPath));
|
|
14511
14511
|
} else if (spec.type === "ImportDefaultSpecifier" || spec.type === "ImportNamespaceSpecifier") {
|
|
14512
|
-
unbracedSpecifiers_1.push(
|
|
14512
|
+
unbracedSpecifiers_1.push(print6(specifierPath));
|
|
14513
14513
|
}
|
|
14514
14514
|
}, "specifiers");
|
|
14515
14515
|
unbracedSpecifiers_1.forEach(function(lines2, i2) {
|
|
@@ -14539,16 +14539,16 @@ var require_printer2 = __commonJS({
|
|
|
14539
14539
|
}
|
|
14540
14540
|
parts.push(" from ");
|
|
14541
14541
|
}
|
|
14542
|
-
parts.push(path3.call(
|
|
14542
|
+
parts.push(path3.call(print6, "source"), maybePrintImportAssertions(path3, options, print6), ";");
|
|
14543
14543
|
return (0, lines_1.concat)(parts);
|
|
14544
14544
|
}
|
|
14545
14545
|
case "ImportAttribute":
|
|
14546
|
-
return (0, lines_1.concat)([path3.call(
|
|
14546
|
+
return (0, lines_1.concat)([path3.call(print6, "key"), ": ", path3.call(print6, "value")]);
|
|
14547
14547
|
case "StaticBlock":
|
|
14548
14548
|
parts.push("static ");
|
|
14549
14549
|
case "BlockStatement": {
|
|
14550
14550
|
var naked_1 = path3.call(function(bodyPath) {
|
|
14551
|
-
return printStatementSequence(bodyPath, options,
|
|
14551
|
+
return printStatementSequence(bodyPath, options, print6);
|
|
14552
14552
|
}, "body");
|
|
14553
14553
|
if (naked_1.isEmpty()) {
|
|
14554
14554
|
if (!n.directives || n.directives.length === 0) {
|
|
@@ -14559,7 +14559,7 @@ var require_printer2 = __commonJS({
|
|
|
14559
14559
|
parts.push("{\n");
|
|
14560
14560
|
if (n.directives) {
|
|
14561
14561
|
path3.each(function(childPath) {
|
|
14562
|
-
parts.push(maybeAddSemicolon(
|
|
14562
|
+
parts.push(maybeAddSemicolon(print6(childPath).indent(options.tabWidth)), n.directives.length > 1 || !naked_1.isEmpty() ? "\n" : "");
|
|
14563
14563
|
}, "directives");
|
|
14564
14564
|
}
|
|
14565
14565
|
parts.push(naked_1.indent(options.tabWidth));
|
|
@@ -14569,7 +14569,7 @@ var require_printer2 = __commonJS({
|
|
|
14569
14569
|
case "ReturnStatement": {
|
|
14570
14570
|
parts.push("return");
|
|
14571
14571
|
if (n.argument) {
|
|
14572
|
-
var argLines = path3.call(
|
|
14572
|
+
var argLines = path3.call(print6, "argument");
|
|
14573
14573
|
if (argLines.startsWithComment() || argLines.length > 1 && namedTypes.JSXElement && namedTypes.JSXElement.check(n.argument)) {
|
|
14574
14574
|
parts.push(" (\n", argLines.indent(options.tabWidth), "\n)");
|
|
14575
14575
|
} else {
|
|
@@ -14581,17 +14581,17 @@ var require_printer2 = __commonJS({
|
|
|
14581
14581
|
}
|
|
14582
14582
|
case "CallExpression":
|
|
14583
14583
|
case "OptionalCallExpression":
|
|
14584
|
-
parts.push(path3.call(
|
|
14584
|
+
parts.push(path3.call(print6, "callee"));
|
|
14585
14585
|
if (n.typeParameters) {
|
|
14586
|
-
parts.push(path3.call(
|
|
14586
|
+
parts.push(path3.call(print6, "typeParameters"));
|
|
14587
14587
|
}
|
|
14588
14588
|
if (n.typeArguments) {
|
|
14589
|
-
parts.push(path3.call(
|
|
14589
|
+
parts.push(path3.call(print6, "typeArguments"));
|
|
14590
14590
|
}
|
|
14591
14591
|
if (types4.getFieldValue(n, "optional")) {
|
|
14592
14592
|
parts.push("?.");
|
|
14593
14593
|
}
|
|
14594
|
-
parts.push(printArgumentsList(path3, options,
|
|
14594
|
+
parts.push(printArgumentsList(path3, options, print6));
|
|
14595
14595
|
return (0, lines_1.concat)(parts);
|
|
14596
14596
|
case "RecordExpression":
|
|
14597
14597
|
parts.push("#");
|
|
@@ -14621,7 +14621,7 @@ var require_printer2 = __commonJS({
|
|
|
14621
14621
|
var i_1 = 0;
|
|
14622
14622
|
fields.forEach(function(field) {
|
|
14623
14623
|
path3.each(function(childPath) {
|
|
14624
|
-
var lines2 =
|
|
14624
|
+
var lines2 = print6(childPath);
|
|
14625
14625
|
if (!oneLine_1) {
|
|
14626
14626
|
lines2 = lines2.indent(options.tabWidth);
|
|
14627
14627
|
}
|
|
@@ -14658,32 +14658,32 @@ var require_printer2 = __commonJS({
|
|
|
14658
14658
|
parts[parts.length - 1] = " " + rightBrace;
|
|
14659
14659
|
}
|
|
14660
14660
|
if (n.typeAnnotation) {
|
|
14661
|
-
parts.push(path3.call(
|
|
14661
|
+
parts.push(path3.call(print6, "typeAnnotation"));
|
|
14662
14662
|
}
|
|
14663
14663
|
return (0, lines_1.concat)(parts);
|
|
14664
14664
|
}
|
|
14665
14665
|
case "PropertyPattern":
|
|
14666
14666
|
return (0, lines_1.concat)([
|
|
14667
|
-
path3.call(
|
|
14667
|
+
path3.call(print6, "key"),
|
|
14668
14668
|
": ",
|
|
14669
|
-
path3.call(
|
|
14669
|
+
path3.call(print6, "pattern")
|
|
14670
14670
|
]);
|
|
14671
14671
|
case "ObjectProperty":
|
|
14672
14672
|
case "Property": {
|
|
14673
14673
|
if (n.method || n.kind === "get" || n.kind === "set") {
|
|
14674
|
-
return printMethod(path3, options,
|
|
14674
|
+
return printMethod(path3, options, print6);
|
|
14675
14675
|
}
|
|
14676
14676
|
if (n.shorthand && n.value.type === "AssignmentPattern") {
|
|
14677
|
-
return path3.call(
|
|
14677
|
+
return path3.call(print6, "value");
|
|
14678
14678
|
}
|
|
14679
|
-
var key = path3.call(
|
|
14679
|
+
var key = path3.call(print6, "key");
|
|
14680
14680
|
if (n.computed) {
|
|
14681
14681
|
parts.push("[", key, "]");
|
|
14682
14682
|
} else {
|
|
14683
14683
|
parts.push(key);
|
|
14684
14684
|
}
|
|
14685
14685
|
if (!n.shorthand || n.key.name !== n.value.name) {
|
|
14686
|
-
parts.push(": ", path3.call(
|
|
14686
|
+
parts.push(": ", path3.call(print6, "value"));
|
|
14687
14687
|
}
|
|
14688
14688
|
return (0, lines_1.concat)(parts);
|
|
14689
14689
|
}
|
|
@@ -14691,18 +14691,18 @@ var require_printer2 = __commonJS({
|
|
|
14691
14691
|
case "ObjectMethod":
|
|
14692
14692
|
case "ClassPrivateMethod":
|
|
14693
14693
|
case "TSDeclareMethod":
|
|
14694
|
-
return printMethod(path3, options,
|
|
14694
|
+
return printMethod(path3, options, print6);
|
|
14695
14695
|
case "PrivateName":
|
|
14696
|
-
return (0, lines_1.concat)(["#", path3.call(
|
|
14696
|
+
return (0, lines_1.concat)(["#", path3.call(print6, "id")]);
|
|
14697
14697
|
case "Decorator":
|
|
14698
|
-
return (0, lines_1.concat)(["@", path3.call(
|
|
14698
|
+
return (0, lines_1.concat)(["@", path3.call(print6, "expression")]);
|
|
14699
14699
|
case "TupleExpression":
|
|
14700
14700
|
parts.push("#");
|
|
14701
14701
|
case "ArrayExpression":
|
|
14702
14702
|
case "ArrayPattern": {
|
|
14703
14703
|
var elems = n.elements;
|
|
14704
14704
|
var len_2 = elems.length;
|
|
14705
|
-
var printed_1 = path3.map(
|
|
14705
|
+
var printed_1 = path3.map(print6, "elements");
|
|
14706
14706
|
var joined = (0, lines_1.fromString)(", ").join(printed_1);
|
|
14707
14707
|
var oneLine_2 = joined.getLineLength(1) <= options.wrapColumn;
|
|
14708
14708
|
if (oneLine_2) {
|
|
@@ -14740,12 +14740,12 @@ var require_printer2 = __commonJS({
|
|
|
14740
14740
|
parts.push("]");
|
|
14741
14741
|
}
|
|
14742
14742
|
if (n.typeAnnotation) {
|
|
14743
|
-
parts.push(path3.call(
|
|
14743
|
+
parts.push(path3.call(print6, "typeAnnotation"));
|
|
14744
14744
|
}
|
|
14745
14745
|
return (0, lines_1.concat)(parts);
|
|
14746
14746
|
}
|
|
14747
14747
|
case "SequenceExpression":
|
|
14748
|
-
return (0, lines_1.fromString)(", ").join(path3.map(
|
|
14748
|
+
return (0, lines_1.fromString)(", ").join(path3.map(print6, "expressions"));
|
|
14749
14749
|
case "ThisExpression":
|
|
14750
14750
|
return (0, lines_1.fromString)("this");
|
|
14751
14751
|
case "Super":
|
|
@@ -14766,7 +14766,7 @@ var require_printer2 = __commonJS({
|
|
|
14766
14766
|
case "Literal":
|
|
14767
14767
|
return (0, lines_1.fromString)(getPossibleRaw(n) || (typeof n.value === "string" ? nodeStr(n.value, options) : n.value), options);
|
|
14768
14768
|
case "Directive":
|
|
14769
|
-
return path3.call(
|
|
14769
|
+
return path3.call(print6, "value");
|
|
14770
14770
|
case "DirectiveLiteral":
|
|
14771
14771
|
return (0, lines_1.fromString)(getPossibleRaw(n) || nodeStr(n.value, options), options);
|
|
14772
14772
|
case "InterpreterDirective":
|
|
@@ -14780,32 +14780,32 @@ var require_printer2 = __commonJS({
|
|
|
14780
14780
|
parts.push(n.operator);
|
|
14781
14781
|
if (/[a-z]$/.test(n.operator))
|
|
14782
14782
|
parts.push(" ");
|
|
14783
|
-
parts.push(path3.call(
|
|
14783
|
+
parts.push(path3.call(print6, "argument"));
|
|
14784
14784
|
return (0, lines_1.concat)(parts);
|
|
14785
14785
|
case "UpdateExpression":
|
|
14786
|
-
parts.push(path3.call(
|
|
14786
|
+
parts.push(path3.call(print6, "argument"), n.operator);
|
|
14787
14787
|
if (n.prefix)
|
|
14788
14788
|
parts.reverse();
|
|
14789
14789
|
return (0, lines_1.concat)(parts);
|
|
14790
14790
|
case "ConditionalExpression":
|
|
14791
14791
|
return (0, lines_1.concat)([
|
|
14792
|
-
path3.call(
|
|
14792
|
+
path3.call(print6, "test"),
|
|
14793
14793
|
" ? ",
|
|
14794
|
-
path3.call(
|
|
14794
|
+
path3.call(print6, "consequent"),
|
|
14795
14795
|
" : ",
|
|
14796
|
-
path3.call(
|
|
14796
|
+
path3.call(print6, "alternate")
|
|
14797
14797
|
]);
|
|
14798
14798
|
case "NewExpression": {
|
|
14799
|
-
parts.push("new ", path3.call(
|
|
14799
|
+
parts.push("new ", path3.call(print6, "callee"));
|
|
14800
14800
|
if (n.typeParameters) {
|
|
14801
|
-
parts.push(path3.call(
|
|
14801
|
+
parts.push(path3.call(print6, "typeParameters"));
|
|
14802
14802
|
}
|
|
14803
14803
|
if (n.typeArguments) {
|
|
14804
|
-
parts.push(path3.call(
|
|
14804
|
+
parts.push(path3.call(print6, "typeArguments"));
|
|
14805
14805
|
}
|
|
14806
14806
|
var args = n.arguments;
|
|
14807
14807
|
if (args) {
|
|
14808
|
-
parts.push(printArgumentsList(path3, options,
|
|
14808
|
+
parts.push(printArgumentsList(path3, options, print6));
|
|
14809
14809
|
}
|
|
14810
14810
|
return (0, lines_1.concat)(parts);
|
|
14811
14811
|
}
|
|
@@ -14816,7 +14816,7 @@ var require_printer2 = __commonJS({
|
|
|
14816
14816
|
parts.push(n.kind, " ");
|
|
14817
14817
|
var maxLen_1 = 0;
|
|
14818
14818
|
var printed = path3.map(function(childPath) {
|
|
14819
|
-
var lines2 =
|
|
14819
|
+
var lines2 = print6(childPath);
|
|
14820
14820
|
maxLen_1 = Math.max(lines2.length, maxLen_1);
|
|
14821
14821
|
return lines2;
|
|
14822
14822
|
}, "declarations");
|
|
@@ -14835,30 +14835,30 @@ var require_printer2 = __commonJS({
|
|
|
14835
14835
|
}
|
|
14836
14836
|
case "VariableDeclarator":
|
|
14837
14837
|
return n.init ? (0, lines_1.fromString)(" = ").join([
|
|
14838
|
-
path3.call(
|
|
14839
|
-
path3.call(
|
|
14840
|
-
]) : path3.call(
|
|
14838
|
+
path3.call(print6, "id"),
|
|
14839
|
+
path3.call(print6, "init")
|
|
14840
|
+
]) : path3.call(print6, "id");
|
|
14841
14841
|
case "WithStatement":
|
|
14842
14842
|
return (0, lines_1.concat)([
|
|
14843
14843
|
"with (",
|
|
14844
|
-
path3.call(
|
|
14844
|
+
path3.call(print6, "object"),
|
|
14845
14845
|
") ",
|
|
14846
|
-
path3.call(
|
|
14846
|
+
path3.call(print6, "body")
|
|
14847
14847
|
]);
|
|
14848
14848
|
case "IfStatement": {
|
|
14849
|
-
var con = adjustClause(path3.call(
|
|
14850
|
-
parts.push("if (", path3.call(
|
|
14849
|
+
var con = adjustClause(path3.call(print6, "consequent"), options);
|
|
14850
|
+
parts.push("if (", path3.call(print6, "test"), ")", con);
|
|
14851
14851
|
if (n.alternate)
|
|
14852
|
-
parts.push(endsWithBrace(con) ? " else" : "\nelse", adjustClause(path3.call(
|
|
14852
|
+
parts.push(endsWithBrace(con) ? " else" : "\nelse", adjustClause(path3.call(print6, "alternate"), options));
|
|
14853
14853
|
return (0, lines_1.concat)(parts);
|
|
14854
14854
|
}
|
|
14855
14855
|
case "ForStatement": {
|
|
14856
|
-
var init = path3.call(
|
|
14856
|
+
var init = path3.call(print6, "init");
|
|
14857
14857
|
var sep2 = init.length > 1 ? ";\n" : "; ";
|
|
14858
14858
|
var forParen = "for (";
|
|
14859
|
-
var indented = (0, lines_1.fromString)(sep2).join([init, path3.call(
|
|
14859
|
+
var indented = (0, lines_1.fromString)(sep2).join([init, path3.call(print6, "test"), path3.call(print6, "update")]).indentTail(forParen.length);
|
|
14860
14860
|
var head = (0, lines_1.concat)([forParen, indented, ")"]);
|
|
14861
|
-
var clause = adjustClause(path3.call(
|
|
14861
|
+
var clause = adjustClause(path3.call(print6, "body"), options);
|
|
14862
14862
|
parts.push(head);
|
|
14863
14863
|
if (head.length > 1) {
|
|
14864
14864
|
parts.push("\n");
|
|
@@ -14870,18 +14870,18 @@ var require_printer2 = __commonJS({
|
|
|
14870
14870
|
case "WhileStatement":
|
|
14871
14871
|
return (0, lines_1.concat)([
|
|
14872
14872
|
"while (",
|
|
14873
|
-
path3.call(
|
|
14873
|
+
path3.call(print6, "test"),
|
|
14874
14874
|
")",
|
|
14875
|
-
adjustClause(path3.call(
|
|
14875
|
+
adjustClause(path3.call(print6, "body"), options)
|
|
14876
14876
|
]);
|
|
14877
14877
|
case "ForInStatement":
|
|
14878
14878
|
return (0, lines_1.concat)([
|
|
14879
14879
|
n.each ? "for each (" : "for (",
|
|
14880
|
-
path3.call(
|
|
14880
|
+
path3.call(print6, "left"),
|
|
14881
14881
|
" in ",
|
|
14882
|
-
path3.call(
|
|
14882
|
+
path3.call(print6, "right"),
|
|
14883
14883
|
")",
|
|
14884
|
-
adjustClause(path3.call(
|
|
14884
|
+
adjustClause(path3.call(print6, "body"), options)
|
|
14885
14885
|
]);
|
|
14886
14886
|
case "ForOfStatement":
|
|
14887
14887
|
case "ForAwaitStatement":
|
|
@@ -14889,122 +14889,122 @@ var require_printer2 = __commonJS({
|
|
|
14889
14889
|
if (n.await || n.type === "ForAwaitStatement") {
|
|
14890
14890
|
parts.push("await ");
|
|
14891
14891
|
}
|
|
14892
|
-
parts.push("(", path3.call(
|
|
14892
|
+
parts.push("(", path3.call(print6, "left"), " of ", path3.call(print6, "right"), ")", adjustClause(path3.call(print6, "body"), options));
|
|
14893
14893
|
return (0, lines_1.concat)(parts);
|
|
14894
14894
|
case "DoWhileStatement": {
|
|
14895
14895
|
var doBody = (0, lines_1.concat)([
|
|
14896
14896
|
"do",
|
|
14897
|
-
adjustClause(path3.call(
|
|
14897
|
+
adjustClause(path3.call(print6, "body"), options)
|
|
14898
14898
|
]);
|
|
14899
14899
|
parts.push(doBody);
|
|
14900
14900
|
if (endsWithBrace(doBody))
|
|
14901
14901
|
parts.push(" while");
|
|
14902
14902
|
else
|
|
14903
14903
|
parts.push("\nwhile");
|
|
14904
|
-
parts.push(" (", path3.call(
|
|
14904
|
+
parts.push(" (", path3.call(print6, "test"), ");");
|
|
14905
14905
|
return (0, lines_1.concat)(parts);
|
|
14906
14906
|
}
|
|
14907
14907
|
case "DoExpression": {
|
|
14908
14908
|
var statements = path3.call(function(bodyPath) {
|
|
14909
|
-
return printStatementSequence(bodyPath, options,
|
|
14909
|
+
return printStatementSequence(bodyPath, options, print6);
|
|
14910
14910
|
}, "body");
|
|
14911
14911
|
return (0, lines_1.concat)(["do {\n", statements.indent(options.tabWidth), "\n}"]);
|
|
14912
14912
|
}
|
|
14913
14913
|
case "BreakStatement":
|
|
14914
14914
|
parts.push("break");
|
|
14915
14915
|
if (n.label)
|
|
14916
|
-
parts.push(" ", path3.call(
|
|
14916
|
+
parts.push(" ", path3.call(print6, "label"));
|
|
14917
14917
|
parts.push(";");
|
|
14918
14918
|
return (0, lines_1.concat)(parts);
|
|
14919
14919
|
case "ContinueStatement":
|
|
14920
14920
|
parts.push("continue");
|
|
14921
14921
|
if (n.label)
|
|
14922
|
-
parts.push(" ", path3.call(
|
|
14922
|
+
parts.push(" ", path3.call(print6, "label"));
|
|
14923
14923
|
parts.push(";");
|
|
14924
14924
|
return (0, lines_1.concat)(parts);
|
|
14925
14925
|
case "LabeledStatement":
|
|
14926
14926
|
return (0, lines_1.concat)([
|
|
14927
|
-
path3.call(
|
|
14927
|
+
path3.call(print6, "label"),
|
|
14928
14928
|
":\n",
|
|
14929
|
-
path3.call(
|
|
14929
|
+
path3.call(print6, "body")
|
|
14930
14930
|
]);
|
|
14931
14931
|
case "TryStatement":
|
|
14932
|
-
parts.push("try ", path3.call(
|
|
14932
|
+
parts.push("try ", path3.call(print6, "block"));
|
|
14933
14933
|
if (n.handler) {
|
|
14934
|
-
parts.push(" ", path3.call(
|
|
14934
|
+
parts.push(" ", path3.call(print6, "handler"));
|
|
14935
14935
|
} else if (n.handlers) {
|
|
14936
14936
|
path3.each(function(handlerPath) {
|
|
14937
|
-
parts.push(" ",
|
|
14937
|
+
parts.push(" ", print6(handlerPath));
|
|
14938
14938
|
}, "handlers");
|
|
14939
14939
|
}
|
|
14940
14940
|
if (n.finalizer) {
|
|
14941
|
-
parts.push(" finally ", path3.call(
|
|
14941
|
+
parts.push(" finally ", path3.call(print6, "finalizer"));
|
|
14942
14942
|
}
|
|
14943
14943
|
return (0, lines_1.concat)(parts);
|
|
14944
14944
|
case "CatchClause":
|
|
14945
14945
|
parts.push("catch ");
|
|
14946
14946
|
if (n.param) {
|
|
14947
|
-
parts.push("(", path3.call(
|
|
14947
|
+
parts.push("(", path3.call(print6, "param"));
|
|
14948
14948
|
}
|
|
14949
14949
|
if (n.guard) {
|
|
14950
|
-
parts.push(" if ", path3.call(
|
|
14950
|
+
parts.push(" if ", path3.call(print6, "guard"));
|
|
14951
14951
|
}
|
|
14952
14952
|
if (n.param) {
|
|
14953
14953
|
parts.push(") ");
|
|
14954
14954
|
}
|
|
14955
|
-
parts.push(path3.call(
|
|
14955
|
+
parts.push(path3.call(print6, "body"));
|
|
14956
14956
|
return (0, lines_1.concat)(parts);
|
|
14957
14957
|
case "ThrowStatement":
|
|
14958
|
-
return (0, lines_1.concat)(["throw ", path3.call(
|
|
14958
|
+
return (0, lines_1.concat)(["throw ", path3.call(print6, "argument"), ";"]);
|
|
14959
14959
|
case "SwitchStatement":
|
|
14960
14960
|
return (0, lines_1.concat)([
|
|
14961
14961
|
"switch (",
|
|
14962
|
-
path3.call(
|
|
14962
|
+
path3.call(print6, "discriminant"),
|
|
14963
14963
|
") {\n",
|
|
14964
|
-
(0, lines_1.fromString)("\n").join(path3.map(
|
|
14964
|
+
(0, lines_1.fromString)("\n").join(path3.map(print6, "cases")),
|
|
14965
14965
|
"\n}"
|
|
14966
14966
|
]);
|
|
14967
14967
|
case "SwitchCase":
|
|
14968
14968
|
if (n.test)
|
|
14969
|
-
parts.push("case ", path3.call(
|
|
14969
|
+
parts.push("case ", path3.call(print6, "test"), ":");
|
|
14970
14970
|
else
|
|
14971
14971
|
parts.push("default:");
|
|
14972
14972
|
if (n.consequent.length > 0) {
|
|
14973
14973
|
parts.push("\n", path3.call(function(consequentPath) {
|
|
14974
|
-
return printStatementSequence(consequentPath, options,
|
|
14974
|
+
return printStatementSequence(consequentPath, options, print6);
|
|
14975
14975
|
}, "consequent").indent(options.tabWidth));
|
|
14976
14976
|
}
|
|
14977
14977
|
return (0, lines_1.concat)(parts);
|
|
14978
14978
|
case "DebuggerStatement":
|
|
14979
14979
|
return (0, lines_1.fromString)("debugger;");
|
|
14980
14980
|
case "JSXAttribute":
|
|
14981
|
-
parts.push(path3.call(
|
|
14981
|
+
parts.push(path3.call(print6, "name"));
|
|
14982
14982
|
if (n.value)
|
|
14983
|
-
parts.push("=", path3.call(
|
|
14983
|
+
parts.push("=", path3.call(print6, "value"));
|
|
14984
14984
|
return (0, lines_1.concat)(parts);
|
|
14985
14985
|
case "JSXIdentifier":
|
|
14986
14986
|
return (0, lines_1.fromString)(n.name, options);
|
|
14987
14987
|
case "JSXNamespacedName":
|
|
14988
14988
|
return (0, lines_1.fromString)(":").join([
|
|
14989
|
-
path3.call(
|
|
14990
|
-
path3.call(
|
|
14989
|
+
path3.call(print6, "namespace"),
|
|
14990
|
+
path3.call(print6, "name")
|
|
14991
14991
|
]);
|
|
14992
14992
|
case "JSXMemberExpression":
|
|
14993
14993
|
return (0, lines_1.fromString)(".").join([
|
|
14994
|
-
path3.call(
|
|
14995
|
-
path3.call(
|
|
14994
|
+
path3.call(print6, "object"),
|
|
14995
|
+
path3.call(print6, "property")
|
|
14996
14996
|
]);
|
|
14997
14997
|
case "JSXSpreadAttribute":
|
|
14998
|
-
return (0, lines_1.concat)(["{...", path3.call(
|
|
14998
|
+
return (0, lines_1.concat)(["{...", path3.call(print6, "argument"), "}"]);
|
|
14999
14999
|
case "JSXSpreadChild":
|
|
15000
|
-
return (0, lines_1.concat)(["{...", path3.call(
|
|
15000
|
+
return (0, lines_1.concat)(["{...", path3.call(print6, "expression"), "}"]);
|
|
15001
15001
|
case "JSXExpressionContainer":
|
|
15002
|
-
return (0, lines_1.concat)(["{", path3.call(
|
|
15002
|
+
return (0, lines_1.concat)(["{", path3.call(print6, "expression"), "}"]);
|
|
15003
15003
|
case "JSXElement":
|
|
15004
15004
|
case "JSXFragment": {
|
|
15005
15005
|
var openingPropName = "opening" + (n.type === "JSXElement" ? "Element" : "Fragment");
|
|
15006
15006
|
var closingPropName = "closing" + (n.type === "JSXElement" ? "Element" : "Fragment");
|
|
15007
|
-
var openingLines = path3.call(
|
|
15007
|
+
var openingLines = path3.call(print6, openingPropName);
|
|
15008
15008
|
if (n[openingPropName].selfClosing) {
|
|
15009
15009
|
assert_1.default.ok(!n[closingPropName], "unexpected " + closingPropName + " element in self-closing " + n.type);
|
|
15010
15010
|
return openingLines;
|
|
@@ -15018,16 +15018,16 @@ var require_printer2 = __commonJS({
|
|
|
15018
15018
|
return "\n";
|
|
15019
15019
|
}
|
|
15020
15020
|
}
|
|
15021
|
-
return
|
|
15021
|
+
return print6(childPath);
|
|
15022
15022
|
}, "children")).indentTail(options.tabWidth);
|
|
15023
|
-
var closingLines = path3.call(
|
|
15023
|
+
var closingLines = path3.call(print6, closingPropName);
|
|
15024
15024
|
return (0, lines_1.concat)([openingLines, childLines, closingLines]);
|
|
15025
15025
|
}
|
|
15026
15026
|
case "JSXOpeningElement": {
|
|
15027
|
-
parts.push("<", path3.call(
|
|
15027
|
+
parts.push("<", path3.call(print6, "name"));
|
|
15028
15028
|
var attrParts_1 = [];
|
|
15029
15029
|
path3.each(function(attrPath) {
|
|
15030
|
-
attrParts_1.push(" ",
|
|
15030
|
+
attrParts_1.push(" ", print6(attrPath));
|
|
15031
15031
|
}, "attributes");
|
|
15032
15032
|
var attrLines = (0, lines_1.concat)(attrParts_1);
|
|
15033
15033
|
var needLineWrap = attrLines.length > 1 || attrLines.getLineLength(1) > options.wrapColumn;
|
|
@@ -15044,7 +15044,7 @@ var require_printer2 = __commonJS({
|
|
|
15044
15044
|
return (0, lines_1.concat)(parts);
|
|
15045
15045
|
}
|
|
15046
15046
|
case "JSXClosingElement":
|
|
15047
|
-
return (0, lines_1.concat)(["</", path3.call(
|
|
15047
|
+
return (0, lines_1.concat)(["</", path3.call(print6, "name"), ">"]);
|
|
15048
15048
|
case "JSXOpeningFragment":
|
|
15049
15049
|
return (0, lines_1.fromString)("<>");
|
|
15050
15050
|
case "JSXClosingFragment":
|
|
@@ -15055,9 +15055,9 @@ var require_printer2 = __commonJS({
|
|
|
15055
15055
|
return (0, lines_1.fromString)("");
|
|
15056
15056
|
case "TypeAnnotatedIdentifier":
|
|
15057
15057
|
return (0, lines_1.concat)([
|
|
15058
|
-
path3.call(
|
|
15058
|
+
path3.call(print6, "annotation"),
|
|
15059
15059
|
" ",
|
|
15060
|
-
path3.call(
|
|
15060
|
+
path3.call(print6, "identifier")
|
|
15061
15061
|
]);
|
|
15062
15062
|
case "ClassBody":
|
|
15063
15063
|
if (n.body.length === 0) {
|
|
@@ -15066,12 +15066,12 @@ var require_printer2 = __commonJS({
|
|
|
15066
15066
|
return (0, lines_1.concat)([
|
|
15067
15067
|
"{\n",
|
|
15068
15068
|
path3.call(function(bodyPath) {
|
|
15069
|
-
return printStatementSequence(bodyPath, options,
|
|
15069
|
+
return printStatementSequence(bodyPath, options, print6);
|
|
15070
15070
|
}, "body").indent(options.tabWidth),
|
|
15071
15071
|
"\n}"
|
|
15072
15072
|
]);
|
|
15073
15073
|
case "ClassPropertyDefinition":
|
|
15074
|
-
parts.push("static ", path3.call(
|
|
15074
|
+
parts.push("static ", path3.call(print6, "definition"));
|
|
15075
15075
|
if (!namedTypes.MethodDefinition.check(n.definition))
|
|
15076
15076
|
parts.push(";");
|
|
15077
15077
|
return (0, lines_1.concat)(parts);
|
|
@@ -15092,12 +15092,12 @@ var require_printer2 = __commonJS({
|
|
|
15092
15092
|
if (n.readonly) {
|
|
15093
15093
|
parts.push("readonly ");
|
|
15094
15094
|
}
|
|
15095
|
-
var key = path3.call(
|
|
15095
|
+
var key = path3.call(print6, "key");
|
|
15096
15096
|
if (n.computed) {
|
|
15097
15097
|
key = (0, lines_1.concat)(["[", key, "]"]);
|
|
15098
15098
|
}
|
|
15099
15099
|
if (n.variance) {
|
|
15100
|
-
key = (0, lines_1.concat)([printVariance(path3,
|
|
15100
|
+
key = (0, lines_1.concat)([printVariance(path3, print6), key]);
|
|
15101
15101
|
}
|
|
15102
15102
|
parts.push(key);
|
|
15103
15103
|
if (n.optional) {
|
|
@@ -15107,10 +15107,10 @@ var require_printer2 = __commonJS({
|
|
|
15107
15107
|
parts.push("!");
|
|
15108
15108
|
}
|
|
15109
15109
|
if (n.typeAnnotation) {
|
|
15110
|
-
parts.push(path3.call(
|
|
15110
|
+
parts.push(path3.call(print6, "typeAnnotation"));
|
|
15111
15111
|
}
|
|
15112
15112
|
if (n.value) {
|
|
15113
|
-
parts.push(" = ", path3.call(
|
|
15113
|
+
parts.push(" = ", path3.call(print6, "value"));
|
|
15114
15114
|
}
|
|
15115
15115
|
parts.push(";");
|
|
15116
15116
|
return (0, lines_1.concat)(parts);
|
|
@@ -15119,21 +15119,21 @@ var require_printer2 = __commonJS({
|
|
|
15119
15119
|
if (n.static) {
|
|
15120
15120
|
parts.push("static ");
|
|
15121
15121
|
}
|
|
15122
|
-
parts.push(path3.call(
|
|
15122
|
+
parts.push(path3.call(print6, "key"));
|
|
15123
15123
|
if (n.typeAnnotation) {
|
|
15124
|
-
parts.push(path3.call(
|
|
15124
|
+
parts.push(path3.call(print6, "typeAnnotation"));
|
|
15125
15125
|
}
|
|
15126
15126
|
if (n.value) {
|
|
15127
|
-
parts.push(" = ", path3.call(
|
|
15127
|
+
parts.push(" = ", path3.call(print6, "value"));
|
|
15128
15128
|
}
|
|
15129
15129
|
parts.push(";");
|
|
15130
15130
|
return (0, lines_1.concat)(parts);
|
|
15131
15131
|
case "ClassAccessorProperty": {
|
|
15132
15132
|
parts.push.apply(parts, tslib_1.__spreadArray(tslib_1.__spreadArray([], printClassMemberModifiers(n), false), ["accessor "], false));
|
|
15133
15133
|
if (n.computed) {
|
|
15134
|
-
parts.push("[", path3.call(
|
|
15134
|
+
parts.push("[", path3.call(print6, "key"), "]");
|
|
15135
15135
|
} else {
|
|
15136
|
-
parts.push(path3.call(
|
|
15136
|
+
parts.push(path3.call(print6, "key"));
|
|
15137
15137
|
}
|
|
15138
15138
|
if (n.optional) {
|
|
15139
15139
|
parts.push("?");
|
|
@@ -15142,10 +15142,10 @@ var require_printer2 = __commonJS({
|
|
|
15142
15142
|
parts.push("!");
|
|
15143
15143
|
}
|
|
15144
15144
|
if (n.typeAnnotation) {
|
|
15145
|
-
parts.push(path3.call(
|
|
15145
|
+
parts.push(path3.call(print6, "typeAnnotation"));
|
|
15146
15146
|
}
|
|
15147
15147
|
if (n.value) {
|
|
15148
|
-
parts.push(" = ", path3.call(
|
|
15148
|
+
parts.push(" = ", path3.call(print6, "value"));
|
|
15149
15149
|
}
|
|
15150
15150
|
parts.push(";");
|
|
15151
15151
|
return (0, lines_1.concat)(parts);
|
|
@@ -15161,21 +15161,21 @@ var require_printer2 = __commonJS({
|
|
|
15161
15161
|
}
|
|
15162
15162
|
parts.push("class");
|
|
15163
15163
|
if (n.id) {
|
|
15164
|
-
parts.push(" ", path3.call(
|
|
15164
|
+
parts.push(" ", path3.call(print6, "id"));
|
|
15165
15165
|
}
|
|
15166
15166
|
if (n.typeParameters) {
|
|
15167
|
-
parts.push(path3.call(
|
|
15167
|
+
parts.push(path3.call(print6, "typeParameters"));
|
|
15168
15168
|
}
|
|
15169
15169
|
if (n.superClass) {
|
|
15170
|
-
parts.push(" extends ", path3.call(
|
|
15170
|
+
parts.push(" extends ", path3.call(print6, "superClass"), path3.call(print6, "superTypeParameters"));
|
|
15171
15171
|
}
|
|
15172
15172
|
if (n.extends && n.extends.length > 0) {
|
|
15173
|
-
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path3.map(
|
|
15173
|
+
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path3.map(print6, "extends")));
|
|
15174
15174
|
}
|
|
15175
15175
|
if (n["implements"] && n["implements"].length > 0) {
|
|
15176
|
-
parts.push(" implements ", (0, lines_1.fromString)(", ").join(path3.map(
|
|
15176
|
+
parts.push(" implements ", (0, lines_1.fromString)(", ").join(path3.map(print6, "implements")));
|
|
15177
15177
|
}
|
|
15178
|
-
parts.push(" ", path3.call(
|
|
15178
|
+
parts.push(" ", path3.call(print6, "body"));
|
|
15179
15179
|
if (n.type === "DeclareClass") {
|
|
15180
15180
|
return printFlowDeclaration(path3, parts);
|
|
15181
15181
|
} else {
|
|
@@ -15184,11 +15184,11 @@ var require_printer2 = __commonJS({
|
|
|
15184
15184
|
case "TemplateElement":
|
|
15185
15185
|
return (0, lines_1.fromString)(n.value.raw, options).lockIndentTail();
|
|
15186
15186
|
case "TemplateLiteral": {
|
|
15187
|
-
var expressions_1 = path3.map(
|
|
15187
|
+
var expressions_1 = path3.map(print6, "expressions");
|
|
15188
15188
|
parts.push("`");
|
|
15189
15189
|
path3.each(function(childPath) {
|
|
15190
15190
|
var i2 = childPath.getName();
|
|
15191
|
-
parts.push(
|
|
15191
|
+
parts.push(print6(childPath));
|
|
15192
15192
|
if (i2 < expressions_1.length) {
|
|
15193
15193
|
parts.push("${", expressions_1[i2], "}");
|
|
15194
15194
|
}
|
|
@@ -15197,7 +15197,7 @@ var require_printer2 = __commonJS({
|
|
|
15197
15197
|
return (0, lines_1.concat)(parts).lockIndentTail();
|
|
15198
15198
|
}
|
|
15199
15199
|
case "TaggedTemplateExpression":
|
|
15200
|
-
return (0, lines_1.concat)([path3.call(
|
|
15200
|
+
return (0, lines_1.concat)([path3.call(print6, "tag"), path3.call(print6, "quasi")]);
|
|
15201
15201
|
case "Node":
|
|
15202
15202
|
case "Printable":
|
|
15203
15203
|
case "SourceLocation":
|
|
@@ -15231,7 +15231,7 @@ var require_printer2 = __commonJS({
|
|
|
15231
15231
|
if (n.typeAnnotation.type !== "FunctionTypeAnnotation") {
|
|
15232
15232
|
parts.push(": ");
|
|
15233
15233
|
}
|
|
15234
|
-
parts.push(path3.call(
|
|
15234
|
+
parts.push(path3.call(print6, "typeAnnotation"));
|
|
15235
15235
|
return (0, lines_1.concat)(parts);
|
|
15236
15236
|
}
|
|
15237
15237
|
return (0, lines_1.fromString)("");
|
|
@@ -15245,9 +15245,9 @@ var require_printer2 = __commonJS({
|
|
|
15245
15245
|
case "MixedTypeAnnotation":
|
|
15246
15246
|
return (0, lines_1.fromString)("mixed", options);
|
|
15247
15247
|
case "ArrayTypeAnnotation":
|
|
15248
|
-
return (0, lines_1.concat)([path3.call(
|
|
15248
|
+
return (0, lines_1.concat)([path3.call(print6, "elementType"), "[]"]);
|
|
15249
15249
|
case "TupleTypeAnnotation": {
|
|
15250
|
-
var printed_2 = path3.map(
|
|
15250
|
+
var printed_2 = path3.map(print6, "types");
|
|
15251
15251
|
var joined = (0, lines_1.fromString)(", ").join(printed_2);
|
|
15252
15252
|
var oneLine_3 = joined.getLineLength(1) <= options.wrapColumn;
|
|
15253
15253
|
if (oneLine_3) {
|
|
@@ -15294,38 +15294,38 @@ var require_printer2 = __commonJS({
|
|
|
15294
15294
|
case "InterfaceTypeAnnotation":
|
|
15295
15295
|
parts.push("interface");
|
|
15296
15296
|
if (n.extends && n.extends.length > 0) {
|
|
15297
|
-
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path3.map(
|
|
15297
|
+
parts.push(" extends ", (0, lines_1.fromString)(", ").join(path3.map(print6, "extends")));
|
|
15298
15298
|
}
|
|
15299
|
-
parts.push(" ", path3.call(
|
|
15299
|
+
parts.push(" ", path3.call(print6, "body"));
|
|
15300
15300
|
return (0, lines_1.concat)(parts);
|
|
15301
15301
|
case "DeclareFunction":
|
|
15302
15302
|
return printFlowDeclaration(path3, [
|
|
15303
15303
|
"function ",
|
|
15304
|
-
path3.call(
|
|
15304
|
+
path3.call(print6, "id"),
|
|
15305
15305
|
";"
|
|
15306
15306
|
]);
|
|
15307
15307
|
case "DeclareModule":
|
|
15308
15308
|
return printFlowDeclaration(path3, [
|
|
15309
15309
|
"module ",
|
|
15310
|
-
path3.call(
|
|
15310
|
+
path3.call(print6, "id"),
|
|
15311
15311
|
" ",
|
|
15312
|
-
path3.call(
|
|
15312
|
+
path3.call(print6, "body")
|
|
15313
15313
|
]);
|
|
15314
15314
|
case "DeclareModuleExports":
|
|
15315
15315
|
return printFlowDeclaration(path3, [
|
|
15316
15316
|
"module.exports",
|
|
15317
|
-
path3.call(
|
|
15317
|
+
path3.call(print6, "typeAnnotation")
|
|
15318
15318
|
]);
|
|
15319
15319
|
case "DeclareVariable":
|
|
15320
|
-
return printFlowDeclaration(path3, ["var ", path3.call(
|
|
15320
|
+
return printFlowDeclaration(path3, ["var ", path3.call(print6, "id"), ";"]);
|
|
15321
15321
|
case "DeclareExportDeclaration":
|
|
15322
15322
|
case "DeclareExportAllDeclaration":
|
|
15323
|
-
return (0, lines_1.concat)(["declare ", printExportDeclaration(path3, options,
|
|
15323
|
+
return (0, lines_1.concat)(["declare ", printExportDeclaration(path3, options, print6)]);
|
|
15324
15324
|
case "EnumDeclaration":
|
|
15325
15325
|
return (0, lines_1.concat)([
|
|
15326
15326
|
"enum ",
|
|
15327
|
-
path3.call(
|
|
15328
|
-
path3.call(
|
|
15327
|
+
path3.call(print6, "id"),
|
|
15328
|
+
path3.call(print6, "body")
|
|
15329
15329
|
]);
|
|
15330
15330
|
case "EnumBooleanBody":
|
|
15331
15331
|
case "EnumNumberBody":
|
|
@@ -15337,24 +15337,24 @@ var require_printer2 = __commonJS({
|
|
|
15337
15337
|
n.type.slice(4, -4).toLowerCase()
|
|
15338
15338
|
);
|
|
15339
15339
|
}
|
|
15340
|
-
parts.push(" {\n", (0, lines_1.fromString)("\n").join(path3.map(
|
|
15340
|
+
parts.push(" {\n", (0, lines_1.fromString)("\n").join(path3.map(print6, "members")).indent(options.tabWidth), "\n}");
|
|
15341
15341
|
return (0, lines_1.concat)(parts);
|
|
15342
15342
|
}
|
|
15343
15343
|
case "EnumDefaultedMember":
|
|
15344
|
-
return (0, lines_1.concat)([path3.call(
|
|
15344
|
+
return (0, lines_1.concat)([path3.call(print6, "id"), ","]);
|
|
15345
15345
|
case "EnumBooleanMember":
|
|
15346
15346
|
case "EnumNumberMember":
|
|
15347
15347
|
case "EnumStringMember":
|
|
15348
15348
|
return (0, lines_1.concat)([
|
|
15349
|
-
path3.call(
|
|
15349
|
+
path3.call(print6, "id"),
|
|
15350
15350
|
" = ",
|
|
15351
|
-
path3.call(
|
|
15351
|
+
path3.call(print6, "init"),
|
|
15352
15352
|
","
|
|
15353
15353
|
]);
|
|
15354
15354
|
case "InferredPredicate":
|
|
15355
15355
|
return (0, lines_1.fromString)("%checks", options);
|
|
15356
15356
|
case "DeclaredPredicate":
|
|
15357
|
-
return (0, lines_1.concat)(["%checks(", path3.call(
|
|
15357
|
+
return (0, lines_1.concat)(["%checks(", path3.call(print6, "value"), ")"]);
|
|
15358
15358
|
case "FunctionTypeAnnotation": {
|
|
15359
15359
|
var parent = path3.getParentNode(0);
|
|
15360
15360
|
var isArrowFunctionTypeAnnotation = !(namedTypes.ObjectTypeCallProperty.check(parent) || namedTypes.ObjectTypeInternalSlot.check(parent) && parent.method || namedTypes.DeclareFunction.check(path3.getParentNode(2)));
|
|
@@ -15364,14 +15364,14 @@ var require_printer2 = __commonJS({
|
|
|
15364
15364
|
}
|
|
15365
15365
|
var hasTypeParameters = !!n.typeParameters;
|
|
15366
15366
|
var needsParens = hasTypeParameters || n.params.length !== 1 || n.params[0].name;
|
|
15367
|
-
parts.push(hasTypeParameters ? path3.call(
|
|
15367
|
+
parts.push(hasTypeParameters ? path3.call(print6, "typeParameters") : "", needsParens ? "(" : "", printFunctionParams(path3, options, print6), needsParens ? ")" : "");
|
|
15368
15368
|
if (n.returnType) {
|
|
15369
|
-
parts.push(isArrowFunctionTypeAnnotation ? " => " : ": ", path3.call(
|
|
15369
|
+
parts.push(isArrowFunctionTypeAnnotation ? " => " : ": ", path3.call(print6, "returnType"));
|
|
15370
15370
|
}
|
|
15371
15371
|
return (0, lines_1.concat)(parts);
|
|
15372
15372
|
}
|
|
15373
15373
|
case "FunctionTypeParam": {
|
|
15374
|
-
var name = path3.call(
|
|
15374
|
+
var name = path3.call(print6, "name");
|
|
15375
15375
|
parts.push(name);
|
|
15376
15376
|
if (n.optional) {
|
|
15377
15377
|
parts.push("?");
|
|
@@ -15379,13 +15379,13 @@ var require_printer2 = __commonJS({
|
|
|
15379
15379
|
if (name.infos[0].line) {
|
|
15380
15380
|
parts.push(": ");
|
|
15381
15381
|
}
|
|
15382
|
-
parts.push(path3.call(
|
|
15382
|
+
parts.push(path3.call(print6, "typeAnnotation"));
|
|
15383
15383
|
return (0, lines_1.concat)(parts);
|
|
15384
15384
|
}
|
|
15385
15385
|
case "GenericTypeAnnotation":
|
|
15386
15386
|
return (0, lines_1.concat)([
|
|
15387
|
-
path3.call(
|
|
15388
|
-
path3.call(
|
|
15387
|
+
path3.call(print6, "id"),
|
|
15388
|
+
path3.call(print6, "typeParameters")
|
|
15389
15389
|
]);
|
|
15390
15390
|
case "DeclareInterface":
|
|
15391
15391
|
parts.push("declare ");
|
|
@@ -15394,24 +15394,24 @@ var require_printer2 = __commonJS({
|
|
|
15394
15394
|
if (n.declare) {
|
|
15395
15395
|
parts.push("declare ");
|
|
15396
15396
|
}
|
|
15397
|
-
parts.push("interface ", path3.call(
|
|
15397
|
+
parts.push("interface ", path3.call(print6, "id"), path3.call(print6, "typeParameters"), " ");
|
|
15398
15398
|
if (n["extends"] && n["extends"].length > 0) {
|
|
15399
|
-
parts.push("extends ", (0, lines_1.fromString)(", ").join(path3.map(
|
|
15399
|
+
parts.push("extends ", (0, lines_1.fromString)(", ").join(path3.map(print6, "extends")), " ");
|
|
15400
15400
|
}
|
|
15401
15401
|
if (n.body) {
|
|
15402
|
-
parts.push(path3.call(
|
|
15402
|
+
parts.push(path3.call(print6, "body"));
|
|
15403
15403
|
}
|
|
15404
15404
|
return (0, lines_1.concat)(parts);
|
|
15405
15405
|
case "ClassImplements":
|
|
15406
15406
|
case "InterfaceExtends":
|
|
15407
15407
|
return (0, lines_1.concat)([
|
|
15408
|
-
path3.call(
|
|
15409
|
-
path3.call(
|
|
15408
|
+
path3.call(print6, "id"),
|
|
15409
|
+
path3.call(print6, "typeParameters")
|
|
15410
15410
|
]);
|
|
15411
15411
|
case "IntersectionTypeAnnotation":
|
|
15412
|
-
return (0, lines_1.fromString)(" & ").join(path3.map(
|
|
15412
|
+
return (0, lines_1.fromString)(" & ").join(path3.map(print6, "types"));
|
|
15413
15413
|
case "NullableTypeAnnotation":
|
|
15414
|
-
return (0, lines_1.concat)(["?", path3.call(
|
|
15414
|
+
return (0, lines_1.concat)(["?", path3.call(print6, "typeAnnotation")]);
|
|
15415
15415
|
case "NullLiteralTypeAnnotation":
|
|
15416
15416
|
return (0, lines_1.fromString)("null", options);
|
|
15417
15417
|
case "ThisTypeAnnotation":
|
|
@@ -15419,40 +15419,40 @@ var require_printer2 = __commonJS({
|
|
|
15419
15419
|
case "NumberTypeAnnotation":
|
|
15420
15420
|
return (0, lines_1.fromString)("number", options);
|
|
15421
15421
|
case "ObjectTypeCallProperty":
|
|
15422
|
-
return path3.call(
|
|
15422
|
+
return path3.call(print6, "value");
|
|
15423
15423
|
case "ObjectTypeIndexer":
|
|
15424
15424
|
if (n.static) {
|
|
15425
15425
|
parts.push("static ");
|
|
15426
15426
|
}
|
|
15427
|
-
parts.push(printVariance(path3,
|
|
15427
|
+
parts.push(printVariance(path3, print6), "[");
|
|
15428
15428
|
if (n.id) {
|
|
15429
|
-
parts.push(path3.call(
|
|
15429
|
+
parts.push(path3.call(print6, "id"), ": ");
|
|
15430
15430
|
}
|
|
15431
|
-
parts.push(path3.call(
|
|
15431
|
+
parts.push(path3.call(print6, "key"), "]: ", path3.call(print6, "value"));
|
|
15432
15432
|
return (0, lines_1.concat)(parts);
|
|
15433
15433
|
case "ObjectTypeProperty":
|
|
15434
15434
|
return (0, lines_1.concat)([
|
|
15435
|
-
printVariance(path3,
|
|
15436
|
-
path3.call(
|
|
15435
|
+
printVariance(path3, print6),
|
|
15436
|
+
path3.call(print6, "key"),
|
|
15437
15437
|
n.optional ? "?" : "",
|
|
15438
15438
|
": ",
|
|
15439
|
-
path3.call(
|
|
15439
|
+
path3.call(print6, "value")
|
|
15440
15440
|
]);
|
|
15441
15441
|
case "ObjectTypeInternalSlot":
|
|
15442
15442
|
return (0, lines_1.concat)([
|
|
15443
15443
|
n.static ? "static " : "",
|
|
15444
15444
|
"[[",
|
|
15445
|
-
path3.call(
|
|
15445
|
+
path3.call(print6, "id"),
|
|
15446
15446
|
"]]",
|
|
15447
15447
|
n.optional ? "?" : "",
|
|
15448
15448
|
n.value.type !== "FunctionTypeAnnotation" ? ": " : "",
|
|
15449
|
-
path3.call(
|
|
15449
|
+
path3.call(print6, "value")
|
|
15450
15450
|
]);
|
|
15451
15451
|
case "QualifiedTypeIdentifier":
|
|
15452
15452
|
return (0, lines_1.concat)([
|
|
15453
|
-
path3.call(
|
|
15453
|
+
path3.call(print6, "qualification"),
|
|
15454
15454
|
".",
|
|
15455
|
-
path3.call(
|
|
15455
|
+
path3.call(print6, "id")
|
|
15456
15456
|
]);
|
|
15457
15457
|
case "StringLiteralTypeAnnotation":
|
|
15458
15458
|
return (0, lines_1.fromString)(nodeStr(n.value, options), options);
|
|
@@ -15469,36 +15469,36 @@ var require_printer2 = __commonJS({
|
|
|
15469
15469
|
case "TypeAlias":
|
|
15470
15470
|
return (0, lines_1.concat)([
|
|
15471
15471
|
"type ",
|
|
15472
|
-
path3.call(
|
|
15473
|
-
path3.call(
|
|
15472
|
+
path3.call(print6, "id"),
|
|
15473
|
+
path3.call(print6, "typeParameters"),
|
|
15474
15474
|
" = ",
|
|
15475
|
-
path3.call(
|
|
15475
|
+
path3.call(print6, "right"),
|
|
15476
15476
|
";"
|
|
15477
15477
|
]);
|
|
15478
15478
|
case "DeclareOpaqueType":
|
|
15479
15479
|
parts.push("declare ");
|
|
15480
15480
|
case "OpaqueType":
|
|
15481
|
-
parts.push("opaque type ", path3.call(
|
|
15481
|
+
parts.push("opaque type ", path3.call(print6, "id"), path3.call(print6, "typeParameters"));
|
|
15482
15482
|
if (n["supertype"]) {
|
|
15483
|
-
parts.push(": ", path3.call(
|
|
15483
|
+
parts.push(": ", path3.call(print6, "supertype"));
|
|
15484
15484
|
}
|
|
15485
15485
|
if (n["impltype"]) {
|
|
15486
|
-
parts.push(" = ", path3.call(
|
|
15486
|
+
parts.push(" = ", path3.call(print6, "impltype"));
|
|
15487
15487
|
}
|
|
15488
15488
|
parts.push(";");
|
|
15489
15489
|
return (0, lines_1.concat)(parts);
|
|
15490
15490
|
case "TypeCastExpression":
|
|
15491
15491
|
return (0, lines_1.concat)([
|
|
15492
15492
|
"(",
|
|
15493
|
-
path3.call(
|
|
15494
|
-
path3.call(
|
|
15493
|
+
path3.call(print6, "expression"),
|
|
15494
|
+
path3.call(print6, "typeAnnotation"),
|
|
15495
15495
|
")"
|
|
15496
15496
|
]);
|
|
15497
15497
|
case "TypeParameterDeclaration":
|
|
15498
15498
|
case "TypeParameterInstantiation":
|
|
15499
15499
|
return (0, lines_1.concat)([
|
|
15500
15500
|
"<",
|
|
15501
|
-
(0, lines_1.fromString)(", ").join(path3.map(
|
|
15501
|
+
(0, lines_1.fromString)(", ").join(path3.map(print6, "params")),
|
|
15502
15502
|
">"
|
|
15503
15503
|
]);
|
|
15504
15504
|
case "Variance":
|
|
@@ -15511,32 +15511,32 @@ var require_printer2 = __commonJS({
|
|
|
15511
15511
|
return (0, lines_1.fromString)("");
|
|
15512
15512
|
case "TypeParameter":
|
|
15513
15513
|
if (n.variance) {
|
|
15514
|
-
parts.push(printVariance(path3,
|
|
15514
|
+
parts.push(printVariance(path3, print6));
|
|
15515
15515
|
}
|
|
15516
|
-
parts.push(path3.call(
|
|
15516
|
+
parts.push(path3.call(print6, "name"));
|
|
15517
15517
|
if (n.bound) {
|
|
15518
|
-
parts.push(path3.call(
|
|
15518
|
+
parts.push(path3.call(print6, "bound"));
|
|
15519
15519
|
}
|
|
15520
15520
|
if (n["default"]) {
|
|
15521
|
-
parts.push("=", path3.call(
|
|
15521
|
+
parts.push("=", path3.call(print6, "default"));
|
|
15522
15522
|
}
|
|
15523
15523
|
return (0, lines_1.concat)(parts);
|
|
15524
15524
|
case "TypeofTypeAnnotation":
|
|
15525
15525
|
return (0, lines_1.concat)([
|
|
15526
15526
|
(0, lines_1.fromString)("typeof ", options),
|
|
15527
|
-
path3.call(
|
|
15527
|
+
path3.call(print6, "argument")
|
|
15528
15528
|
]);
|
|
15529
15529
|
case "IndexedAccessType":
|
|
15530
15530
|
case "OptionalIndexedAccessType":
|
|
15531
15531
|
return (0, lines_1.concat)([
|
|
15532
|
-
path3.call(
|
|
15532
|
+
path3.call(print6, "objectType"),
|
|
15533
15533
|
n.optional ? "?." : "",
|
|
15534
15534
|
"[",
|
|
15535
|
-
path3.call(
|
|
15535
|
+
path3.call(print6, "indexType"),
|
|
15536
15536
|
"]"
|
|
15537
15537
|
]);
|
|
15538
15538
|
case "UnionTypeAnnotation":
|
|
15539
|
-
return (0, lines_1.fromString)(" | ").join(path3.map(
|
|
15539
|
+
return (0, lines_1.fromString)(" | ").join(path3.map(print6, "types"));
|
|
15540
15540
|
case "VoidTypeAnnotation":
|
|
15541
15541
|
return (0, lines_1.fromString)("void", options);
|
|
15542
15542
|
case "NullTypeAnnotation":
|
|
@@ -15576,77 +15576,77 @@ var require_printer2 = __commonJS({
|
|
|
15576
15576
|
case "TSNeverKeyword":
|
|
15577
15577
|
return (0, lines_1.fromString)("never", options);
|
|
15578
15578
|
case "TSArrayType":
|
|
15579
|
-
return (0, lines_1.concat)([path3.call(
|
|
15579
|
+
return (0, lines_1.concat)([path3.call(print6, "elementType"), "[]"]);
|
|
15580
15580
|
case "TSLiteralType":
|
|
15581
|
-
return path3.call(
|
|
15581
|
+
return path3.call(print6, "literal");
|
|
15582
15582
|
case "TSUnionType":
|
|
15583
|
-
return (0, lines_1.fromString)(" | ").join(path3.map(
|
|
15583
|
+
return (0, lines_1.fromString)(" | ").join(path3.map(print6, "types"));
|
|
15584
15584
|
case "TSIntersectionType":
|
|
15585
|
-
return (0, lines_1.fromString)(" & ").join(path3.map(
|
|
15585
|
+
return (0, lines_1.fromString)(" & ").join(path3.map(print6, "types"));
|
|
15586
15586
|
case "TSConditionalType":
|
|
15587
|
-
parts.push(path3.call(
|
|
15587
|
+
parts.push(path3.call(print6, "checkType"), " extends ", path3.call(print6, "extendsType"), " ? ", path3.call(print6, "trueType"), " : ", path3.call(print6, "falseType"));
|
|
15588
15588
|
return (0, lines_1.concat)(parts);
|
|
15589
15589
|
case "TSInferType":
|
|
15590
|
-
parts.push("infer ", path3.call(
|
|
15590
|
+
parts.push("infer ", path3.call(print6, "typeParameter"));
|
|
15591
15591
|
return (0, lines_1.concat)(parts);
|
|
15592
15592
|
case "TSParenthesizedType":
|
|
15593
|
-
return (0, lines_1.concat)(["(", path3.call(
|
|
15593
|
+
return (0, lines_1.concat)(["(", path3.call(print6, "typeAnnotation"), ")"]);
|
|
15594
15594
|
case "TSFunctionType":
|
|
15595
15595
|
return (0, lines_1.concat)([
|
|
15596
|
-
path3.call(
|
|
15596
|
+
path3.call(print6, "typeParameters"),
|
|
15597
15597
|
"(",
|
|
15598
|
-
printFunctionParams(path3, options,
|
|
15598
|
+
printFunctionParams(path3, options, print6),
|
|
15599
15599
|
") => ",
|
|
15600
|
-
path3.call(
|
|
15600
|
+
path3.call(print6, "typeAnnotation", "typeAnnotation")
|
|
15601
15601
|
]);
|
|
15602
15602
|
case "TSConstructorType":
|
|
15603
15603
|
return (0, lines_1.concat)([
|
|
15604
15604
|
"new ",
|
|
15605
|
-
path3.call(
|
|
15605
|
+
path3.call(print6, "typeParameters"),
|
|
15606
15606
|
"(",
|
|
15607
|
-
printFunctionParams(path3, options,
|
|
15607
|
+
printFunctionParams(path3, options, print6),
|
|
15608
15608
|
") => ",
|
|
15609
|
-
path3.call(
|
|
15609
|
+
path3.call(print6, "typeAnnotation", "typeAnnotation")
|
|
15610
15610
|
]);
|
|
15611
15611
|
case "TSMappedType": {
|
|
15612
|
-
parts.push(n.readonly ? "readonly " : "", "[", path3.call(
|
|
15612
|
+
parts.push(n.readonly ? "readonly " : "", "[", path3.call(print6, "typeParameter"), "]", n.optional ? "?" : "");
|
|
15613
15613
|
if (n.typeAnnotation) {
|
|
15614
|
-
parts.push(": ", path3.call(
|
|
15614
|
+
parts.push(": ", path3.call(print6, "typeAnnotation"), ";");
|
|
15615
15615
|
}
|
|
15616
15616
|
return (0, lines_1.concat)(["{\n", (0, lines_1.concat)(parts).indent(options.tabWidth), "\n}"]);
|
|
15617
15617
|
}
|
|
15618
15618
|
case "TSTupleType":
|
|
15619
15619
|
return (0, lines_1.concat)([
|
|
15620
15620
|
"[",
|
|
15621
|
-
(0, lines_1.fromString)(", ").join(path3.map(
|
|
15621
|
+
(0, lines_1.fromString)(", ").join(path3.map(print6, "elementTypes")),
|
|
15622
15622
|
"]"
|
|
15623
15623
|
]);
|
|
15624
15624
|
case "TSNamedTupleMember":
|
|
15625
|
-
parts.push(path3.call(
|
|
15625
|
+
parts.push(path3.call(print6, "label"));
|
|
15626
15626
|
if (n.optional) {
|
|
15627
15627
|
parts.push("?");
|
|
15628
15628
|
}
|
|
15629
|
-
parts.push(": ", path3.call(
|
|
15629
|
+
parts.push(": ", path3.call(print6, "elementType"));
|
|
15630
15630
|
return (0, lines_1.concat)(parts);
|
|
15631
15631
|
case "TSRestType":
|
|
15632
|
-
return (0, lines_1.concat)(["...", path3.call(
|
|
15632
|
+
return (0, lines_1.concat)(["...", path3.call(print6, "typeAnnotation")]);
|
|
15633
15633
|
case "TSOptionalType":
|
|
15634
|
-
return (0, lines_1.concat)([path3.call(
|
|
15634
|
+
return (0, lines_1.concat)([path3.call(print6, "typeAnnotation"), "?"]);
|
|
15635
15635
|
case "TSIndexedAccessType":
|
|
15636
15636
|
return (0, lines_1.concat)([
|
|
15637
|
-
path3.call(
|
|
15637
|
+
path3.call(print6, "objectType"),
|
|
15638
15638
|
"[",
|
|
15639
|
-
path3.call(
|
|
15639
|
+
path3.call(print6, "indexType"),
|
|
15640
15640
|
"]"
|
|
15641
15641
|
]);
|
|
15642
15642
|
case "TSTypeOperator":
|
|
15643
15643
|
return (0, lines_1.concat)([
|
|
15644
|
-
path3.call(
|
|
15644
|
+
path3.call(print6, "operator"),
|
|
15645
15645
|
" ",
|
|
15646
|
-
path3.call(
|
|
15646
|
+
path3.call(print6, "typeAnnotation")
|
|
15647
15647
|
]);
|
|
15648
15648
|
case "TSTypeLiteral": {
|
|
15649
|
-
var members = (0, lines_1.fromString)("\n").join(path3.map(
|
|
15649
|
+
var members = (0, lines_1.fromString)("\n").join(path3.map(print6, "members").map(function(member) {
|
|
15650
15650
|
if (lastNonSpaceCharacter(member) !== ";") {
|
|
15651
15651
|
return member.concat(";");
|
|
15652
15652
|
}
|
|
@@ -15659,13 +15659,13 @@ var require_printer2 = __commonJS({
|
|
|
15659
15659
|
return (0, lines_1.concat)(parts);
|
|
15660
15660
|
}
|
|
15661
15661
|
case "TSEnumMember":
|
|
15662
|
-
parts.push(path3.call(
|
|
15662
|
+
parts.push(path3.call(print6, "id"));
|
|
15663
15663
|
if (n.initializer) {
|
|
15664
|
-
parts.push(" = ", path3.call(
|
|
15664
|
+
parts.push(" = ", path3.call(print6, "initializer"));
|
|
15665
15665
|
}
|
|
15666
15666
|
return (0, lines_1.concat)(parts);
|
|
15667
15667
|
case "TSTypeQuery":
|
|
15668
|
-
return (0, lines_1.concat)(["typeof ", path3.call(
|
|
15668
|
+
return (0, lines_1.concat)(["typeof ", path3.call(print6, "exprName")]);
|
|
15669
15669
|
case "TSParameterProperty":
|
|
15670
15670
|
if (n.accessibility) {
|
|
15671
15671
|
parts.push(n.accessibility, " ");
|
|
@@ -15679,119 +15679,119 @@ var require_printer2 = __commonJS({
|
|
|
15679
15679
|
if (n.readonly) {
|
|
15680
15680
|
parts.push("readonly ");
|
|
15681
15681
|
}
|
|
15682
|
-
parts.push(path3.call(
|
|
15682
|
+
parts.push(path3.call(print6, "parameter"));
|
|
15683
15683
|
return (0, lines_1.concat)(parts);
|
|
15684
15684
|
case "TSTypeReference":
|
|
15685
15685
|
return (0, lines_1.concat)([
|
|
15686
|
-
path3.call(
|
|
15687
|
-
path3.call(
|
|
15686
|
+
path3.call(print6, "typeName"),
|
|
15687
|
+
path3.call(print6, "typeParameters")
|
|
15688
15688
|
]);
|
|
15689
15689
|
case "TSQualifiedName":
|
|
15690
|
-
return (0, lines_1.concat)([path3.call(
|
|
15690
|
+
return (0, lines_1.concat)([path3.call(print6, "left"), ".", path3.call(print6, "right")]);
|
|
15691
15691
|
case "TSAsExpression":
|
|
15692
15692
|
case "TSSatisfiesExpression": {
|
|
15693
|
-
var expression = path3.call(
|
|
15694
|
-
parts.push(expression, n.type === "TSSatisfiesExpression" ? " satisfies " : " as ", path3.call(
|
|
15693
|
+
var expression = path3.call(print6, "expression");
|
|
15694
|
+
parts.push(expression, n.type === "TSSatisfiesExpression" ? " satisfies " : " as ", path3.call(print6, "typeAnnotation"));
|
|
15695
15695
|
return (0, lines_1.concat)(parts);
|
|
15696
15696
|
}
|
|
15697
15697
|
case "TSTypeCastExpression":
|
|
15698
15698
|
return (0, lines_1.concat)([
|
|
15699
|
-
path3.call(
|
|
15700
|
-
path3.call(
|
|
15699
|
+
path3.call(print6, "expression"),
|
|
15700
|
+
path3.call(print6, "typeAnnotation")
|
|
15701
15701
|
]);
|
|
15702
15702
|
case "TSNonNullExpression":
|
|
15703
|
-
return (0, lines_1.concat)([path3.call(
|
|
15703
|
+
return (0, lines_1.concat)([path3.call(print6, "expression"), "!"]);
|
|
15704
15704
|
case "TSTypeAnnotation":
|
|
15705
|
-
return (0, lines_1.concat)([": ", path3.call(
|
|
15705
|
+
return (0, lines_1.concat)([": ", path3.call(print6, "typeAnnotation")]);
|
|
15706
15706
|
case "TSIndexSignature":
|
|
15707
15707
|
return (0, lines_1.concat)([
|
|
15708
15708
|
n.readonly ? "readonly " : "",
|
|
15709
15709
|
"[",
|
|
15710
|
-
path3.map(
|
|
15710
|
+
path3.map(print6, "parameters"),
|
|
15711
15711
|
"]",
|
|
15712
|
-
path3.call(
|
|
15712
|
+
path3.call(print6, "typeAnnotation")
|
|
15713
15713
|
]);
|
|
15714
15714
|
case "TSPropertySignature":
|
|
15715
|
-
parts.push(printVariance(path3,
|
|
15715
|
+
parts.push(printVariance(path3, print6), n.readonly ? "readonly " : "");
|
|
15716
15716
|
if (n.computed) {
|
|
15717
|
-
parts.push("[", path3.call(
|
|
15717
|
+
parts.push("[", path3.call(print6, "key"), "]");
|
|
15718
15718
|
} else {
|
|
15719
|
-
parts.push(path3.call(
|
|
15719
|
+
parts.push(path3.call(print6, "key"));
|
|
15720
15720
|
}
|
|
15721
|
-
parts.push(n.optional ? "?" : "", path3.call(
|
|
15721
|
+
parts.push(n.optional ? "?" : "", path3.call(print6, "typeAnnotation"));
|
|
15722
15722
|
return (0, lines_1.concat)(parts);
|
|
15723
15723
|
case "TSMethodSignature":
|
|
15724
15724
|
if (n.computed) {
|
|
15725
|
-
parts.push("[", path3.call(
|
|
15725
|
+
parts.push("[", path3.call(print6, "key"), "]");
|
|
15726
15726
|
} else {
|
|
15727
|
-
parts.push(path3.call(
|
|
15727
|
+
parts.push(path3.call(print6, "key"));
|
|
15728
15728
|
}
|
|
15729
15729
|
if (n.optional) {
|
|
15730
15730
|
parts.push("?");
|
|
15731
15731
|
}
|
|
15732
|
-
parts.push(path3.call(
|
|
15732
|
+
parts.push(path3.call(print6, "typeParameters"), "(", printFunctionParams(path3, options, print6), ")", path3.call(print6, "typeAnnotation"));
|
|
15733
15733
|
return (0, lines_1.concat)(parts);
|
|
15734
15734
|
case "TSTypePredicate":
|
|
15735
15735
|
if (n.asserts) {
|
|
15736
15736
|
parts.push("asserts ");
|
|
15737
15737
|
}
|
|
15738
|
-
parts.push(path3.call(
|
|
15738
|
+
parts.push(path3.call(print6, "parameterName"));
|
|
15739
15739
|
if (n.typeAnnotation) {
|
|
15740
|
-
parts.push(" is ", path3.call(
|
|
15740
|
+
parts.push(" is ", path3.call(print6, "typeAnnotation", "typeAnnotation"));
|
|
15741
15741
|
}
|
|
15742
15742
|
return (0, lines_1.concat)(parts);
|
|
15743
15743
|
case "TSCallSignatureDeclaration":
|
|
15744
15744
|
return (0, lines_1.concat)([
|
|
15745
|
-
path3.call(
|
|
15745
|
+
path3.call(print6, "typeParameters"),
|
|
15746
15746
|
"(",
|
|
15747
|
-
printFunctionParams(path3, options,
|
|
15747
|
+
printFunctionParams(path3, options, print6),
|
|
15748
15748
|
")",
|
|
15749
|
-
path3.call(
|
|
15749
|
+
path3.call(print6, "typeAnnotation")
|
|
15750
15750
|
]);
|
|
15751
15751
|
case "TSConstructSignatureDeclaration":
|
|
15752
15752
|
if (n.typeParameters) {
|
|
15753
|
-
parts.push("new", path3.call(
|
|
15753
|
+
parts.push("new", path3.call(print6, "typeParameters"));
|
|
15754
15754
|
} else {
|
|
15755
15755
|
parts.push("new ");
|
|
15756
15756
|
}
|
|
15757
|
-
parts.push("(", printFunctionParams(path3, options,
|
|
15757
|
+
parts.push("(", printFunctionParams(path3, options, print6), ")", path3.call(print6, "typeAnnotation"));
|
|
15758
15758
|
return (0, lines_1.concat)(parts);
|
|
15759
15759
|
case "TSTypeAliasDeclaration":
|
|
15760
15760
|
return (0, lines_1.concat)([
|
|
15761
15761
|
n.declare ? "declare " : "",
|
|
15762
15762
|
"type ",
|
|
15763
|
-
path3.call(
|
|
15764
|
-
path3.call(
|
|
15763
|
+
path3.call(print6, "id"),
|
|
15764
|
+
path3.call(print6, "typeParameters"),
|
|
15765
15765
|
" = ",
|
|
15766
|
-
path3.call(
|
|
15766
|
+
path3.call(print6, "typeAnnotation"),
|
|
15767
15767
|
";"
|
|
15768
15768
|
]);
|
|
15769
15769
|
case "TSTypeParameter": {
|
|
15770
|
-
parts.push(path3.call(
|
|
15770
|
+
parts.push(path3.call(print6, "name"));
|
|
15771
15771
|
var parent = path3.getParentNode(0);
|
|
15772
15772
|
var isInMappedType = namedTypes.TSMappedType.check(parent);
|
|
15773
15773
|
if (n.constraint) {
|
|
15774
|
-
parts.push(isInMappedType ? " in " : " extends ", path3.call(
|
|
15774
|
+
parts.push(isInMappedType ? " in " : " extends ", path3.call(print6, "constraint"));
|
|
15775
15775
|
}
|
|
15776
15776
|
if (n["default"]) {
|
|
15777
|
-
parts.push(" = ", path3.call(
|
|
15777
|
+
parts.push(" = ", path3.call(print6, "default"));
|
|
15778
15778
|
}
|
|
15779
15779
|
return (0, lines_1.concat)(parts);
|
|
15780
15780
|
}
|
|
15781
15781
|
case "TSTypeAssertion": {
|
|
15782
|
-
parts.push("<", path3.call(
|
|
15782
|
+
parts.push("<", path3.call(print6, "typeAnnotation"), "> ", path3.call(print6, "expression"));
|
|
15783
15783
|
return (0, lines_1.concat)(parts);
|
|
15784
15784
|
}
|
|
15785
15785
|
case "TSTypeParameterDeclaration":
|
|
15786
15786
|
case "TSTypeParameterInstantiation":
|
|
15787
15787
|
return (0, lines_1.concat)([
|
|
15788
15788
|
"<",
|
|
15789
|
-
(0, lines_1.fromString)(", ").join(path3.map(
|
|
15789
|
+
(0, lines_1.fromString)(", ").join(path3.map(print6, "params")),
|
|
15790
15790
|
">"
|
|
15791
15791
|
]);
|
|
15792
15792
|
case "TSEnumDeclaration": {
|
|
15793
|
-
parts.push(n.declare ? "declare " : "", n.const ? "const " : "", "enum ", path3.call(
|
|
15794
|
-
var memberLines = (0, lines_1.fromString)(",\n").join(path3.map(
|
|
15793
|
+
parts.push(n.declare ? "declare " : "", n.const ? "const " : "", "enum ", path3.call(print6, "id"));
|
|
15794
|
+
var memberLines = (0, lines_1.fromString)(",\n").join(path3.map(print6, "members"));
|
|
15795
15795
|
if (memberLines.isEmpty()) {
|
|
15796
15796
|
parts.push(" {}");
|
|
15797
15797
|
} else {
|
|
@@ -15801,11 +15801,11 @@ var require_printer2 = __commonJS({
|
|
|
15801
15801
|
}
|
|
15802
15802
|
case "TSExpressionWithTypeArguments":
|
|
15803
15803
|
return (0, lines_1.concat)([
|
|
15804
|
-
path3.call(
|
|
15805
|
-
path3.call(
|
|
15804
|
+
path3.call(print6, "expression"),
|
|
15805
|
+
path3.call(print6, "typeParameters")
|
|
15806
15806
|
]);
|
|
15807
15807
|
case "TSInterfaceBody": {
|
|
15808
|
-
var lines = (0, lines_1.fromString)("\n").join(path3.map(
|
|
15808
|
+
var lines = (0, lines_1.fromString)("\n").join(path3.map(print6, "body").map(function(element) {
|
|
15809
15809
|
if (lastNonSpaceCharacter(element) !== ";") {
|
|
15810
15810
|
return element.concat(";");
|
|
15811
15811
|
}
|
|
@@ -15817,22 +15817,22 @@ var require_printer2 = __commonJS({
|
|
|
15817
15817
|
return (0, lines_1.concat)(["{\n", lines.indent(options.tabWidth), "\n}"]);
|
|
15818
15818
|
}
|
|
15819
15819
|
case "TSImportType":
|
|
15820
|
-
parts.push("import(", path3.call(
|
|
15820
|
+
parts.push("import(", path3.call(print6, "argument"), ")");
|
|
15821
15821
|
if (n.qualifier) {
|
|
15822
|
-
parts.push(".", path3.call(
|
|
15822
|
+
parts.push(".", path3.call(print6, "qualifier"));
|
|
15823
15823
|
}
|
|
15824
15824
|
if (n.typeParameters) {
|
|
15825
|
-
parts.push(path3.call(
|
|
15825
|
+
parts.push(path3.call(print6, "typeParameters"));
|
|
15826
15826
|
}
|
|
15827
15827
|
return (0, lines_1.concat)(parts);
|
|
15828
15828
|
case "TSImportEqualsDeclaration":
|
|
15829
15829
|
if (n.isExport) {
|
|
15830
15830
|
parts.push("export ");
|
|
15831
15831
|
}
|
|
15832
|
-
parts.push("import ", path3.call(
|
|
15832
|
+
parts.push("import ", path3.call(print6, "id"), " = ", path3.call(print6, "moduleReference"));
|
|
15833
15833
|
return maybeAddSemicolon((0, lines_1.concat)(parts));
|
|
15834
15834
|
case "TSExternalModuleReference":
|
|
15835
|
-
return (0, lines_1.concat)(["require(", path3.call(
|
|
15835
|
+
return (0, lines_1.concat)(["require(", path3.call(print6, "expression"), ")"]);
|
|
15836
15836
|
case "TSModuleDeclaration": {
|
|
15837
15837
|
var parent = path3.getParentNode();
|
|
15838
15838
|
if (parent.type === "TSModuleDeclaration") {
|
|
@@ -15857,16 +15857,16 @@ var require_printer2 = __commonJS({
|
|
|
15857
15857
|
}
|
|
15858
15858
|
}
|
|
15859
15859
|
}
|
|
15860
|
-
parts.push(path3.call(
|
|
15860
|
+
parts.push(path3.call(print6, "id"));
|
|
15861
15861
|
if (n.body) {
|
|
15862
15862
|
parts.push(" ");
|
|
15863
|
-
parts.push(path3.call(
|
|
15863
|
+
parts.push(path3.call(print6, "body"));
|
|
15864
15864
|
}
|
|
15865
15865
|
return (0, lines_1.concat)(parts);
|
|
15866
15866
|
}
|
|
15867
15867
|
case "TSModuleBlock": {
|
|
15868
15868
|
var naked = path3.call(function(bodyPath) {
|
|
15869
|
-
return printStatementSequence(bodyPath, options,
|
|
15869
|
+
return printStatementSequence(bodyPath, options, print6);
|
|
15870
15870
|
}, "body");
|
|
15871
15871
|
if (naked.isEmpty()) {
|
|
15872
15872
|
parts.push("{}");
|
|
@@ -15876,11 +15876,11 @@ var require_printer2 = __commonJS({
|
|
|
15876
15876
|
return (0, lines_1.concat)(parts);
|
|
15877
15877
|
}
|
|
15878
15878
|
case "TSInstantiationExpression": {
|
|
15879
|
-
parts.push(path3.call(
|
|
15879
|
+
parts.push(path3.call(print6, "expression"), path3.call(print6, "typeParameters"));
|
|
15880
15880
|
return (0, lines_1.concat)(parts);
|
|
15881
15881
|
}
|
|
15882
15882
|
case "V8IntrinsicIdentifier":
|
|
15883
|
-
return (0, lines_1.concat)(["%", path3.call(
|
|
15883
|
+
return (0, lines_1.concat)(["%", path3.call(print6, "name")]);
|
|
15884
15884
|
case "TopicReference":
|
|
15885
15885
|
return (0, lines_1.fromString)("#");
|
|
15886
15886
|
case "ClassHeritage":
|
|
@@ -15930,7 +15930,7 @@ var require_printer2 = __commonJS({
|
|
|
15930
15930
|
}
|
|
15931
15931
|
return (0, lines_1.concat)(parts);
|
|
15932
15932
|
}
|
|
15933
|
-
function printStatementSequence(path3, options,
|
|
15933
|
+
function printStatementSequence(path3, options, print6) {
|
|
15934
15934
|
var filtered = [];
|
|
15935
15935
|
var sawComment = false;
|
|
15936
15936
|
var sawStatement = false;
|
|
@@ -15951,7 +15951,7 @@ var require_printer2 = __commonJS({
|
|
|
15951
15951
|
}
|
|
15952
15952
|
filtered.push({
|
|
15953
15953
|
node: stmt,
|
|
15954
|
-
printed:
|
|
15954
|
+
printed: print6(stmtPath)
|
|
15955
15955
|
});
|
|
15956
15956
|
});
|
|
15957
15957
|
if (sawComment) {
|
|
@@ -16043,7 +16043,7 @@ var require_printer2 = __commonJS({
|
|
|
16043
16043
|
}
|
|
16044
16044
|
return parts;
|
|
16045
16045
|
}
|
|
16046
|
-
function printMethod(path3, options,
|
|
16046
|
+
function printMethod(path3, options, print6) {
|
|
16047
16047
|
var node = path3.getNode();
|
|
16048
16048
|
var kind = node.kind;
|
|
16049
16049
|
var parts = [];
|
|
@@ -16061,7 +16061,7 @@ var require_printer2 = __commonJS({
|
|
|
16061
16061
|
if (kind === "get" || kind === "set") {
|
|
16062
16062
|
parts.push(kind, " ");
|
|
16063
16063
|
}
|
|
16064
|
-
var key = path3.call(
|
|
16064
|
+
var key = path3.call(print6, "key");
|
|
16065
16065
|
if (node.computed) {
|
|
16066
16066
|
key = (0, lines_1.concat)(["[", key, "]"]);
|
|
16067
16067
|
}
|
|
@@ -16070,26 +16070,26 @@ var require_printer2 = __commonJS({
|
|
|
16070
16070
|
parts.push("?");
|
|
16071
16071
|
}
|
|
16072
16072
|
if (node === nodeValue) {
|
|
16073
|
-
parts.push(path3.call(
|
|
16073
|
+
parts.push(path3.call(print6, "typeParameters"), "(", printFunctionParams(path3, options, print6), ")", path3.call(print6, "returnType"));
|
|
16074
16074
|
if (node.body) {
|
|
16075
|
-
parts.push(" ", path3.call(
|
|
16075
|
+
parts.push(" ", path3.call(print6, "body"));
|
|
16076
16076
|
} else {
|
|
16077
16077
|
parts.push(";");
|
|
16078
16078
|
}
|
|
16079
16079
|
} else {
|
|
16080
|
-
parts.push(path3.call(
|
|
16081
|
-
return printFunctionParams(valuePath, options,
|
|
16082
|
-
}, "value"), ")", path3.call(
|
|
16080
|
+
parts.push(path3.call(print6, "value", "typeParameters"), "(", path3.call(function(valuePath) {
|
|
16081
|
+
return printFunctionParams(valuePath, options, print6);
|
|
16082
|
+
}, "value"), ")", path3.call(print6, "value", "returnType"));
|
|
16083
16083
|
if (nodeValue.body) {
|
|
16084
|
-
parts.push(" ", path3.call(
|
|
16084
|
+
parts.push(" ", path3.call(print6, "value", "body"));
|
|
16085
16085
|
} else {
|
|
16086
16086
|
parts.push(";");
|
|
16087
16087
|
}
|
|
16088
16088
|
}
|
|
16089
16089
|
return (0, lines_1.concat)(parts);
|
|
16090
16090
|
}
|
|
16091
|
-
function printArgumentsList(path3, options,
|
|
16092
|
-
var printed = path3.map(
|
|
16091
|
+
function printArgumentsList(path3, options, print6) {
|
|
16092
|
+
var printed = path3.map(print6, "arguments");
|
|
16093
16093
|
var trailingComma = util.isTrailingCommaEnabled(options, "parameters");
|
|
16094
16094
|
var joined = (0, lines_1.fromString)(", ").join(printed);
|
|
16095
16095
|
if (joined.getLineLength(1) > options.wrapColumn) {
|
|
@@ -16102,28 +16102,28 @@ var require_printer2 = __commonJS({
|
|
|
16102
16102
|
}
|
|
16103
16103
|
return (0, lines_1.concat)(["(", joined, ")"]);
|
|
16104
16104
|
}
|
|
16105
|
-
function printFunctionParams(path3, options,
|
|
16105
|
+
function printFunctionParams(path3, options, print6) {
|
|
16106
16106
|
var fun = path3.getValue();
|
|
16107
16107
|
var params;
|
|
16108
16108
|
var printed = [];
|
|
16109
16109
|
if (fun.params) {
|
|
16110
16110
|
params = fun.params;
|
|
16111
|
-
printed = path3.map(
|
|
16111
|
+
printed = path3.map(print6, "params");
|
|
16112
16112
|
} else if (fun.parameters) {
|
|
16113
16113
|
params = fun.parameters;
|
|
16114
|
-
printed = path3.map(
|
|
16114
|
+
printed = path3.map(print6, "parameters");
|
|
16115
16115
|
}
|
|
16116
16116
|
if (fun.defaults) {
|
|
16117
16117
|
path3.each(function(defExprPath) {
|
|
16118
16118
|
var i2 = defExprPath.getName();
|
|
16119
16119
|
var p = printed[i2];
|
|
16120
16120
|
if (p && defExprPath.getValue()) {
|
|
16121
|
-
printed[i2] = (0, lines_1.concat)([p, " = ",
|
|
16121
|
+
printed[i2] = (0, lines_1.concat)([p, " = ", print6(defExprPath)]);
|
|
16122
16122
|
}
|
|
16123
16123
|
}, "defaults");
|
|
16124
16124
|
}
|
|
16125
16125
|
if (fun.rest) {
|
|
16126
|
-
printed.push((0, lines_1.concat)(["...", path3.call(
|
|
16126
|
+
printed.push((0, lines_1.concat)(["...", path3.call(print6, "rest")]));
|
|
16127
16127
|
}
|
|
16128
16128
|
var joined = (0, lines_1.fromString)(", ").join(printed);
|
|
16129
16129
|
if (joined.length > 1 || joined.getLineLength(1) > options.wrapColumn) {
|
|
@@ -16137,11 +16137,11 @@ var require_printer2 = __commonJS({
|
|
|
16137
16137
|
}
|
|
16138
16138
|
return joined;
|
|
16139
16139
|
}
|
|
16140
|
-
function maybePrintImportAssertions(path3, options,
|
|
16140
|
+
function maybePrintImportAssertions(path3, options, print6) {
|
|
16141
16141
|
var n = path3.getValue();
|
|
16142
16142
|
if (n.assertions && n.assertions.length > 0) {
|
|
16143
16143
|
var parts = [" assert {"];
|
|
16144
|
-
var printed = path3.map(
|
|
16144
|
+
var printed = path3.map(print6, "assertions");
|
|
16145
16145
|
var flat = (0, lines_1.fromString)(", ").join(printed);
|
|
16146
16146
|
if (flat.length > 1 || flat.getLineLength(1) > options.wrapColumn) {
|
|
16147
16147
|
parts.push("\n", (0, lines_1.fromString)(",\n").join(printed).indent(options.tabWidth), "\n}");
|
|
@@ -16152,7 +16152,7 @@ var require_printer2 = __commonJS({
|
|
|
16152
16152
|
}
|
|
16153
16153
|
return (0, lines_1.fromString)("");
|
|
16154
16154
|
}
|
|
16155
|
-
function printExportDeclaration(path3, options,
|
|
16155
|
+
function printExportDeclaration(path3, options, print6) {
|
|
16156
16156
|
var decl = path3.getValue();
|
|
16157
16157
|
var parts = ["export "];
|
|
16158
16158
|
if (decl.exportKind && decl.exportKind === "type") {
|
|
@@ -16166,7 +16166,7 @@ var require_printer2 = __commonJS({
|
|
|
16166
16166
|
parts.push("default ");
|
|
16167
16167
|
}
|
|
16168
16168
|
if (decl.declaration) {
|
|
16169
|
-
parts.push(path3.call(
|
|
16169
|
+
parts.push(path3.call(print6, "declaration"));
|
|
16170
16170
|
} else if (decl.specifiers) {
|
|
16171
16171
|
if (decl.specifiers.length === 1 && decl.specifiers[0].type === "ExportBatchSpecifier") {
|
|
16172
16172
|
parts.push("*");
|
|
@@ -16178,9 +16178,9 @@ var require_printer2 = __commonJS({
|
|
|
16178
16178
|
path3.each(function(specifierPath) {
|
|
16179
16179
|
var spec = specifierPath.getValue();
|
|
16180
16180
|
if (spec.type === "ExportDefaultSpecifier") {
|
|
16181
|
-
unbracedSpecifiers_2.push(
|
|
16181
|
+
unbracedSpecifiers_2.push(print6(specifierPath));
|
|
16182
16182
|
} else {
|
|
16183
|
-
bracedSpecifiers_2.push(
|
|
16183
|
+
bracedSpecifiers_2.push(print6(specifierPath));
|
|
16184
16184
|
}
|
|
16185
16185
|
}, "specifiers");
|
|
16186
16186
|
unbracedSpecifiers_2.forEach(function(lines2, i2) {
|
|
@@ -16209,10 +16209,10 @@ var require_printer2 = __commonJS({
|
|
|
16209
16209
|
}
|
|
16210
16210
|
}
|
|
16211
16211
|
} else {
|
|
16212
|
-
parts.push(shouldPrintSpaces ? "{ " : "{", (0, lines_1.fromString)(", ").join(path3.map(
|
|
16212
|
+
parts.push(shouldPrintSpaces ? "{ " : "{", (0, lines_1.fromString)(", ").join(path3.map(print6, "specifiers")), shouldPrintSpaces ? " }" : "}");
|
|
16213
16213
|
}
|
|
16214
16214
|
if (decl.source) {
|
|
16215
|
-
parts.push(" from ", path3.call(
|
|
16215
|
+
parts.push(" from ", path3.call(print6, "source"), maybePrintImportAssertions(path3, options, print6));
|
|
16216
16216
|
}
|
|
16217
16217
|
}
|
|
16218
16218
|
var lines = (0, lines_1.concat)(parts);
|
|
@@ -16230,7 +16230,7 @@ var require_printer2 = __commonJS({
|
|
|
16230
16230
|
}
|
|
16231
16231
|
return (0, lines_1.concat)(parts);
|
|
16232
16232
|
}
|
|
16233
|
-
function printVariance(path3,
|
|
16233
|
+
function printVariance(path3, print6) {
|
|
16234
16234
|
return path3.call(function(variancePath) {
|
|
16235
16235
|
var value = variancePath.getValue();
|
|
16236
16236
|
if (value) {
|
|
@@ -16240,7 +16240,7 @@ var require_printer2 = __commonJS({
|
|
|
16240
16240
|
if (value === "minus") {
|
|
16241
16241
|
return (0, lines_1.fromString)("-");
|
|
16242
16242
|
}
|
|
16243
|
-
return
|
|
16243
|
+
return print6(variancePath);
|
|
16244
16244
|
}
|
|
16245
16245
|
return (0, lines_1.fromString)("");
|
|
16246
16246
|
}, "variance");
|
|
@@ -16327,10 +16327,10 @@ var require_main4 = __commonJS({
|
|
|
16327
16327
|
Object.defineProperty(exports, "visit", { enumerable: true, get: function() {
|
|
16328
16328
|
return ast_types_1.visit;
|
|
16329
16329
|
} });
|
|
16330
|
-
function
|
|
16330
|
+
function print6(node, options) {
|
|
16331
16331
|
return new printer_1.Printer(options).print(node);
|
|
16332
16332
|
}
|
|
16333
|
-
exports.print =
|
|
16333
|
+
exports.print = print6;
|
|
16334
16334
|
function prettyPrint(node, options) {
|
|
16335
16335
|
return new printer_1.Printer(options).printGenerically(node);
|
|
16336
16336
|
}
|
|
@@ -16354,7 +16354,7 @@ var require_main4 = __commonJS({
|
|
|
16354
16354
|
function runString(code, transformer, options) {
|
|
16355
16355
|
var writeback = options && options.writeback || defaultWriteback;
|
|
16356
16356
|
transformer((0, parser_1.parse)(code, options), function(node) {
|
|
16357
|
-
writeback(
|
|
16357
|
+
writeback(print6(node, options).code);
|
|
16358
16358
|
});
|
|
16359
16359
|
}
|
|
16360
16360
|
}
|
|
@@ -16410,6 +16410,7 @@ import { deprecate as deprecate2 } from "node:util";
|
|
|
16410
16410
|
import * as graphql3 from "graphql";
|
|
16411
16411
|
import * as graphql4 from "graphql";
|
|
16412
16412
|
import * as graphql5 from "graphql";
|
|
16413
|
+
import * as graphql6 from "graphql";
|
|
16413
16414
|
var require2 = conflict_free(import.meta.url);
|
|
16414
16415
|
var __create2 = Object.create;
|
|
16415
16416
|
var __defProp2 = Object.defineProperty;
|
|
@@ -29858,14 +29859,14 @@ var require_lib3 = __commonJS2({
|
|
|
29858
29859
|
this.preserveSpace = !!preserveSpace;
|
|
29859
29860
|
}
|
|
29860
29861
|
};
|
|
29861
|
-
var
|
|
29862
|
+
var types5 = {
|
|
29862
29863
|
brace: new TokContext("{"),
|
|
29863
29864
|
j_oTag: new TokContext("<tag"),
|
|
29864
29865
|
j_cTag: new TokContext("</tag"),
|
|
29865
29866
|
j_expr: new TokContext("<tag>...</tag>", true)
|
|
29866
29867
|
};
|
|
29867
29868
|
{
|
|
29868
|
-
|
|
29869
|
+
types5.template = new TokContext("`", true);
|
|
29869
29870
|
}
|
|
29870
29871
|
var beforeExpr = true;
|
|
29871
29872
|
var startsExpr = true;
|
|
@@ -30403,17 +30404,17 @@ var require_lib3 = __commonJS2({
|
|
|
30403
30404
|
context.pop();
|
|
30404
30405
|
};
|
|
30405
30406
|
tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = (context) => {
|
|
30406
|
-
context.push(
|
|
30407
|
+
context.push(types5.brace);
|
|
30407
30408
|
};
|
|
30408
30409
|
tokenTypes[22].updateContext = (context) => {
|
|
30409
|
-
if (context[context.length - 1] ===
|
|
30410
|
+
if (context[context.length - 1] === types5.template) {
|
|
30410
30411
|
context.pop();
|
|
30411
30412
|
} else {
|
|
30412
|
-
context.push(
|
|
30413
|
+
context.push(types5.template);
|
|
30413
30414
|
}
|
|
30414
30415
|
};
|
|
30415
30416
|
tokenTypes[142].updateContext = (context) => {
|
|
30416
|
-
context.push(
|
|
30417
|
+
context.push(types5.j_expr, types5.j_oTag);
|
|
30417
30418
|
};
|
|
30418
30419
|
}
|
|
30419
30420
|
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";
|
|
@@ -30973,7 +30974,7 @@ var require_lib3 = __commonJS2({
|
|
|
30973
30974
|
this.end = 0;
|
|
30974
30975
|
this.lastTokEndLoc = null;
|
|
30975
30976
|
this.lastTokStartLoc = null;
|
|
30976
|
-
this.context = [
|
|
30977
|
+
this.context = [types5.brace];
|
|
30977
30978
|
this.firstInvalidTemplateEscapePos = null;
|
|
30978
30979
|
this.strictErrors = /* @__PURE__ */ new Map();
|
|
30979
30980
|
this.tokensLength = 0;
|
|
@@ -34800,7 +34801,7 @@ var require_lib3 = __commonJS2({
|
|
|
34800
34801
|
context
|
|
34801
34802
|
} = this.state;
|
|
34802
34803
|
const currentContext = context[context.length - 1];
|
|
34803
|
-
if (currentContext ===
|
|
34804
|
+
if (currentContext === types5.j_oTag || currentContext === types5.j_expr) {
|
|
34804
34805
|
context.pop();
|
|
34805
34806
|
}
|
|
34806
34807
|
}
|
|
@@ -35822,9 +35823,9 @@ var require_lib3 = __commonJS2({
|
|
|
35822
35823
|
switch (this.state.type) {
|
|
35823
35824
|
case 5:
|
|
35824
35825
|
node = this.startNode();
|
|
35825
|
-
this.setContext(
|
|
35826
|
+
this.setContext(types5.brace);
|
|
35826
35827
|
this.next();
|
|
35827
|
-
node = this.jsxParseExpressionContainer(node,
|
|
35828
|
+
node = this.jsxParseExpressionContainer(node, types5.j_oTag);
|
|
35828
35829
|
if (node.expression.type === "JSXEmptyExpression") {
|
|
35829
35830
|
this.raise(JsxErrors.AttributeIsEmpty, node);
|
|
35830
35831
|
}
|
|
@@ -35843,7 +35844,7 @@ var require_lib3 = __commonJS2({
|
|
|
35843
35844
|
jsxParseSpreadChild(node) {
|
|
35844
35845
|
this.next();
|
|
35845
35846
|
node.expression = this.parseExpression();
|
|
35846
|
-
this.setContext(
|
|
35847
|
+
this.setContext(types5.j_expr);
|
|
35847
35848
|
this.state.canStartJSXElement = true;
|
|
35848
35849
|
this.expect(8);
|
|
35849
35850
|
return this.finishNode(node, "JSXSpreadChild");
|
|
@@ -35863,11 +35864,11 @@ var require_lib3 = __commonJS2({
|
|
|
35863
35864
|
jsxParseAttribute() {
|
|
35864
35865
|
const node = this.startNode();
|
|
35865
35866
|
if (this.match(5)) {
|
|
35866
|
-
this.setContext(
|
|
35867
|
+
this.setContext(types5.brace);
|
|
35867
35868
|
this.next();
|
|
35868
35869
|
this.expect(21);
|
|
35869
35870
|
node.argument = this.parseMaybeAssignAllowIn();
|
|
35870
|
-
this.setContext(
|
|
35871
|
+
this.setContext(types5.j_oTag);
|
|
35871
35872
|
this.state.canStartJSXElement = true;
|
|
35872
35873
|
this.expect(8);
|
|
35873
35874
|
return this.finishNode(node, "JSXSpreadAttribute");
|
|
@@ -35926,12 +35927,12 @@ var require_lib3 = __commonJS2({
|
|
|
35926
35927
|
break;
|
|
35927
35928
|
case 5: {
|
|
35928
35929
|
const node2 = this.startNode();
|
|
35929
|
-
this.setContext(
|
|
35930
|
+
this.setContext(types5.brace);
|
|
35930
35931
|
this.next();
|
|
35931
35932
|
if (this.match(21)) {
|
|
35932
35933
|
children.push(this.jsxParseSpreadChild(node2));
|
|
35933
35934
|
} else {
|
|
35934
|
-
children.push(this.jsxParseExpressionContainer(node2,
|
|
35935
|
+
children.push(this.jsxParseExpressionContainer(node2, types5.j_expr));
|
|
35935
35936
|
}
|
|
35936
35937
|
break;
|
|
35937
35938
|
}
|
|
@@ -35996,11 +35997,11 @@ var require_lib3 = __commonJS2({
|
|
|
35996
35997
|
}
|
|
35997
35998
|
getTokenFromCode(code2) {
|
|
35998
35999
|
const context = this.curContext();
|
|
35999
|
-
if (context ===
|
|
36000
|
+
if (context === types5.j_expr) {
|
|
36000
36001
|
this.jsxReadToken();
|
|
36001
36002
|
return;
|
|
36002
36003
|
}
|
|
36003
|
-
if (context ===
|
|
36004
|
+
if (context === types5.j_oTag || context === types5.j_cTag) {
|
|
36004
36005
|
if (isIdentifierStart(code2)) {
|
|
36005
36006
|
this.jsxReadWord();
|
|
36006
36007
|
return;
|
|
@@ -36010,7 +36011,7 @@ var require_lib3 = __commonJS2({
|
|
|
36010
36011
|
this.finishToken(143);
|
|
36011
36012
|
return;
|
|
36012
36013
|
}
|
|
36013
|
-
if ((code2 === 34 || code2 === 39) && context ===
|
|
36014
|
+
if ((code2 === 34 || code2 === 39) && context === types5.j_oTag) {
|
|
36014
36015
|
this.jsxReadString(code2);
|
|
36015
36016
|
return;
|
|
36016
36017
|
}
|
|
@@ -36028,17 +36029,17 @@ var require_lib3 = __commonJS2({
|
|
|
36028
36029
|
type
|
|
36029
36030
|
} = this.state;
|
|
36030
36031
|
if (type === 56 && prevType === 142) {
|
|
36031
|
-
context.splice(-2, 2,
|
|
36032
|
+
context.splice(-2, 2, types5.j_cTag);
|
|
36032
36033
|
this.state.canStartJSXElement = false;
|
|
36033
36034
|
} else if (type === 142) {
|
|
36034
|
-
context.push(
|
|
36035
|
+
context.push(types5.j_oTag);
|
|
36035
36036
|
} else if (type === 143) {
|
|
36036
36037
|
const out = context[context.length - 1];
|
|
36037
|
-
if (out ===
|
|
36038
|
+
if (out === types5.j_oTag && prevType === 56 || out === types5.j_cTag) {
|
|
36038
36039
|
context.pop();
|
|
36039
|
-
this.state.canStartJSXElement = context[context.length - 1] ===
|
|
36040
|
+
this.state.canStartJSXElement = context[context.length - 1] === types5.j_expr;
|
|
36040
36041
|
} else {
|
|
36041
|
-
this.setContext(
|
|
36042
|
+
this.setContext(types5.j_expr);
|
|
36042
36043
|
this.state.canStartJSXElement = true;
|
|
36043
36044
|
}
|
|
36044
36045
|
} else {
|
|
@@ -37413,14 +37414,14 @@ var require_lib3 = __commonJS2({
|
|
|
37413
37414
|
tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
|
|
37414
37415
|
const node = this.startNode();
|
|
37415
37416
|
const hasLeadingOperator = this.eat(operator);
|
|
37416
|
-
const
|
|
37417
|
+
const types6 = [];
|
|
37417
37418
|
do {
|
|
37418
|
-
|
|
37419
|
+
types6.push(parseConstituentType());
|
|
37419
37420
|
} while (this.eat(operator));
|
|
37420
|
-
if (
|
|
37421
|
-
return
|
|
37421
|
+
if (types6.length === 1 && !hasLeadingOperator) {
|
|
37422
|
+
return types6[0];
|
|
37422
37423
|
}
|
|
37423
|
-
node.types =
|
|
37424
|
+
node.types = types6;
|
|
37424
37425
|
return this.finishNode(node, kind);
|
|
37425
37426
|
}
|
|
37426
37427
|
tsParseIntersectionTypeOrHigher() {
|
|
@@ -37984,7 +37985,7 @@ var require_lib3 = __commonJS2({
|
|
|
37984
37985
|
}));
|
|
37985
37986
|
if (node.params.length === 0) {
|
|
37986
37987
|
this.raise(TSErrors.EmptyTypeArguments, node);
|
|
37987
|
-
} else if (!this.state.inType && this.curContext() ===
|
|
37988
|
+
} else if (!this.state.inType && this.curContext() === types5.brace) {
|
|
37988
37989
|
this.reScan_lt_gt();
|
|
37989
37990
|
}
|
|
37990
37991
|
this.expect(48);
|
|
@@ -38610,7 +38611,7 @@ var require_lib3 = __commonJS2({
|
|
|
38610
38611
|
context
|
|
38611
38612
|
} = this.state;
|
|
38612
38613
|
const currentContext = context[context.length - 1];
|
|
38613
|
-
if (currentContext ===
|
|
38614
|
+
if (currentContext === types5.j_oTag || currentContext === types5.j_expr) {
|
|
38614
38615
|
context.pop();
|
|
38615
38616
|
}
|
|
38616
38617
|
}
|
|
@@ -43738,9 +43739,9 @@ var require_shared = __commonJS2({
|
|
|
43738
43739
|
var tslib_1 = require_tslib();
|
|
43739
43740
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
43740
43741
|
function default_1(fork) {
|
|
43741
|
-
var
|
|
43742
|
-
var Type =
|
|
43743
|
-
var builtin =
|
|
43742
|
+
var types5 = fork.use(types_1.default);
|
|
43743
|
+
var Type = types5.Type;
|
|
43744
|
+
var builtin = types5.builtInTypes;
|
|
43744
43745
|
var isNumber = builtin.number;
|
|
43745
43746
|
function geq(than) {
|
|
43746
43747
|
return Type.from(function(value) {
|
|
@@ -43888,9 +43889,9 @@ var require_types = __commonJS2({
|
|
|
43888
43889
|
}(BaseType);
|
|
43889
43890
|
var OrType = function(_super) {
|
|
43890
43891
|
tslib_1.__extends(OrType2, _super);
|
|
43891
|
-
function OrType2(
|
|
43892
|
+
function OrType2(types5) {
|
|
43892
43893
|
var _this = _super.call(this) || this;
|
|
43893
|
-
_this.types =
|
|
43894
|
+
_this.types = types5;
|
|
43894
43895
|
_this.kind = "OrType";
|
|
43895
43896
|
return _this;
|
|
43896
43897
|
}
|
|
@@ -44031,11 +44032,11 @@ var require_types = __commonJS2({
|
|
|
44031
44032
|
function typesPlugin(_fork) {
|
|
44032
44033
|
var Type = {
|
|
44033
44034
|
or: function() {
|
|
44034
|
-
var
|
|
44035
|
+
var types5 = [];
|
|
44035
44036
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
44036
|
-
|
|
44037
|
+
types5[_i] = arguments[_i];
|
|
44037
44038
|
}
|
|
44038
|
-
return new OrType(
|
|
44039
|
+
return new OrType(types5.map(function(type) {
|
|
44039
44040
|
return Type.from(type);
|
|
44040
44041
|
}));
|
|
44041
44042
|
},
|
|
@@ -44478,9 +44479,9 @@ var require_path2 = __commonJS2({
|
|
|
44478
44479
|
var Op = Object.prototype;
|
|
44479
44480
|
var hasOwn = Op.hasOwnProperty;
|
|
44480
44481
|
function pathPlugin(fork) {
|
|
44481
|
-
var
|
|
44482
|
-
var isArray =
|
|
44483
|
-
var isNumber =
|
|
44482
|
+
var types5 = fork.use(types_1.default);
|
|
44483
|
+
var isArray = types5.builtInTypes.array;
|
|
44484
|
+
var isNumber = types5.builtInTypes.number;
|
|
44484
44485
|
var Path = function Path2(value, parentPath, name) {
|
|
44485
44486
|
if (!(this instanceof Path2)) {
|
|
44486
44487
|
throw new Error("Path constructor cannot be invoked without 'new'");
|
|
@@ -44780,13 +44781,13 @@ var require_scope = __commonJS2({
|
|
|
44780
44781
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
44781
44782
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
44782
44783
|
function scopePlugin(fork) {
|
|
44783
|
-
var
|
|
44784
|
-
var Type =
|
|
44785
|
-
var namedTypes =
|
|
44784
|
+
var types5 = fork.use(types_1.default);
|
|
44785
|
+
var Type = types5.Type;
|
|
44786
|
+
var namedTypes = types5.namedTypes;
|
|
44786
44787
|
var Node = namedTypes.Node;
|
|
44787
44788
|
var Expression = namedTypes.Expression;
|
|
44788
|
-
var isArray =
|
|
44789
|
-
var b =
|
|
44789
|
+
var isArray = types5.builtInTypes.array;
|
|
44790
|
+
var b = types5.builders;
|
|
44790
44791
|
var Scope = function Scope2(path3, parentScope) {
|
|
44791
44792
|
if (!(this instanceof Scope2)) {
|
|
44792
44793
|
throw new Error("Scope constructor cannot be invoked without 'new'");
|
|
@@ -44849,7 +44850,7 @@ var require_scope = __commonJS2({
|
|
|
44849
44850
|
++index;
|
|
44850
44851
|
}
|
|
44851
44852
|
var name = prefix + index;
|
|
44852
|
-
return this.bindings[name] =
|
|
44853
|
+
return this.bindings[name] = types5.builders.identifier(name);
|
|
44853
44854
|
};
|
|
44854
44855
|
Sp.injectTemporary = function(identifier, init) {
|
|
44855
44856
|
identifier || (identifier = this.declareTemporary());
|
|
@@ -44925,7 +44926,7 @@ var require_scope = __commonJS2({
|
|
|
44925
44926
|
bindings
|
|
44926
44927
|
);
|
|
44927
44928
|
} else if (Node.check(node) && !Expression.check(node)) {
|
|
44928
|
-
|
|
44929
|
+
types5.eachField(node, function(name, child) {
|
|
44929
44930
|
var childPath = path3.get(name);
|
|
44930
44931
|
if (!pathHasValue(childPath, child)) {
|
|
44931
44932
|
throw new Error("");
|
|
@@ -45003,24 +45004,24 @@ var require_scope = __commonJS2({
|
|
|
45003
45004
|
addPattern(patternPath.get("argument"), bindings);
|
|
45004
45005
|
}
|
|
45005
45006
|
}
|
|
45006
|
-
function addTypePattern(patternPath,
|
|
45007
|
+
function addTypePattern(patternPath, types6) {
|
|
45007
45008
|
var pattern = patternPath.value;
|
|
45008
45009
|
namedTypes.Pattern.assert(pattern);
|
|
45009
45010
|
if (namedTypes.Identifier.check(pattern)) {
|
|
45010
|
-
if (hasOwn.call(
|
|
45011
|
-
|
|
45011
|
+
if (hasOwn.call(types6, pattern.name)) {
|
|
45012
|
+
types6[pattern.name].push(patternPath);
|
|
45012
45013
|
} else {
|
|
45013
|
-
|
|
45014
|
+
types6[pattern.name] = [patternPath];
|
|
45014
45015
|
}
|
|
45015
45016
|
}
|
|
45016
45017
|
}
|
|
45017
|
-
function addTypeParameter(parameterPath,
|
|
45018
|
+
function addTypeParameter(parameterPath, types6) {
|
|
45018
45019
|
var parameter = parameterPath.value;
|
|
45019
45020
|
FlowOrTSTypeParameterType.assert(parameter);
|
|
45020
|
-
if (hasOwn.call(
|
|
45021
|
-
|
|
45021
|
+
if (hasOwn.call(types6, parameter.name)) {
|
|
45022
|
+
types6[parameter.name].push(parameterPath);
|
|
45022
45023
|
} else {
|
|
45023
|
-
|
|
45024
|
+
types6[parameter.name] = [parameterPath];
|
|
45024
45025
|
}
|
|
45025
45026
|
}
|
|
45026
45027
|
Sp.lookup = function(name) {
|
|
@@ -45059,11 +45060,11 @@ var require_node_path = __commonJS2({
|
|
|
45059
45060
|
var scope_1 = tslib_1.__importDefault(require_scope());
|
|
45060
45061
|
var shared_1 = require_shared();
|
|
45061
45062
|
function nodePathPlugin(fork) {
|
|
45062
|
-
var
|
|
45063
|
-
var n =
|
|
45064
|
-
var b =
|
|
45065
|
-
var isNumber =
|
|
45066
|
-
var isArray =
|
|
45063
|
+
var types5 = fork.use(types_1.default);
|
|
45064
|
+
var n = types5.namedTypes;
|
|
45065
|
+
var b = types5.builders;
|
|
45066
|
+
var isNumber = types5.builtInTypes.number;
|
|
45067
|
+
var isArray = types5.builtInTypes.array;
|
|
45067
45068
|
var Path = fork.use(path_1.default);
|
|
45068
45069
|
var Scope = fork.use(scope_1.default);
|
|
45069
45070
|
var NodePath = function NodePath2(value, parentPath, name) {
|
|
@@ -45154,7 +45155,7 @@ var require_node_path = __commonJS2({
|
|
|
45154
45155
|
return scope || null;
|
|
45155
45156
|
};
|
|
45156
45157
|
NPp.getValueProperty = function(name) {
|
|
45157
|
-
return
|
|
45158
|
+
return types5.getFieldValue(this.value, name);
|
|
45158
45159
|
};
|
|
45159
45160
|
NPp.needsParens = function(assumeExpressionContext) {
|
|
45160
45161
|
var pp = this.parentPath;
|
|
@@ -45296,7 +45297,7 @@ var require_node_path = __commonJS2({
|
|
|
45296
45297
|
return node.some(containsCallExpression);
|
|
45297
45298
|
}
|
|
45298
45299
|
if (n.Node.check(node)) {
|
|
45299
|
-
return
|
|
45300
|
+
return types5.someField(node, function(_name, child) {
|
|
45300
45301
|
return containsCallExpression(child);
|
|
45301
45302
|
});
|
|
45302
45303
|
}
|
|
@@ -45415,11 +45416,11 @@ var require_path_visitor = __commonJS2({
|
|
|
45415
45416
|
var shared_1 = require_shared();
|
|
45416
45417
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
45417
45418
|
function pathVisitorPlugin(fork) {
|
|
45418
|
-
var
|
|
45419
|
+
var types5 = fork.use(types_1.default);
|
|
45419
45420
|
var NodePath = fork.use(node_path_1.default);
|
|
45420
|
-
var isArray =
|
|
45421
|
-
var isObject2 =
|
|
45422
|
-
var isFunction =
|
|
45421
|
+
var isArray = types5.builtInTypes.array;
|
|
45422
|
+
var isObject2 = types5.builtInTypes.object;
|
|
45423
|
+
var isFunction = types5.builtInTypes.function;
|
|
45423
45424
|
var undefined2;
|
|
45424
45425
|
var PathVisitor = function PathVisitor2() {
|
|
45425
45426
|
if (!(this instanceof PathVisitor2)) {
|
|
@@ -45439,7 +45440,7 @@ var require_path_visitor = __commonJS2({
|
|
|
45439
45440
|
typeNames[methodName.slice("visit".length)] = true;
|
|
45440
45441
|
}
|
|
45441
45442
|
}
|
|
45442
|
-
var supertypeTable =
|
|
45443
|
+
var supertypeTable = types5.computeSupertypeLookupTable(typeNames);
|
|
45443
45444
|
var methodNameTable = /* @__PURE__ */ Object.create(null);
|
|
45444
45445
|
var typeNameKeys = Object.keys(supertypeTable);
|
|
45445
45446
|
var typeNameCount = typeNameKeys.length;
|
|
@@ -45558,7 +45559,7 @@ var require_path_visitor = __commonJS2({
|
|
|
45558
45559
|
path3.each(visitor.visitWithoutReset, visitor);
|
|
45559
45560
|
} else if (!isObject2.check(value)) {
|
|
45560
45561
|
} else {
|
|
45561
|
-
var childNames =
|
|
45562
|
+
var childNames = types5.getFieldNames(value);
|
|
45562
45563
|
if (visitor._shouldVisitComments && value.comments && childNames.indexOf("comments") < 0) {
|
|
45563
45564
|
childNames.push("comments");
|
|
45564
45565
|
}
|
|
@@ -45567,7 +45568,7 @@ var require_path_visitor = __commonJS2({
|
|
|
45567
45568
|
for (var i2 = 0; i2 < childCount; ++i2) {
|
|
45568
45569
|
var childName = childNames[i2];
|
|
45569
45570
|
if (!hasOwn.call(value, childName)) {
|
|
45570
|
-
value[childName] =
|
|
45571
|
+
value[childName] = types5.getFieldValue(value, childName);
|
|
45571
45572
|
}
|
|
45572
45573
|
childPaths.push(path3.get(childName));
|
|
45573
45574
|
}
|
|
@@ -45708,13 +45709,13 @@ var require_equiv = __commonJS2({
|
|
|
45708
45709
|
var shared_1 = require_shared();
|
|
45709
45710
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
45710
45711
|
function default_1(fork) {
|
|
45711
|
-
var
|
|
45712
|
-
var getFieldNames =
|
|
45713
|
-
var getFieldValue =
|
|
45714
|
-
var isArray =
|
|
45715
|
-
var isObject2 =
|
|
45716
|
-
var isDate =
|
|
45717
|
-
var isRegExp =
|
|
45712
|
+
var types5 = fork.use(types_1.default);
|
|
45713
|
+
var getFieldNames = types5.getFieldNames;
|
|
45714
|
+
var getFieldValue = types5.getFieldValue;
|
|
45715
|
+
var isArray = types5.builtInTypes.array;
|
|
45716
|
+
var isObject2 = types5.builtInTypes.object;
|
|
45717
|
+
var isDate = types5.builtInTypes.Date;
|
|
45718
|
+
var isRegExp = types5.builtInTypes.RegExp;
|
|
45718
45719
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
45719
45720
|
function astNodesAreEquivalent(a, b, problemPath) {
|
|
45720
45721
|
if (isArray.check(problemPath)) {
|
|
@@ -45865,24 +45866,24 @@ var require_fork = __commonJS2({
|
|
|
45865
45866
|
var shared_1 = require_shared();
|
|
45866
45867
|
function default_1(plugins2) {
|
|
45867
45868
|
var fork = createFork();
|
|
45868
|
-
var
|
|
45869
|
+
var types5 = fork.use(types_1.default);
|
|
45869
45870
|
plugins2.forEach(fork.use);
|
|
45870
|
-
|
|
45871
|
+
types5.finalize();
|
|
45871
45872
|
var PathVisitor = fork.use(path_visitor_1.default);
|
|
45872
45873
|
return {
|
|
45873
|
-
Type:
|
|
45874
|
-
builtInTypes:
|
|
45875
|
-
namedTypes:
|
|
45876
|
-
builders:
|
|
45877
|
-
defineMethod:
|
|
45878
|
-
getFieldNames:
|
|
45879
|
-
getFieldValue:
|
|
45880
|
-
eachField:
|
|
45881
|
-
someField:
|
|
45882
|
-
getSupertypeNames:
|
|
45883
|
-
getBuilderName:
|
|
45874
|
+
Type: types5.Type,
|
|
45875
|
+
builtInTypes: types5.builtInTypes,
|
|
45876
|
+
namedTypes: types5.namedTypes,
|
|
45877
|
+
builders: types5.builders,
|
|
45878
|
+
defineMethod: types5.defineMethod,
|
|
45879
|
+
getFieldNames: types5.getFieldNames,
|
|
45880
|
+
getFieldValue: types5.getFieldValue,
|
|
45881
|
+
eachField: types5.eachField,
|
|
45882
|
+
someField: types5.someField,
|
|
45883
|
+
getSupertypeNames: types5.getSupertypeNames,
|
|
45884
|
+
getBuilderName: types5.getBuilderName,
|
|
45884
45885
|
astNodesAreEquivalent: fork.use(equiv_1.default),
|
|
45885
|
-
finalize:
|
|
45886
|
+
finalize: types5.finalize,
|
|
45886
45887
|
Path: fork.use(path_1.default),
|
|
45887
45888
|
NodePath: fork.use(node_path_1.default),
|
|
45888
45889
|
PathVisitor,
|
|
@@ -46042,8 +46043,8 @@ var require_core2 = __commonJS2({
|
|
|
46042
46043
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
46043
46044
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46044
46045
|
function default_1(fork) {
|
|
46045
|
-
var
|
|
46046
|
-
var Type =
|
|
46046
|
+
var types5 = fork.use(types_1.default);
|
|
46047
|
+
var Type = types5.Type;
|
|
46047
46048
|
var def = Type.def;
|
|
46048
46049
|
var or = Type.or;
|
|
46049
46050
|
var shared = fork.use(shared_1.default);
|
|
@@ -46133,9 +46134,9 @@ var require_es6 = __commonJS2({
|
|
|
46133
46134
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46134
46135
|
function default_1(fork) {
|
|
46135
46136
|
fork.use(core_1.default);
|
|
46136
|
-
var
|
|
46137
|
-
var def =
|
|
46138
|
-
var or =
|
|
46137
|
+
var types5 = fork.use(types_1.default);
|
|
46138
|
+
var def = types5.Type.def;
|
|
46139
|
+
var or = types5.Type.or;
|
|
46139
46140
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46140
46141
|
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"]);
|
|
46141
46142
|
def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field(
|
|
@@ -46221,8 +46222,8 @@ var require_es2017 = __commonJS2({
|
|
|
46221
46222
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46222
46223
|
function default_1(fork) {
|
|
46223
46224
|
fork.use(es2016_1.default);
|
|
46224
|
-
var
|
|
46225
|
-
var def =
|
|
46225
|
+
var types5 = fork.use(types_1.default);
|
|
46226
|
+
var def = types5.Type.def;
|
|
46226
46227
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46227
46228
|
def("Function").field("async", Boolean, defaults["false"]);
|
|
46228
46229
|
def("AwaitExpression").bases("Expression").build("argument").field("argument", def("Expression"));
|
|
@@ -46243,9 +46244,9 @@ var require_es2018 = __commonJS2({
|
|
|
46243
46244
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46244
46245
|
function default_1(fork) {
|
|
46245
46246
|
fork.use(es2017_1.default);
|
|
46246
|
-
var
|
|
46247
|
-
var def =
|
|
46248
|
-
var or =
|
|
46247
|
+
var types5 = fork.use(types_1.default);
|
|
46248
|
+
var def = types5.Type.def;
|
|
46249
|
+
var or = types5.Type.or;
|
|
46249
46250
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46250
46251
|
def("ForOfStatement").field("await", Boolean, defaults["false"]);
|
|
46251
46252
|
def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
|
|
@@ -46274,9 +46275,9 @@ var require_es2019 = __commonJS2({
|
|
|
46274
46275
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46275
46276
|
function default_1(fork) {
|
|
46276
46277
|
fork.use(es2018_1.default);
|
|
46277
|
-
var
|
|
46278
|
-
var def =
|
|
46279
|
-
var or =
|
|
46278
|
+
var types5 = fork.use(types_1.default);
|
|
46279
|
+
var def = types5.Type.def;
|
|
46280
|
+
var or = types5.Type.or;
|
|
46280
46281
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46281
46282
|
def("CatchClause").field("param", or(def("Pattern"), null), defaults["null"]);
|
|
46282
46283
|
}
|
|
@@ -46298,9 +46299,9 @@ var require_es20202 = __commonJS2({
|
|
|
46298
46299
|
function default_1(fork) {
|
|
46299
46300
|
fork.use(es2020_1.default);
|
|
46300
46301
|
fork.use(es2019_1.default);
|
|
46301
|
-
var
|
|
46302
|
-
var def =
|
|
46303
|
-
var or =
|
|
46302
|
+
var types5 = fork.use(types_1.default);
|
|
46303
|
+
var def = types5.Type.def;
|
|
46304
|
+
var or = types5.Type.or;
|
|
46304
46305
|
var shared = fork.use(shared_1.default);
|
|
46305
46306
|
var defaults = shared.defaults;
|
|
46306
46307
|
def("ImportExpression").bases("Expression").build("source").field("source", def("Expression"));
|
|
@@ -46346,8 +46347,8 @@ var require_es2022 = __commonJS2({
|
|
|
46346
46347
|
var shared_1 = require_shared();
|
|
46347
46348
|
function default_1(fork) {
|
|
46348
46349
|
fork.use(es2021_1.default);
|
|
46349
|
-
var
|
|
46350
|
-
var def =
|
|
46350
|
+
var types5 = fork.use(types_1.default);
|
|
46351
|
+
var def = types5.Type.def;
|
|
46351
46352
|
def("StaticBlock").bases("Declaration").build("body").field("body", [def("Statement")]);
|
|
46352
46353
|
}
|
|
46353
46354
|
exports.default = default_1;
|
|
@@ -46366,9 +46367,9 @@ var require_es_proposals = __commonJS2({
|
|
|
46366
46367
|
var es2022_1 = tslib_1.__importDefault(require_es2022());
|
|
46367
46368
|
function default_1(fork) {
|
|
46368
46369
|
fork.use(es2022_1.default);
|
|
46369
|
-
var
|
|
46370
|
-
var Type =
|
|
46371
|
-
var def =
|
|
46370
|
+
var types5 = fork.use(types_1.default);
|
|
46371
|
+
var Type = types5.Type;
|
|
46372
|
+
var def = types5.Type.def;
|
|
46372
46373
|
var or = Type.or;
|
|
46373
46374
|
var shared = fork.use(shared_1.default);
|
|
46374
46375
|
var defaults = shared.defaults;
|
|
@@ -46406,9 +46407,9 @@ var require_jsx = __commonJS2({
|
|
|
46406
46407
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46407
46408
|
function default_1(fork) {
|
|
46408
46409
|
fork.use(es_proposals_1.default);
|
|
46409
|
-
var
|
|
46410
|
-
var def =
|
|
46411
|
-
var or =
|
|
46410
|
+
var types5 = fork.use(types_1.default);
|
|
46411
|
+
var def = types5.Type.def;
|
|
46412
|
+
var or = types5.Type.or;
|
|
46412
46413
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46413
46414
|
def("JSXAttribute").bases("Node").build("name", "value").field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or(
|
|
46414
46415
|
def("Literal"),
|
|
@@ -46464,9 +46465,9 @@ var require_type_annotations = __commonJS2({
|
|
|
46464
46465
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
46465
46466
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46466
46467
|
function default_1(fork) {
|
|
46467
|
-
var
|
|
46468
|
-
var def =
|
|
46469
|
-
var or =
|
|
46468
|
+
var types5 = fork.use(types_1.default);
|
|
46469
|
+
var def = types5.Type.def;
|
|
46470
|
+
var or = types5.Type.or;
|
|
46470
46471
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46471
46472
|
var TypeAnnotation = or(def("TypeAnnotation"), def("TSTypeAnnotation"), null);
|
|
46472
46473
|
var TypeParamDecl = or(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null);
|
|
@@ -46499,9 +46500,9 @@ var require_flow = __commonJS2({
|
|
|
46499
46500
|
function default_1(fork) {
|
|
46500
46501
|
fork.use(es_proposals_1.default);
|
|
46501
46502
|
fork.use(type_annotations_1.default);
|
|
46502
|
-
var
|
|
46503
|
-
var def =
|
|
46504
|
-
var or =
|
|
46503
|
+
var types5 = fork.use(types_1.default);
|
|
46504
|
+
var def = types5.Type.def;
|
|
46505
|
+
var or = types5.Type.or;
|
|
46505
46506
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46506
46507
|
def("Flow").bases("Node");
|
|
46507
46508
|
def("FlowType").bases("Flow");
|
|
@@ -46613,10 +46614,10 @@ var require_esprima = __commonJS2({
|
|
|
46613
46614
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
46614
46615
|
function default_1(fork) {
|
|
46615
46616
|
fork.use(es_proposals_1.default);
|
|
46616
|
-
var
|
|
46617
|
+
var types5 = fork.use(types_1.default);
|
|
46617
46618
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46618
|
-
var def =
|
|
46619
|
-
var or =
|
|
46619
|
+
var def = types5.Type.def;
|
|
46620
|
+
var or = types5.Type.or;
|
|
46620
46621
|
def("VariableDeclaration").field("declarations", [or(
|
|
46621
46622
|
def("VariableDeclarator"),
|
|
46622
46623
|
def("Identifier")
|
|
@@ -46659,11 +46660,11 @@ var require_babel_core = __commonJS2({
|
|
|
46659
46660
|
function default_1(fork) {
|
|
46660
46661
|
var _a, _b, _c, _d, _e;
|
|
46661
46662
|
fork.use(es_proposals_1.default);
|
|
46662
|
-
var
|
|
46663
|
+
var types5 = fork.use(types_1.default);
|
|
46663
46664
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46664
|
-
var def =
|
|
46665
|
-
var or =
|
|
46666
|
-
var isUndefined =
|
|
46665
|
+
var def = types5.Type.def;
|
|
46666
|
+
var or = types5.Type.or;
|
|
46667
|
+
var isUndefined = types5.builtInTypes.undefined;
|
|
46667
46668
|
def("Noop").bases("Statement").build();
|
|
46668
46669
|
def("DoExpression").bases("Expression").build("body").field("body", [def("Statement")]);
|
|
46669
46670
|
def("BindExpression").bases("Expression").build("object", "callee").field("object", or(def("Expression"), null)).field("callee", def("Expression"));
|
|
@@ -46688,7 +46689,7 @@ var require_babel_core = __commonJS2({
|
|
|
46688
46689
|
raw: String
|
|
46689
46690
|
},
|
|
46690
46691
|
function getDefault() {
|
|
46691
|
-
var value =
|
|
46692
|
+
var value = types5.getFieldValue(this, "value");
|
|
46692
46693
|
return {
|
|
46693
46694
|
rawValue: value,
|
|
46694
46695
|
raw: toRaw ? toRaw(value) : String(value)
|
|
@@ -46789,8 +46790,8 @@ var require_babel = __commonJS2({
|
|
|
46789
46790
|
var flow_1 = tslib_1.__importDefault(require_flow());
|
|
46790
46791
|
var shared_1 = require_shared();
|
|
46791
46792
|
function default_1(fork) {
|
|
46792
|
-
var
|
|
46793
|
-
var def =
|
|
46793
|
+
var types5 = fork.use(types_1.default);
|
|
46794
|
+
var def = types5.Type.def;
|
|
46794
46795
|
fork.use(babel_core_1.default);
|
|
46795
46796
|
fork.use(flow_1.default);
|
|
46796
46797
|
def("V8IntrinsicIdentifier").bases("Expression").build("name").field("name", String);
|
|
@@ -46814,12 +46815,12 @@ var require_typescript = __commonJS2({
|
|
|
46814
46815
|
function default_1(fork) {
|
|
46815
46816
|
fork.use(babel_core_1.default);
|
|
46816
46817
|
fork.use(type_annotations_1.default);
|
|
46817
|
-
var
|
|
46818
|
-
var n =
|
|
46819
|
-
var def =
|
|
46820
|
-
var or =
|
|
46818
|
+
var types5 = fork.use(types_1.default);
|
|
46819
|
+
var n = types5.namedTypes;
|
|
46820
|
+
var def = types5.Type.def;
|
|
46821
|
+
var or = types5.Type.or;
|
|
46821
46822
|
var defaults = fork.use(shared_1.default).defaults;
|
|
46822
|
-
var StringLiteral =
|
|
46823
|
+
var StringLiteral = types5.Type.from(function(value, deep) {
|
|
46823
46824
|
if (n.StringLiteral && n.StringLiteral.check(value, deep)) {
|
|
46824
46825
|
return true;
|
|
46825
46826
|
}
|
|
@@ -48767,8 +48768,8 @@ var require_util2 = __commonJS2({
|
|
|
48767
48768
|
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;
|
|
48768
48769
|
var tslib_1 = require_tslib();
|
|
48769
48770
|
var assert_1 = tslib_1.__importDefault(__require2("assert"));
|
|
48770
|
-
var
|
|
48771
|
-
var n =
|
|
48771
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
48772
|
+
var n = types5.namedTypes;
|
|
48772
48773
|
var source_map_1 = tslib_1.__importDefault(require_source_map());
|
|
48773
48774
|
var SourceMapConsumer = source_map_1.default.SourceMapConsumer;
|
|
48774
48775
|
var SourceMapGenerator = source_map_1.default.SourceMapGenerator;
|
|
@@ -56074,10 +56075,10 @@ var require_comments = __commonJS2({
|
|
|
56074
56075
|
exports.printComments = exports.attach = void 0;
|
|
56075
56076
|
var tslib_1 = require_tslib();
|
|
56076
56077
|
var assert_1 = tslib_1.__importDefault(__require2("assert"));
|
|
56077
|
-
var
|
|
56078
|
-
var n =
|
|
56079
|
-
var isArray =
|
|
56080
|
-
var isObject2 =
|
|
56078
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
56079
|
+
var n = types5.namedTypes;
|
|
56080
|
+
var isArray = types5.builtInTypes.array;
|
|
56081
|
+
var isObject2 = types5.builtInTypes.object;
|
|
56081
56082
|
var lines_1 = require_lines();
|
|
56082
56083
|
var util_1 = require_util2();
|
|
56083
56084
|
var childNodesCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -56108,7 +56109,7 @@ var require_comments = __commonJS2({
|
|
|
56108
56109
|
if (isArray.check(node)) {
|
|
56109
56110
|
names = Object.keys(node);
|
|
56110
56111
|
} else if (isObject2.check(node)) {
|
|
56111
|
-
names =
|
|
56112
|
+
names = types5.getFieldNames(node);
|
|
56112
56113
|
} else {
|
|
56113
56114
|
return resultArray;
|
|
56114
56115
|
}
|
|
@@ -56286,7 +56287,7 @@ var require_comments = __commonJS2({
|
|
|
56286
56287
|
function printComments(path3, print6) {
|
|
56287
56288
|
var value = path3.getValue();
|
|
56288
56289
|
var innerLines = print6(path3);
|
|
56289
|
-
var comments = n.Node.check(value) &&
|
|
56290
|
+
var comments = n.Node.check(value) && types5.getFieldValue(value, "comments");
|
|
56290
56291
|
if (!comments || comments.length === 0) {
|
|
56291
56292
|
return innerLines;
|
|
56292
56293
|
}
|
|
@@ -56294,8 +56295,8 @@ var require_comments = __commonJS2({
|
|
|
56294
56295
|
var trailingParts = [innerLines];
|
|
56295
56296
|
path3.each(function(commentPath) {
|
|
56296
56297
|
var comment = commentPath.getValue();
|
|
56297
|
-
var leading =
|
|
56298
|
-
var trailing =
|
|
56298
|
+
var leading = types5.getFieldValue(comment, "leading");
|
|
56299
|
+
var trailing = types5.getFieldValue(comment, "trailing");
|
|
56299
56300
|
if (leading || trailing && !(n.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
56300
56301
|
leadingParts.push(printLeadingComment(commentPath, print6));
|
|
56301
56302
|
} else if (trailing) {
|
|
@@ -56315,10 +56316,10 @@ var require_parser = __commonJS2({
|
|
|
56315
56316
|
exports.parse = void 0;
|
|
56316
56317
|
var tslib_1 = require_tslib();
|
|
56317
56318
|
var assert_1 = tslib_1.__importDefault(__require2("assert"));
|
|
56318
|
-
var
|
|
56319
|
-
var b =
|
|
56320
|
-
var isObject2 =
|
|
56321
|
-
var isArray =
|
|
56319
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
56320
|
+
var b = types5.builders;
|
|
56321
|
+
var isObject2 = types5.builtInTypes.object;
|
|
56322
|
+
var isArray = types5.builtInTypes.array;
|
|
56322
56323
|
var options_1 = require_options();
|
|
56323
56324
|
var lines_1 = require_lines();
|
|
56324
56325
|
var comments_1 = require_comments();
|
|
@@ -56502,11 +56503,11 @@ var require_fast_path = __commonJS2({
|
|
|
56502
56503
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
56503
56504
|
var tslib_1 = require_tslib();
|
|
56504
56505
|
var assert_1 = tslib_1.__importDefault(__require2("assert"));
|
|
56505
|
-
var
|
|
56506
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
56506
56507
|
var util = tslib_1.__importStar(require_util2());
|
|
56507
|
-
var n =
|
|
56508
|
-
var isArray =
|
|
56509
|
-
var isNumber =
|
|
56508
|
+
var n = types5.namedTypes;
|
|
56509
|
+
var isArray = types5.builtInTypes.array;
|
|
56510
|
+
var isNumber = types5.builtInTypes.number;
|
|
56510
56511
|
var PRECEDENCE = {};
|
|
56511
56512
|
[
|
|
56512
56513
|
["??"],
|
|
@@ -56535,7 +56536,7 @@ var require_fast_path = __commonJS2({
|
|
|
56535
56536
|
if (obj instanceof FastPath) {
|
|
56536
56537
|
return obj.copy();
|
|
56537
56538
|
}
|
|
56538
|
-
if (obj instanceof
|
|
56539
|
+
if (obj instanceof types5.NodePath) {
|
|
56539
56540
|
var copy = Object.create(FastPath.prototype);
|
|
56540
56541
|
var stack = [obj.value];
|
|
56541
56542
|
for (var pp = void 0; pp = obj.parentPath; obj = pp)
|
|
@@ -56846,7 +56847,7 @@ var require_fast_path = __commonJS2({
|
|
|
56846
56847
|
return node.some(containsCallExpression);
|
|
56847
56848
|
}
|
|
56848
56849
|
if (n.Node.check(node)) {
|
|
56849
|
-
return
|
|
56850
|
+
return types5.someField(node, function(_name, child) {
|
|
56850
56851
|
return containsCallExpression(child);
|
|
56851
56852
|
});
|
|
56852
56853
|
}
|
|
@@ -56934,16 +56935,16 @@ var require_patcher = __commonJS2({
|
|
|
56934
56935
|
var tslib_1 = require_tslib();
|
|
56935
56936
|
var assert_1 = tslib_1.__importDefault(__require2("assert"));
|
|
56936
56937
|
var linesModule = tslib_1.__importStar(require_lines());
|
|
56937
|
-
var
|
|
56938
|
-
var Printable =
|
|
56939
|
-
var Expression =
|
|
56940
|
-
var ReturnStatement =
|
|
56941
|
-
var SourceLocation =
|
|
56938
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
56939
|
+
var Printable = types5.namedTypes.Printable;
|
|
56940
|
+
var Expression = types5.namedTypes.Expression;
|
|
56941
|
+
var ReturnStatement = types5.namedTypes.ReturnStatement;
|
|
56942
|
+
var SourceLocation = types5.namedTypes.SourceLocation;
|
|
56942
56943
|
var util_1 = require_util2();
|
|
56943
56944
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
56944
|
-
var isObject2 =
|
|
56945
|
-
var isArray =
|
|
56946
|
-
var isString =
|
|
56945
|
+
var isObject2 = types5.builtInTypes.object;
|
|
56946
|
+
var isArray = types5.builtInTypes.array;
|
|
56947
|
+
var isString = types5.builtInTypes.string;
|
|
56947
56948
|
var riskyAdjoiningCharExp = /[0-9a-z_$]/i;
|
|
56948
56949
|
var Patcher = function Patcher2(lines) {
|
|
56949
56950
|
assert_1.default.ok(this instanceof Patcher2);
|
|
@@ -57213,8 +57214,8 @@ var require_patcher = __commonJS2({
|
|
|
57213
57214
|
if (k.charAt(0) === "_") {
|
|
57214
57215
|
continue;
|
|
57215
57216
|
}
|
|
57216
|
-
newPath.stack.push(k,
|
|
57217
|
-
oldPath.stack.push(k,
|
|
57217
|
+
newPath.stack.push(k, types5.getFieldValue(newNode, k));
|
|
57218
|
+
oldPath.stack.push(k, types5.getFieldValue(oldNode, k));
|
|
57218
57219
|
var canReprint = findAnyReprints(newPath, oldPath, reprints);
|
|
57219
57220
|
newPath.stack.length -= 2;
|
|
57220
57221
|
oldPath.stack.length -= 2;
|
|
@@ -57236,16 +57237,16 @@ var require_printer = __commonJS2({
|
|
|
57236
57237
|
exports.Printer = void 0;
|
|
57237
57238
|
var tslib_1 = require_tslib();
|
|
57238
57239
|
var assert_1 = tslib_1.__importDefault(__require2("assert"));
|
|
57239
|
-
var
|
|
57240
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
57240
57241
|
var comments_1 = require_comments();
|
|
57241
57242
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
57242
57243
|
var lines_1 = require_lines();
|
|
57243
57244
|
var options_1 = require_options();
|
|
57244
57245
|
var patcher_1 = require_patcher();
|
|
57245
57246
|
var util = tslib_1.__importStar(require_util2());
|
|
57246
|
-
var namedTypes =
|
|
57247
|
-
var isString =
|
|
57248
|
-
var isObject2 =
|
|
57247
|
+
var namedTypes = types5.namedTypes;
|
|
57248
|
+
var isString = types5.builtInTypes.string;
|
|
57249
|
+
var isObject2 = types5.builtInTypes.object;
|
|
57249
57250
|
var PrintResult = function PrintResult2(code, sourceMap) {
|
|
57250
57251
|
assert_1.default.ok(this instanceof PrintResult2);
|
|
57251
57252
|
isString.assert(code);
|
|
@@ -57407,7 +57408,7 @@ var require_printer = __commonJS2({
|
|
|
57407
57408
|
case "OptionalMemberExpression": {
|
|
57408
57409
|
parts.push(path3.call(print6, "object"));
|
|
57409
57410
|
var property = path3.call(print6, "property");
|
|
57410
|
-
var optional =
|
|
57411
|
+
var optional = types5.getFieldValue(n, "optional");
|
|
57411
57412
|
if (n.computed) {
|
|
57412
57413
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
57413
57414
|
} else {
|
|
@@ -57678,7 +57679,7 @@ var require_printer = __commonJS2({
|
|
|
57678
57679
|
if (n.typeArguments) {
|
|
57679
57680
|
parts.push(path3.call(print6, "typeArguments"));
|
|
57680
57681
|
}
|
|
57681
|
-
if (
|
|
57682
|
+
if (types5.getFieldValue(n, "optional")) {
|
|
57682
57683
|
parts.push("?.");
|
|
57683
57684
|
}
|
|
57684
57685
|
parts.push(printArgumentsList(path3, options, print6));
|
|
@@ -59357,8 +59358,8 @@ var require_printer = __commonJS2({
|
|
|
59357
59358
|
});
|
|
59358
59359
|
}
|
|
59359
59360
|
function getPossibleRaw(node) {
|
|
59360
|
-
var value =
|
|
59361
|
-
var extra =
|
|
59361
|
+
var value = types5.getFieldValue(node, "value");
|
|
59362
|
+
var extra = types5.getFieldValue(node, "extra");
|
|
59362
59363
|
if (extra && typeof extra.raw === "string" && value == extra.rawValue) {
|
|
59363
59364
|
return extra.raw;
|
|
59364
59365
|
}
|
|
@@ -59404,8 +59405,8 @@ var require_main2 = __commonJS2({
|
|
|
59404
59405
|
exports.run = exports.prettyPrint = exports.print = exports.visit = exports.types = exports.parse = void 0;
|
|
59405
59406
|
var tslib_1 = require_tslib();
|
|
59406
59407
|
var fs_1 = tslib_1.__importDefault(__require2("fs"));
|
|
59407
|
-
var
|
|
59408
|
-
exports.types =
|
|
59408
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
59409
|
+
exports.types = types5;
|
|
59409
59410
|
var parser_1 = require_parser();
|
|
59410
59411
|
Object.defineProperty(exports, "parse", { enumerable: true, get: function() {
|
|
59411
59412
|
return parser_1.parse;
|
|
@@ -63795,30 +63796,30 @@ var require_utils3 = __commonJS2({
|
|
|
63795
63796
|
validate2.oneOf = values;
|
|
63796
63797
|
return validate2;
|
|
63797
63798
|
}
|
|
63798
|
-
function assertNodeType(...
|
|
63799
|
+
function assertNodeType(...types5) {
|
|
63799
63800
|
function validate2(node, key, val) {
|
|
63800
|
-
for (const type of
|
|
63801
|
+
for (const type of types5) {
|
|
63801
63802
|
if ((0, _is.default)(type, val)) {
|
|
63802
63803
|
(0, _validate.validateChild)(node, key, val);
|
|
63803
63804
|
return;
|
|
63804
63805
|
}
|
|
63805
63806
|
}
|
|
63806
|
-
throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(
|
|
63807
|
+
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)}`);
|
|
63807
63808
|
}
|
|
63808
|
-
validate2.oneOfNodeTypes =
|
|
63809
|
+
validate2.oneOfNodeTypes = types5;
|
|
63809
63810
|
return validate2;
|
|
63810
63811
|
}
|
|
63811
|
-
function assertNodeOrValueType(...
|
|
63812
|
+
function assertNodeOrValueType(...types5) {
|
|
63812
63813
|
function validate2(node, key, val) {
|
|
63813
|
-
for (const type of
|
|
63814
|
+
for (const type of types5) {
|
|
63814
63815
|
if (getType(val) === type || (0, _is.default)(type, val)) {
|
|
63815
63816
|
(0, _validate.validateChild)(node, key, val);
|
|
63816
63817
|
return;
|
|
63817
63818
|
}
|
|
63818
63819
|
}
|
|
63819
|
-
throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(
|
|
63820
|
+
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)}`);
|
|
63820
63821
|
}
|
|
63821
|
-
validate2.oneOfNodeOrValueTypes =
|
|
63822
|
+
validate2.oneOfNodeOrValueTypes = types5;
|
|
63822
63823
|
return validate2;
|
|
63823
63824
|
}
|
|
63824
63825
|
function assertValueType(type) {
|
|
@@ -67396,7 +67397,7 @@ var require_generated2 = __commonJS2({
|
|
|
67396
67397
|
exports.tSTypeParameterInstantiation = exports.tsTypeParameterInstantiation = tsTypeParameterInstantiation;
|
|
67397
67398
|
exports.tSTypePredicate = exports.tsTypePredicate = tsTypePredicate;
|
|
67398
67399
|
exports.tSTypeQuery = exports.tsTypeQuery = tsTypeQuery;
|
|
67399
|
-
exports.tSTypeReference = exports.tsTypeReference =
|
|
67400
|
+
exports.tSTypeReference = exports.tsTypeReference = tsTypeReference2;
|
|
67400
67401
|
exports.tSUndefinedKeyword = exports.tsUndefinedKeyword = tsUndefinedKeyword;
|
|
67401
67402
|
exports.tSUnionType = exports.tsUnionType = tsUnionType;
|
|
67402
67403
|
exports.tSUnknownKeyword = exports.tsUnknownKeyword = tsUnknownKeyword;
|
|
@@ -68222,10 +68223,10 @@ var require_generated2 = __commonJS2({
|
|
|
68222
68223
|
body
|
|
68223
68224
|
});
|
|
68224
68225
|
}
|
|
68225
|
-
function intersectionTypeAnnotation(
|
|
68226
|
+
function intersectionTypeAnnotation(types5) {
|
|
68226
68227
|
return (0, _validateNode.default)({
|
|
68227
68228
|
type: "IntersectionTypeAnnotation",
|
|
68228
|
-
types:
|
|
68229
|
+
types: types5
|
|
68229
68230
|
});
|
|
68230
68231
|
}
|
|
68231
68232
|
function mixedTypeAnnotation() {
|
|
@@ -68348,10 +68349,10 @@ var require_generated2 = __commonJS2({
|
|
|
68348
68349
|
type: "ThisTypeAnnotation"
|
|
68349
68350
|
};
|
|
68350
68351
|
}
|
|
68351
|
-
function tupleTypeAnnotation(
|
|
68352
|
+
function tupleTypeAnnotation(types5) {
|
|
68352
68353
|
return (0, _validateNode.default)({
|
|
68353
68354
|
type: "TupleTypeAnnotation",
|
|
68354
|
-
types:
|
|
68355
|
+
types: types5
|
|
68355
68356
|
});
|
|
68356
68357
|
}
|
|
68357
68358
|
function typeofTypeAnnotation(argument) {
|
|
@@ -68402,10 +68403,10 @@ var require_generated2 = __commonJS2({
|
|
|
68402
68403
|
params
|
|
68403
68404
|
});
|
|
68404
68405
|
}
|
|
68405
|
-
function unionTypeAnnotation(
|
|
68406
|
+
function unionTypeAnnotation(types5) {
|
|
68406
68407
|
return (0, _validateNode.default)({
|
|
68407
68408
|
type: "UnionTypeAnnotation",
|
|
68408
|
-
types:
|
|
68409
|
+
types: types5
|
|
68409
68410
|
});
|
|
68410
68411
|
}
|
|
68411
68412
|
function variance(kind) {
|
|
@@ -68858,7 +68859,7 @@ var require_generated2 = __commonJS2({
|
|
|
68858
68859
|
typeAnnotation: typeAnnotation2
|
|
68859
68860
|
});
|
|
68860
68861
|
}
|
|
68861
|
-
function
|
|
68862
|
+
function tsTypeReference2(typeName, typeParameters = null) {
|
|
68862
68863
|
return (0, _validateNode.default)({
|
|
68863
68864
|
type: "TSTypeReference",
|
|
68864
68865
|
typeName,
|
|
@@ -68918,16 +68919,16 @@ var require_generated2 = __commonJS2({
|
|
|
68918
68919
|
optional
|
|
68919
68920
|
});
|
|
68920
68921
|
}
|
|
68921
|
-
function tsUnionType(
|
|
68922
|
+
function tsUnionType(types5) {
|
|
68922
68923
|
return (0, _validateNode.default)({
|
|
68923
68924
|
type: "TSUnionType",
|
|
68924
|
-
types:
|
|
68925
|
+
types: types5
|
|
68925
68926
|
});
|
|
68926
68927
|
}
|
|
68927
|
-
function tsIntersectionType(
|
|
68928
|
+
function tsIntersectionType(types5) {
|
|
68928
68929
|
return (0, _validateNode.default)({
|
|
68929
68930
|
type: "TSIntersectionType",
|
|
68930
|
-
types:
|
|
68931
|
+
types: types5
|
|
68931
68932
|
});
|
|
68932
68933
|
}
|
|
68933
68934
|
function tsConditionalType(checkType, extendsType, trueType, falseType) {
|
|
@@ -70528,12 +70529,12 @@ var require_removeTypeDuplicates = __commonJS2({
|
|
|
70528
70529
|
const generics = /* @__PURE__ */ new Map();
|
|
70529
70530
|
const bases = /* @__PURE__ */ new Map();
|
|
70530
70531
|
const typeGroups = /* @__PURE__ */ new Set();
|
|
70531
|
-
const
|
|
70532
|
+
const types5 = [];
|
|
70532
70533
|
for (let i2 = 0; i2 < nodes.length; i2++) {
|
|
70533
70534
|
const node = nodes[i2];
|
|
70534
70535
|
if (!node)
|
|
70535
70536
|
continue;
|
|
70536
|
-
if (
|
|
70537
|
+
if (types5.indexOf(node) >= 0) {
|
|
70537
70538
|
continue;
|
|
70538
70539
|
}
|
|
70539
70540
|
if ((0, _generated.isAnyTypeAnnotation)(node)) {
|
|
@@ -70567,15 +70568,15 @@ var require_removeTypeDuplicates = __commonJS2({
|
|
|
70567
70568
|
}
|
|
70568
70569
|
continue;
|
|
70569
70570
|
}
|
|
70570
|
-
|
|
70571
|
+
types5.push(node);
|
|
70571
70572
|
}
|
|
70572
70573
|
for (const [, baseType] of bases) {
|
|
70573
|
-
|
|
70574
|
+
types5.push(baseType);
|
|
70574
70575
|
}
|
|
70575
70576
|
for (const [, genericName] of generics) {
|
|
70576
|
-
|
|
70577
|
+
types5.push(genericName);
|
|
70577
70578
|
}
|
|
70578
|
-
return
|
|
70579
|
+
return types5;
|
|
70579
70580
|
}
|
|
70580
70581
|
}
|
|
70581
70582
|
});
|
|
@@ -70588,8 +70589,8 @@ var require_createFlowUnionType = __commonJS2({
|
|
|
70588
70589
|
exports.default = createFlowUnionType;
|
|
70589
70590
|
var _generated = require_generated2();
|
|
70590
70591
|
var _removeTypeDuplicates = require_removeTypeDuplicates();
|
|
70591
|
-
function createFlowUnionType(
|
|
70592
|
-
const flattened = (0, _removeTypeDuplicates.default)(
|
|
70592
|
+
function createFlowUnionType(types5) {
|
|
70593
|
+
const flattened = (0, _removeTypeDuplicates.default)(types5);
|
|
70593
70594
|
if (flattened.length === 1) {
|
|
70594
70595
|
return flattened[0];
|
|
70595
70596
|
} else {
|
|
@@ -70614,12 +70615,12 @@ var require_removeTypeDuplicates2 = __commonJS2({
|
|
|
70614
70615
|
const generics = /* @__PURE__ */ new Map();
|
|
70615
70616
|
const bases = /* @__PURE__ */ new Map();
|
|
70616
70617
|
const typeGroups = /* @__PURE__ */ new Set();
|
|
70617
|
-
const
|
|
70618
|
+
const types5 = [];
|
|
70618
70619
|
for (let i2 = 0; i2 < nodes.length; i2++) {
|
|
70619
70620
|
const node = nodes[i2];
|
|
70620
70621
|
if (!node)
|
|
70621
70622
|
continue;
|
|
70622
|
-
if (
|
|
70623
|
+
if (types5.indexOf(node) >= 0) {
|
|
70623
70624
|
continue;
|
|
70624
70625
|
}
|
|
70625
70626
|
if ((0, _generated.isTSAnyKeyword)(node)) {
|
|
@@ -70653,15 +70654,15 @@ var require_removeTypeDuplicates2 = __commonJS2({
|
|
|
70653
70654
|
}
|
|
70654
70655
|
continue;
|
|
70655
70656
|
}
|
|
70656
|
-
|
|
70657
|
+
types5.push(node);
|
|
70657
70658
|
}
|
|
70658
70659
|
for (const [, baseType] of bases) {
|
|
70659
|
-
|
|
70660
|
+
types5.push(baseType);
|
|
70660
70661
|
}
|
|
70661
70662
|
for (const [, genericName] of generics) {
|
|
70662
|
-
|
|
70663
|
+
types5.push(genericName);
|
|
70663
70664
|
}
|
|
70664
|
-
return
|
|
70665
|
+
return types5;
|
|
70665
70666
|
}
|
|
70666
70667
|
}
|
|
70667
70668
|
});
|
|
@@ -70676,10 +70677,10 @@ var require_createTSUnionType = __commonJS2({
|
|
|
70676
70677
|
var _removeTypeDuplicates = require_removeTypeDuplicates2();
|
|
70677
70678
|
var _index = require_generated();
|
|
70678
70679
|
function createTSUnionType(typeAnnotations) {
|
|
70679
|
-
const
|
|
70680
|
+
const types5 = typeAnnotations.map((type) => {
|
|
70680
70681
|
return (0, _index.isTSTypeAnnotation)(type) ? type.typeAnnotation : type;
|
|
70681
70682
|
});
|
|
70682
|
-
const flattened = (0, _removeTypeDuplicates.default)(
|
|
70683
|
+
const flattened = (0, _removeTypeDuplicates.default)(types5);
|
|
70683
70684
|
if (flattened.length === 1) {
|
|
70684
70685
|
return flattened[0];
|
|
70685
70686
|
} else {
|
|
@@ -74362,7 +74363,7 @@ var printDocASTReducer = {
|
|
|
74362
74363
|
leave: ({ name, interfaces, directives, fields }) => join(["interface", name, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
|
|
74363
74364
|
},
|
|
74364
74365
|
UnionTypeDefinition: {
|
|
74365
|
-
leave: ({ name, directives, types:
|
|
74366
|
+
leave: ({ name, directives, types: types5 }) => join(["union", name, join(directives, " "), wrap("= ", join(types5, " | "))], " ")
|
|
74366
74367
|
},
|
|
74367
74368
|
EnumTypeDefinition: {
|
|
74368
74369
|
leave: ({ name, directives, values }) => join(["enum", name, join(directives, " "), block(values)], " ")
|
|
@@ -74389,7 +74390,7 @@ var printDocASTReducer = {
|
|
|
74389
74390
|
leave: ({ name, interfaces, directives, fields }) => join(["extend interface", name, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
|
|
74390
74391
|
},
|
|
74391
74392
|
UnionTypeExtension: {
|
|
74392
|
-
leave: ({ name, directives, types:
|
|
74393
|
+
leave: ({ name, directives, types: types5 }) => join(["extend union", name, join(directives, " "), wrap("= ", join(types5, " | "))], " ")
|
|
74393
74394
|
},
|
|
74394
74395
|
EnumTypeExtension: {
|
|
74395
74396
|
leave: ({ name, directives, values }) => join(["extend enum", name, join(directives, " "), block(values)], " ")
|
|
@@ -74559,45 +74560,6 @@ function deepMerge(...objects) {
|
|
|
74559
74560
|
}
|
|
74560
74561
|
return mergedObj;
|
|
74561
74562
|
}
|
|
74562
|
-
async function marshalSelection({
|
|
74563
|
-
selection,
|
|
74564
|
-
data
|
|
74565
|
-
}) {
|
|
74566
|
-
const config = getCurrentConfig();
|
|
74567
|
-
if (data === null || typeof data === "undefined") {
|
|
74568
|
-
return data;
|
|
74569
|
-
}
|
|
74570
|
-
if (Array.isArray(data)) {
|
|
74571
|
-
return await Promise.all(data.map((val) => marshalSelection({ selection, data: val })));
|
|
74572
|
-
}
|
|
74573
|
-
const targetSelection = getFieldsForType(selection, data["__typename"], false);
|
|
74574
|
-
return Object.fromEntries(
|
|
74575
|
-
await Promise.all(
|
|
74576
|
-
Object.entries(data).map(async ([fieldName, value]) => {
|
|
74577
|
-
const { type, selection: selection2 } = targetSelection[fieldName];
|
|
74578
|
-
if (!type) {
|
|
74579
|
-
return [fieldName, value];
|
|
74580
|
-
}
|
|
74581
|
-
if (selection2) {
|
|
74582
|
-
return [fieldName, await marshalSelection({ selection: selection2, data: value })];
|
|
74583
|
-
}
|
|
74584
|
-
if (config.scalars?.[type]) {
|
|
74585
|
-
const marshalFn = config.scalars[type].marshal;
|
|
74586
|
-
if (!marshalFn) {
|
|
74587
|
-
throw new Error(
|
|
74588
|
-
`scalar type ${type} is missing a \`marshal\` function. see https://github.com/AlecAivazis/houdini#%EF%B8%8Fcustom-scalars`
|
|
74589
|
-
);
|
|
74590
|
-
}
|
|
74591
|
-
if (Array.isArray(value)) {
|
|
74592
|
-
return [fieldName, value.map(marshalFn)];
|
|
74593
|
-
}
|
|
74594
|
-
return [fieldName, marshalFn(value)];
|
|
74595
|
-
}
|
|
74596
|
-
return [fieldName, value];
|
|
74597
|
-
})
|
|
74598
|
-
)
|
|
74599
|
-
);
|
|
74600
|
-
}
|
|
74601
74563
|
var ArtifactKind = {
|
|
74602
74564
|
Query: "HoudiniQuery",
|
|
74603
74565
|
Subscription: "HoudiniSubscription",
|
|
@@ -74608,11 +74570,6 @@ var CompiledFragmentKind = ArtifactKind.Fragment;
|
|
|
74608
74570
|
var CompiledMutationKind = ArtifactKind.Mutation;
|
|
74609
74571
|
var CompiledQueryKind = ArtifactKind.Query;
|
|
74610
74572
|
var CompiledSubscriptionKind = ArtifactKind.Subscription;
|
|
74611
|
-
var DataSource = {
|
|
74612
|
-
Cache: "cache",
|
|
74613
|
-
Network: "network",
|
|
74614
|
-
Ssr: "ssr"
|
|
74615
|
-
};
|
|
74616
74573
|
var fragmentKey = " $fragments";
|
|
74617
74574
|
var PendingValue = Symbol("houdini_loading");
|
|
74618
74575
|
var computeKey = ({ field, args }) => {
|
|
@@ -77803,194 +77760,6 @@ function defaultComponentField({
|
|
|
77803
77760
|
}
|
|
77804
77761
|
var cache_default = new Cache();
|
|
77805
77762
|
var serverSide = typeof globalThis.window === "undefined";
|
|
77806
|
-
var documentPlugin = (kind, source) => {
|
|
77807
|
-
return () => {
|
|
77808
|
-
const sourceHandlers = source();
|
|
77809
|
-
const enterWrapper = (handler) => {
|
|
77810
|
-
return !handler ? void 0 : (ctx, handlers) => {
|
|
77811
|
-
if (ctx.artifact.kind !== kind) {
|
|
77812
|
-
return handlers.next(ctx);
|
|
77813
|
-
}
|
|
77814
|
-
return handler(ctx, handlers);
|
|
77815
|
-
};
|
|
77816
|
-
};
|
|
77817
|
-
const exitWrapper = (handler) => {
|
|
77818
|
-
return !handler ? void 0 : (ctx, handlers) => {
|
|
77819
|
-
if (ctx.artifact.kind !== kind) {
|
|
77820
|
-
return handlers.resolve(ctx);
|
|
77821
|
-
}
|
|
77822
|
-
return handler(ctx, handlers);
|
|
77823
|
-
};
|
|
77824
|
-
};
|
|
77825
|
-
return {
|
|
77826
|
-
start: enterWrapper(sourceHandlers.start),
|
|
77827
|
-
network: enterWrapper(sourceHandlers.network),
|
|
77828
|
-
afterNetwork: exitWrapper(sourceHandlers.afterNetwork),
|
|
77829
|
-
end: exitWrapper(sourceHandlers.end),
|
|
77830
|
-
catch: sourceHandlers.catch ? (ctx, handlers) => sourceHandlers.catch(ctx, handlers) : void 0,
|
|
77831
|
-
cleanup: (...args) => sourceHandlers.cleanup?.(...args)
|
|
77832
|
-
};
|
|
77833
|
-
};
|
|
77834
|
-
};
|
|
77835
|
-
var query = documentPlugin(ArtifactKind.Query, function() {
|
|
77836
|
-
let subscriptionSpec = null;
|
|
77837
|
-
let lastVariables = null;
|
|
77838
|
-
return {
|
|
77839
|
-
start(ctx, { next }) {
|
|
77840
|
-
const runtimeScalarPayload = {
|
|
77841
|
-
session: ctx.session
|
|
77842
|
-
};
|
|
77843
|
-
ctx.variables = {
|
|
77844
|
-
...lastVariables,
|
|
77845
|
-
...Object.fromEntries(
|
|
77846
|
-
Object.entries(ctx.artifact.input?.runtimeScalars ?? {}).map(
|
|
77847
|
-
([field, type]) => {
|
|
77848
|
-
const runtimeScalar = ctx.config.features?.runtimeScalars?.[type];
|
|
77849
|
-
if (!runtimeScalar) {
|
|
77850
|
-
return [field, type];
|
|
77851
|
-
}
|
|
77852
|
-
return [field, runtimeScalar.resolve(runtimeScalarPayload)];
|
|
77853
|
-
}
|
|
77854
|
-
)
|
|
77855
|
-
),
|
|
77856
|
-
...ctx.variables
|
|
77857
|
-
};
|
|
77858
|
-
next(ctx);
|
|
77859
|
-
},
|
|
77860
|
-
end(ctx, { resolve: resolve2, marshalVariables: marshalVariables2, variablesChanged: variablesChanged2 }) {
|
|
77861
|
-
if (variablesChanged2(ctx) && !ctx.cacheParams?.disableSubscriptions) {
|
|
77862
|
-
if (subscriptionSpec) {
|
|
77863
|
-
cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
|
|
77864
|
-
}
|
|
77865
|
-
lastVariables = { ...marshalVariables2(ctx) };
|
|
77866
|
-
const variables = lastVariables;
|
|
77867
|
-
subscriptionSpec = {
|
|
77868
|
-
rootType: ctx.artifact.rootType,
|
|
77869
|
-
selection: ctx.artifact.selection,
|
|
77870
|
-
variables: () => variables,
|
|
77871
|
-
set: (newValue) => {
|
|
77872
|
-
resolve2(ctx, {
|
|
77873
|
-
data: newValue,
|
|
77874
|
-
errors: null,
|
|
77875
|
-
fetching: false,
|
|
77876
|
-
partial: false,
|
|
77877
|
-
stale: false,
|
|
77878
|
-
source: DataSource.Cache,
|
|
77879
|
-
variables: ctx.variables ?? {}
|
|
77880
|
-
});
|
|
77881
|
-
}
|
|
77882
|
-
};
|
|
77883
|
-
cache_default.subscribe(subscriptionSpec, lastVariables);
|
|
77884
|
-
}
|
|
77885
|
-
resolve2(ctx);
|
|
77886
|
-
},
|
|
77887
|
-
cleanup() {
|
|
77888
|
-
if (subscriptionSpec) {
|
|
77889
|
-
cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.());
|
|
77890
|
-
lastVariables = null;
|
|
77891
|
-
}
|
|
77892
|
-
}
|
|
77893
|
-
};
|
|
77894
|
-
});
|
|
77895
|
-
var fragment = documentPlugin(ArtifactKind.Fragment, function() {
|
|
77896
|
-
let subscriptionSpec = null;
|
|
77897
|
-
let lastReference = null;
|
|
77898
|
-
return {
|
|
77899
|
-
start(ctx, { next, resolve: resolve2, variablesChanged: variablesChanged2, marshalVariables: marshalVariables2 }) {
|
|
77900
|
-
if (!ctx.stuff.parentID) {
|
|
77901
|
-
return next(ctx);
|
|
77902
|
-
}
|
|
77903
|
-
const currentReference = {
|
|
77904
|
-
parent: ctx.stuff.parentID,
|
|
77905
|
-
variables: marshalVariables2(ctx)
|
|
77906
|
-
};
|
|
77907
|
-
if (!ctx.cacheParams?.disableSubscriptions && (!deepEquals(lastReference, currentReference) || variablesChanged2(ctx))) {
|
|
77908
|
-
if (subscriptionSpec) {
|
|
77909
|
-
cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
|
|
77910
|
-
}
|
|
77911
|
-
const variables = marshalVariables2(ctx);
|
|
77912
|
-
subscriptionSpec = {
|
|
77913
|
-
rootType: ctx.artifact.rootType,
|
|
77914
|
-
selection: ctx.artifact.selection,
|
|
77915
|
-
variables: () => variables,
|
|
77916
|
-
parentID: ctx.stuff.parentID,
|
|
77917
|
-
set: (newValue) => {
|
|
77918
|
-
resolve2(ctx, {
|
|
77919
|
-
data: newValue,
|
|
77920
|
-
errors: null,
|
|
77921
|
-
fetching: false,
|
|
77922
|
-
partial: false,
|
|
77923
|
-
stale: false,
|
|
77924
|
-
source: DataSource.Cache,
|
|
77925
|
-
variables
|
|
77926
|
-
});
|
|
77927
|
-
}
|
|
77928
|
-
};
|
|
77929
|
-
cache_default.subscribe(subscriptionSpec, variables);
|
|
77930
|
-
lastReference = currentReference;
|
|
77931
|
-
}
|
|
77932
|
-
next(ctx);
|
|
77933
|
-
},
|
|
77934
|
-
cleanup() {
|
|
77935
|
-
if (subscriptionSpec) {
|
|
77936
|
-
cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.());
|
|
77937
|
-
}
|
|
77938
|
-
}
|
|
77939
|
-
};
|
|
77940
|
-
});
|
|
77941
|
-
var mutation = documentPlugin(ArtifactKind.Mutation, () => {
|
|
77942
|
-
return {
|
|
77943
|
-
async start(ctx, { next, marshalVariables: marshalVariables2 }) {
|
|
77944
|
-
const layerOptimistic = cache_default._internal_unstable.storage.createLayer(true);
|
|
77945
|
-
const optimisticResponse = ctx.stuff.optimisticResponse;
|
|
77946
|
-
let toNotify = [];
|
|
77947
|
-
if (optimisticResponse) {
|
|
77948
|
-
toNotify = cache_default.write({
|
|
77949
|
-
selection: ctx.artifact.selection,
|
|
77950
|
-
data: await marshalSelection({
|
|
77951
|
-
selection: ctx.artifact.selection,
|
|
77952
|
-
data: optimisticResponse
|
|
77953
|
-
}),
|
|
77954
|
-
variables: marshalVariables2(ctx),
|
|
77955
|
-
layer: layerOptimistic.id
|
|
77956
|
-
});
|
|
77957
|
-
}
|
|
77958
|
-
ctx.cacheParams = {
|
|
77959
|
-
...ctx.cacheParams,
|
|
77960
|
-
layer: layerOptimistic,
|
|
77961
|
-
notifySubscribers: toNotify,
|
|
77962
|
-
forceNotify: true
|
|
77963
|
-
};
|
|
77964
|
-
next(ctx);
|
|
77965
|
-
},
|
|
77966
|
-
afterNetwork(ctx, { resolve: resolve2 }) {
|
|
77967
|
-
if (ctx.cacheParams?.layer) {
|
|
77968
|
-
cache_default.clearLayer(ctx.cacheParams.layer.id);
|
|
77969
|
-
}
|
|
77970
|
-
resolve2(ctx);
|
|
77971
|
-
},
|
|
77972
|
-
end(ctx, { resolve: resolve2, value }) {
|
|
77973
|
-
const hasErrors = value.errors && value.errors.length > 0;
|
|
77974
|
-
if (hasErrors) {
|
|
77975
|
-
if (ctx.cacheParams?.layer) {
|
|
77976
|
-
cache_default.clearLayer(ctx.cacheParams.layer.id);
|
|
77977
|
-
}
|
|
77978
|
-
}
|
|
77979
|
-
if (ctx.cacheParams?.layer) {
|
|
77980
|
-
cache_default._internal_unstable.storage.resolveLayer(ctx.cacheParams.layer.id);
|
|
77981
|
-
}
|
|
77982
|
-
resolve2(ctx);
|
|
77983
|
-
},
|
|
77984
|
-
catch(ctx, { error }) {
|
|
77985
|
-
if (ctx.cacheParams?.layer) {
|
|
77986
|
-
const { layer } = ctx.cacheParams;
|
|
77987
|
-
cache_default.clearLayer(layer.id);
|
|
77988
|
-
cache_default._internal_unstable.storage.resolveLayer(layer.id);
|
|
77989
|
-
}
|
|
77990
|
-
throw error;
|
|
77991
|
-
}
|
|
77992
|
-
};
|
|
77993
|
-
});
|
|
77994
77763
|
var currentDir = dirname(fileURLToPath(import.meta.url));
|
|
77995
77764
|
var DEFAULT_CONFIG_PATH = join2(process.cwd(), "houdini.config.js");
|
|
77996
77765
|
var emptySchema = graphql2.buildSchema("type Query { hello: String }");
|
|
@@ -78028,6 +77797,39 @@ function processComponentFieldDirective(directive) {
|
|
|
78028
77797
|
export: exportValue
|
|
78029
77798
|
};
|
|
78030
77799
|
}
|
|
77800
|
+
function unwrapType(config, type, wrappers = [], convertRuntimeScalars) {
|
|
77801
|
+
if (type.kind === "NonNullType") {
|
|
77802
|
+
return unwrapType(config, type.type, [TypeWrapper.NonNull, ...wrappers]);
|
|
77803
|
+
}
|
|
77804
|
+
if (type instanceof graphql3.GraphQLNonNull) {
|
|
77805
|
+
return unwrapType(config, type.ofType, [TypeWrapper.NonNull, ...wrappers]);
|
|
77806
|
+
}
|
|
77807
|
+
if (wrappers[0] !== TypeWrapper.NonNull) {
|
|
77808
|
+
wrappers.unshift(TypeWrapper.Nullable);
|
|
77809
|
+
}
|
|
77810
|
+
if (type.kind === "ListType") {
|
|
77811
|
+
return unwrapType(config, type.type, [TypeWrapper.List, ...wrappers]);
|
|
77812
|
+
}
|
|
77813
|
+
if (type instanceof graphql3.GraphQLList) {
|
|
77814
|
+
return unwrapType(config, type.ofType, [TypeWrapper.List, ...wrappers]);
|
|
77815
|
+
}
|
|
77816
|
+
if (convertRuntimeScalars && config.configFile.features?.runtimeScalars?.[type.name.value]) {
|
|
77817
|
+
type = config.schema.getType(
|
|
77818
|
+
config.configFile.features?.runtimeScalars?.[type.name.value].type
|
|
77819
|
+
);
|
|
77820
|
+
}
|
|
77821
|
+
const namedType = config.schema.getType(type.name.value || type.name);
|
|
77822
|
+
if (!namedType) {
|
|
77823
|
+
throw new Error("Unknown type: " + type.name.value || type.name);
|
|
77824
|
+
}
|
|
77825
|
+
return { type: namedType, wrappers };
|
|
77826
|
+
}
|
|
77827
|
+
var TypeWrapper = /* @__PURE__ */ ((TypeWrapper2) => {
|
|
77828
|
+
TypeWrapper2["Nullable"] = "Nullable";
|
|
77829
|
+
TypeWrapper2["List"] = "List";
|
|
77830
|
+
TypeWrapper2["NonNull"] = "NonNull";
|
|
77831
|
+
return TypeWrapper2;
|
|
77832
|
+
})(TypeWrapper || {});
|
|
78031
77833
|
var import_parser = __toESM2(require_lib3(), 1);
|
|
78032
77834
|
var import_recast = __toESM2(require_main2(), 1);
|
|
78033
77835
|
var import_deepmerge = __toESM2(require_cjs(), 1);
|
|
@@ -78051,7 +77853,12 @@ function deepMerge2(filepath, ...targets) {
|
|
|
78051
77853
|
}
|
|
78052
77854
|
function parseJS(str, config) {
|
|
78053
77855
|
const defaultConfig = {
|
|
78054
|
-
plugins: [
|
|
77856
|
+
plugins: [
|
|
77857
|
+
"typescript",
|
|
77858
|
+
"importAssertions",
|
|
77859
|
+
"decorators-legacy",
|
|
77860
|
+
"explicitResourceManagement"
|
|
77861
|
+
],
|
|
78055
77862
|
sourceType: "module"
|
|
78056
77863
|
};
|
|
78057
77864
|
return (0, import_parser.parse)(str || "", config ? deepMerge2("", defaultConfig, config) : defaultConfig).program;
|
|
@@ -78197,6 +78004,133 @@ function get_route_segments(route) {
|
|
|
78197
78004
|
function escape2(str) {
|
|
78198
78005
|
return str.normalize().replace(/[[\]]/g, "\\$&").replace(/%/g, "%25").replace(/\//g, "%2[Ff]").replace(/\?/g, "%3[Ff]").replace(/#/g, "%23").replace(/[.*+?^${}()|\\]/g, "\\$&");
|
|
78199
78006
|
}
|
|
78007
|
+
var recast2 = __toESM2(require_main2(), 1);
|
|
78008
|
+
var AST2 = recast2.types.builders;
|
|
78009
|
+
function unwrappedTsTypeReference(config, filepath, missingScalars, {
|
|
78010
|
+
type,
|
|
78011
|
+
wrappers
|
|
78012
|
+
}, body) {
|
|
78013
|
+
let result;
|
|
78014
|
+
if (graphql4.isScalarType(type)) {
|
|
78015
|
+
result = scalarPropertyValue(config, filepath, missingScalars, type, body, null);
|
|
78016
|
+
} else if (graphql4.isEnumType(type)) {
|
|
78017
|
+
result = enumReference(config, body, type.name);
|
|
78018
|
+
} else {
|
|
78019
|
+
result = AST2.tsTypeReference(AST2.identifier(type.name));
|
|
78020
|
+
}
|
|
78021
|
+
for (const toWrap of wrappers) {
|
|
78022
|
+
if (toWrap === "NonNull") {
|
|
78023
|
+
continue;
|
|
78024
|
+
} else if (toWrap === "Nullable") {
|
|
78025
|
+
result = nullableField(result, true);
|
|
78026
|
+
} else if (toWrap === "List") {
|
|
78027
|
+
result = AST2.tsArrayType(AST2.tsParenthesizedType(result));
|
|
78028
|
+
}
|
|
78029
|
+
}
|
|
78030
|
+
return result;
|
|
78031
|
+
}
|
|
78032
|
+
function enumReference(config, body, name) {
|
|
78033
|
+
ensureImports({
|
|
78034
|
+
config,
|
|
78035
|
+
body,
|
|
78036
|
+
import: ["ValueOf"],
|
|
78037
|
+
importKind: "type",
|
|
78038
|
+
sourceModule: "$houdini/runtime/lib/types"
|
|
78039
|
+
});
|
|
78040
|
+
return AST2.tsTypeReference(
|
|
78041
|
+
AST2.identifier("ValueOf"),
|
|
78042
|
+
AST2.tsTypeParameterInstantiation([AST2.tsTypeQuery(AST2.identifier(name))])
|
|
78043
|
+
);
|
|
78044
|
+
}
|
|
78045
|
+
function nullableField(inner, input = false) {
|
|
78046
|
+
const members = [inner, AST2.tsNullKeyword()];
|
|
78047
|
+
if (input) {
|
|
78048
|
+
members.push(AST2.tsUndefinedKeyword());
|
|
78049
|
+
}
|
|
78050
|
+
return AST2.tsUnionType(members);
|
|
78051
|
+
}
|
|
78052
|
+
function scalarPropertyValue(config, filepath, missingScalars, target, body, field) {
|
|
78053
|
+
if (config.configFile.features?.componentFields && target.name === config.componentScalar) {
|
|
78054
|
+
if (!field) {
|
|
78055
|
+
return AST2.tsNeverKeyword();
|
|
78056
|
+
}
|
|
78057
|
+
const component = config.componentFields[field.parent][field.field];
|
|
78058
|
+
const sourcePathRelative = path_exports.relative(
|
|
78059
|
+
path_exports.join(config.projectRoot, "src"),
|
|
78060
|
+
component.filepath
|
|
78061
|
+
);
|
|
78062
|
+
let sourcePathParsed = path_exports.parse(sourcePathRelative);
|
|
78063
|
+
let sourcePath = path_exports.join(sourcePathParsed.dir, sourcePathParsed.name);
|
|
78064
|
+
const localImport = ensureImports({
|
|
78065
|
+
config,
|
|
78066
|
+
body,
|
|
78067
|
+
import: "__component__" + component.fragment,
|
|
78068
|
+
sourceModule: path_exports.join(
|
|
78069
|
+
path_exports.relative(path_exports.dirname(filepath), config.projectRoot),
|
|
78070
|
+
"src",
|
|
78071
|
+
sourcePath
|
|
78072
|
+
)
|
|
78073
|
+
}) ?? "__component__" + component.fragment;
|
|
78074
|
+
const parameters = AST2.tsTypeReference(AST2.identifier("Parameters"));
|
|
78075
|
+
parameters.typeParameters = AST2.tsTypeParameterInstantiation([
|
|
78076
|
+
AST2.tsTypeQuery(AST2.identifier(localImport))
|
|
78077
|
+
]);
|
|
78078
|
+
const indexed = AST2.tsIndexedAccessType(
|
|
78079
|
+
parameters,
|
|
78080
|
+
AST2.tsLiteralType(AST2.numericLiteral(0))
|
|
78081
|
+
);
|
|
78082
|
+
const omit = AST2.tsTypeReference(AST2.identifier("Omit"));
|
|
78083
|
+
omit.typeParameters = AST2.tsTypeParameterInstantiation([
|
|
78084
|
+
indexed,
|
|
78085
|
+
AST2.tsLiteralType(AST2.stringLiteral(component.prop))
|
|
78086
|
+
]);
|
|
78087
|
+
const arg = AST2.identifier("props");
|
|
78088
|
+
arg.typeAnnotation = AST2.tsTypeAnnotation(omit);
|
|
78089
|
+
const returnType = AST2.tsTypeReference(AST2.identifier("ReturnType"));
|
|
78090
|
+
returnType.typeParameters = AST2.tsTypeParameterInstantiation([
|
|
78091
|
+
AST2.tsTypeQuery(AST2.identifier(localImport))
|
|
78092
|
+
]);
|
|
78093
|
+
const fnType = AST2.tsFunctionType([arg]);
|
|
78094
|
+
fnType.typeAnnotation = AST2.tsTypeAnnotation(returnType);
|
|
78095
|
+
return fnType;
|
|
78096
|
+
}
|
|
78097
|
+
switch (target.name) {
|
|
78098
|
+
case "String": {
|
|
78099
|
+
return AST2.tsStringKeyword();
|
|
78100
|
+
}
|
|
78101
|
+
case "Int": {
|
|
78102
|
+
return AST2.tsNumberKeyword();
|
|
78103
|
+
}
|
|
78104
|
+
case "Float": {
|
|
78105
|
+
return AST2.tsNumberKeyword();
|
|
78106
|
+
}
|
|
78107
|
+
case "Boolean": {
|
|
78108
|
+
return AST2.tsBooleanKeyword();
|
|
78109
|
+
}
|
|
78110
|
+
case "ID": {
|
|
78111
|
+
return AST2.tsStringKeyword();
|
|
78112
|
+
}
|
|
78113
|
+
default: {
|
|
78114
|
+
if (graphql4.isNonNullType(target) && "ofType" in target) {
|
|
78115
|
+
return scalarPropertyValue(
|
|
78116
|
+
config,
|
|
78117
|
+
filepath,
|
|
78118
|
+
missingScalars,
|
|
78119
|
+
target.ofType,
|
|
78120
|
+
body,
|
|
78121
|
+
field
|
|
78122
|
+
);
|
|
78123
|
+
}
|
|
78124
|
+
if (config.scalars?.[target.name]) {
|
|
78125
|
+
return AST2.tsTypeReference(AST2.identifier(config.scalars?.[target.name].type));
|
|
78126
|
+
}
|
|
78127
|
+
if (target.name !== config.componentScalar) {
|
|
78128
|
+
missingScalars.add(target.name);
|
|
78129
|
+
}
|
|
78130
|
+
return AST2.tsAnyKeyword();
|
|
78131
|
+
}
|
|
78132
|
+
}
|
|
78133
|
+
}
|
|
78200
78134
|
var WalkerBase = class {
|
|
78201
78135
|
constructor() {
|
|
78202
78136
|
this.should_skip = false;
|
|
@@ -78357,7 +78291,7 @@ async function find_graphql(config, parsedScript, walker) {
|
|
|
78357
78291
|
} else if (!documentString) {
|
|
78358
78292
|
return;
|
|
78359
78293
|
}
|
|
78360
|
-
const parsedTag =
|
|
78294
|
+
const parsedTag = graphql5.parse(documentString);
|
|
78361
78295
|
if (walker.where && !walker.where(parsedTag, { node, parent })) {
|
|
78362
78296
|
return;
|
|
78363
78297
|
}
|
|
@@ -78489,7 +78423,7 @@ function extractAnonymousQuery(config, raw, expr, propName) {
|
|
|
78489
78423
|
};
|
|
78490
78424
|
return defs.concat([
|
|
78491
78425
|
{
|
|
78492
|
-
raw:
|
|
78426
|
+
raw: graphql5.print(parsed),
|
|
78493
78427
|
parsed
|
|
78494
78428
|
}
|
|
78495
78429
|
]);
|
|
@@ -78642,7 +78576,8 @@ async function load_manifest(args) {
|
|
|
78642
78576
|
local_yoga: false
|
|
78643
78577
|
},
|
|
78644
78578
|
queries: [],
|
|
78645
|
-
layouts: []
|
|
78579
|
+
layouts: [],
|
|
78580
|
+
variables: {}
|
|
78646
78581
|
});
|
|
78647
78582
|
if (args.includeArtifacts) {
|
|
78648
78583
|
try {
|
|
@@ -78673,6 +78608,7 @@ async function walk_routes(args) {
|
|
|
78673
78608
|
const directory_contents = await fs_exports.readdir(args.filepath, {
|
|
78674
78609
|
withFileTypes: true
|
|
78675
78610
|
});
|
|
78611
|
+
const variables = { ...args.variables };
|
|
78676
78612
|
let newLayouts = args.layouts;
|
|
78677
78613
|
let newLayoutQueries = args.queries;
|
|
78678
78614
|
let layout = null;
|
|
@@ -78696,7 +78632,8 @@ async function walk_routes(args) {
|
|
|
78696
78632
|
url: args.url,
|
|
78697
78633
|
project: args.project,
|
|
78698
78634
|
type: "layout",
|
|
78699
|
-
contents: layoutQueryContents
|
|
78635
|
+
contents: layoutQueryContents,
|
|
78636
|
+
variables
|
|
78700
78637
|
});
|
|
78701
78638
|
newLayoutQueries = [...args.queries, layoutQuery.name];
|
|
78702
78639
|
}
|
|
@@ -78709,7 +78646,8 @@ async function walk_routes(args) {
|
|
|
78709
78646
|
contents: layoutViewContents,
|
|
78710
78647
|
layouts: args.layouts,
|
|
78711
78648
|
queries: newLayoutQueries,
|
|
78712
|
-
config: args.config
|
|
78649
|
+
config: args.config,
|
|
78650
|
+
variables
|
|
78713
78651
|
});
|
|
78714
78652
|
newLayouts = [...args.layouts, page_id(layout.url)];
|
|
78715
78653
|
}
|
|
@@ -78720,7 +78658,8 @@ async function walk_routes(args) {
|
|
|
78720
78658
|
url: args.url,
|
|
78721
78659
|
project: args.project,
|
|
78722
78660
|
type: "page",
|
|
78723
|
-
contents: pageQueryContents
|
|
78661
|
+
contents: pageQueryContents,
|
|
78662
|
+
variables
|
|
78724
78663
|
});
|
|
78725
78664
|
}
|
|
78726
78665
|
if (pageViewContents) {
|
|
@@ -78732,7 +78671,8 @@ async function walk_routes(args) {
|
|
|
78732
78671
|
contents: pageViewContents,
|
|
78733
78672
|
layouts: newLayouts,
|
|
78734
78673
|
queries: pageQuery ? [...newLayoutQueries, pageQuery.name] : newLayoutQueries,
|
|
78735
|
-
config: args.config
|
|
78674
|
+
config: args.config,
|
|
78675
|
+
variables
|
|
78736
78676
|
});
|
|
78737
78677
|
}
|
|
78738
78678
|
await Promise.all(
|
|
@@ -78745,7 +78685,8 @@ async function walk_routes(args) {
|
|
|
78745
78685
|
filepath: path_exports.join(args.filepath, dir.name),
|
|
78746
78686
|
url: `${args.url}${dir.name}/`,
|
|
78747
78687
|
queries: newLayoutQueries,
|
|
78748
|
-
layouts: newLayouts
|
|
78688
|
+
layouts: newLayouts,
|
|
78689
|
+
variables
|
|
78749
78690
|
});
|
|
78750
78691
|
})
|
|
78751
78692
|
);
|
|
@@ -78767,12 +78708,18 @@ async function add_view(args) {
|
|
|
78767
78708
|
url: args.url,
|
|
78768
78709
|
layouts: args.layouts,
|
|
78769
78710
|
path: path_exports.relative(args.config.projectRoot, args.path),
|
|
78770
|
-
query_options: args.queries
|
|
78711
|
+
query_options: args.queries,
|
|
78712
|
+
params: Object.fromEntries(
|
|
78713
|
+
parse_page_pattern(args.url).params.map((param) => [
|
|
78714
|
+
param.name,
|
|
78715
|
+
args.variables[param.name] ?? null
|
|
78716
|
+
])
|
|
78717
|
+
)
|
|
78771
78718
|
};
|
|
78772
78719
|
return target[id];
|
|
78773
78720
|
}
|
|
78774
78721
|
async function add_query(args) {
|
|
78775
|
-
const parsed =
|
|
78722
|
+
const parsed = graphql6.parse(args.contents);
|
|
78776
78723
|
const query2 = parsed.definitions.find(
|
|
78777
78724
|
(def) => def.kind === "OperationDefinition" && def.operation === "query"
|
|
78778
78725
|
);
|
|
@@ -78780,20 +78727,30 @@ async function add_query(args) {
|
|
|
78780
78727
|
throw new Error("No query found");
|
|
78781
78728
|
}
|
|
78782
78729
|
let loading = false;
|
|
78783
|
-
await
|
|
78730
|
+
await graphql6.visit(parsed, {
|
|
78784
78731
|
Directive(node) {
|
|
78785
78732
|
if (node.name.value === args.config.loadingDirective) {
|
|
78786
78733
|
loading = true;
|
|
78787
78734
|
}
|
|
78788
78735
|
}
|
|
78789
78736
|
});
|
|
78737
|
+
const queryVariables = Object.fromEntries(
|
|
78738
|
+
query2.variableDefinitions?.map((variable) => {
|
|
78739
|
+
const { type, wrappers } = unwrapType(args.config, variable.type, [], true);
|
|
78740
|
+
return [
|
|
78741
|
+
variable.variable.name.value,
|
|
78742
|
+
{ wrappers, type: type.name }
|
|
78743
|
+
];
|
|
78744
|
+
}) ?? []
|
|
78745
|
+
);
|
|
78746
|
+
Object.assign(args.variables, queryVariables);
|
|
78790
78747
|
const target = args.type === "page" ? args.project.page_queries : args.project.layout_queries;
|
|
78791
78748
|
target[page_id(args.url)] = {
|
|
78792
78749
|
path: path_exports.relative(args.config.routesDir, args.path),
|
|
78793
78750
|
name: query2.name.value,
|
|
78794
78751
|
url: args.url,
|
|
78795
78752
|
loading,
|
|
78796
|
-
variables:
|
|
78753
|
+
variables: queryVariables
|
|
78797
78754
|
};
|
|
78798
78755
|
return target[page_id(args.url)];
|
|
78799
78756
|
}
|
|
@@ -78847,7 +78804,18 @@ async function extractQueries(source) {
|
|
|
78847
78804
|
} else {
|
|
78848
78805
|
return [];
|
|
78849
78806
|
}
|
|
78850
|
-
return props.
|
|
78807
|
+
return props.reduce((queries, query2) => {
|
|
78808
|
+
if (query2 === "children") {
|
|
78809
|
+
return queries;
|
|
78810
|
+
}
|
|
78811
|
+
if (query2.endsWith("$handle")) {
|
|
78812
|
+
query2 = query2.substring(0, query2.length - "$handle".length);
|
|
78813
|
+
}
|
|
78814
|
+
if (queries.includes(query2)) {
|
|
78815
|
+
return queries;
|
|
78816
|
+
}
|
|
78817
|
+
return queries.concat([query2]);
|
|
78818
|
+
}, []);
|
|
78851
78819
|
}
|
|
78852
78820
|
function isSecondaryBuild() {
|
|
78853
78821
|
return process.env.HOUDINI_SECONDARY_BUILD && process.env.HOUDINI_SECONDARY_BUILD !== "false";
|
|
@@ -78858,7 +78826,7 @@ import path2 from "node:path";
|
|
|
78858
78826
|
import { loadEnv } from "vite";
|
|
78859
78827
|
|
|
78860
78828
|
// src/plugin/codegen/index.ts
|
|
78861
|
-
import * as
|
|
78829
|
+
import * as graphql7 from "graphql";
|
|
78862
78830
|
|
|
78863
78831
|
// src/plugin/codegen/entries/documentWrappers.ts
|
|
78864
78832
|
function generate_routing_document_wrappers({
|
|
@@ -78910,21 +78878,23 @@ async function generate_query_wrapper(args) {
|
|
|
78910
78878
|
const relative_path = path_exports.relative(path_exports.dirname(unit_path), page_path);
|
|
78911
78879
|
const component_name = "Component_" + page.id;
|
|
78912
78880
|
let source = [
|
|
78913
|
-
"import { useQueryResult } from '$houdini/plugins/houdini-react/runtime/routing'",
|
|
78881
|
+
"import { useQueryResult, PageContextProvider } from '$houdini/plugins/houdini-react/runtime/routing'",
|
|
78914
78882
|
`import ${component_name} from "${relative_path}"`
|
|
78915
78883
|
];
|
|
78916
78884
|
source.push(`export default ({ children }) => {
|
|
78917
78885
|
${""}
|
|
78918
|
-
${page.queries.map((
|
|
78886
|
+
${page.queries.map((query) => `const [${query}$data, ${query}$handle] = useQueryResult("${query}")`).join("\n")}
|
|
78919
78887
|
|
|
78920
78888
|
return (
|
|
78921
|
-
|
|
78922
|
-
|
|
78923
|
-
|
|
78889
|
+
<PageContextProvider keys={${JSON.stringify(Object.keys(page.params ?? {}))}}>
|
|
78890
|
+
<${component_name}
|
|
78891
|
+
${page.queries.map(
|
|
78892
|
+
(query) => [`${query}={${query}$data}`, `${query}$handle={${query}$handle}`].join(" ")
|
|
78924
78893
|
).join("\n")}
|
|
78925
|
-
|
|
78926
|
-
|
|
78927
|
-
|
|
78894
|
+
>
|
|
78895
|
+
{children}
|
|
78896
|
+
</${component_name}>
|
|
78897
|
+
</PageContextProvider>
|
|
78928
78898
|
)
|
|
78929
78899
|
}`);
|
|
78930
78900
|
const formatted = (await printJS(parseJS(source.join("\n"), { plugins: ["jsx"] }))).code;
|
|
@@ -78997,7 +78967,7 @@ async function generate_fallbacks({
|
|
|
78997
78967
|
project
|
|
78998
78968
|
}) {
|
|
78999
78969
|
const query_map = Object.values(project.layout_queries).concat(Object.values(project.page_queries)).reduce(
|
|
79000
|
-
(prev,
|
|
78970
|
+
(prev, query) => ({ ...prev, [query.name]: query }),
|
|
79001
78971
|
{}
|
|
79002
78972
|
);
|
|
79003
78973
|
for (const [id, page] of Object.entries(project.layouts).concat(
|
|
@@ -79006,11 +78976,11 @@ async function generate_fallbacks({
|
|
|
79006
78976
|
const layout = conventions_exports.is_layout(page.path);
|
|
79007
78977
|
const which = layout ? "layout" : "page";
|
|
79008
78978
|
const { required_queries, loading_queries } = page.queries.reduce(
|
|
79009
|
-
(prev,
|
|
79010
|
-
if (query_map[
|
|
79011
|
-
prev.loading_queries.push(
|
|
78979
|
+
(prev, query) => {
|
|
78980
|
+
if (query_map[query].loading) {
|
|
78981
|
+
prev.loading_queries.push(query);
|
|
79012
78982
|
} else {
|
|
79013
|
-
prev.required_queries.push(
|
|
78983
|
+
prev.required_queries.push(query);
|
|
79014
78984
|
}
|
|
79015
78985
|
return prev;
|
|
79016
78986
|
},
|
|
@@ -79039,11 +79009,11 @@ async function generate_fallbacks({
|
|
|
79039
79009
|
const { artifact_cache } = useRouterContext()
|
|
79040
79010
|
|
|
79041
79011
|
${""}
|
|
79042
|
-
${page.queries.map((
|
|
79012
|
+
${page.queries.map((query) => `const ${query}_artifact = artifact_cache.get("${query}")`).join("\n")}
|
|
79043
79013
|
|
|
79044
79014
|
${""}
|
|
79045
79015
|
${required_queries.map(
|
|
79046
|
-
(
|
|
79016
|
+
(query) => `const [${query}_data, ${query}_handle] = useQueryResult("${query}")`
|
|
79047
79017
|
).join("\n")}
|
|
79048
79018
|
|
|
79049
79019
|
return (
|
|
@@ -79360,6 +79330,9 @@ export function createServerAdapter(options) {
|
|
|
79360
79330
|
]);
|
|
79361
79331
|
}
|
|
79362
79332
|
|
|
79333
|
+
// src/plugin/codegen/typeRoot.ts
|
|
79334
|
+
var recast3 = __toESM(require_main4());
|
|
79335
|
+
|
|
79363
79336
|
// src/plugin/dedent.ts
|
|
79364
79337
|
function dedent(indentString, input) {
|
|
79365
79338
|
if (input === void 0) {
|
|
@@ -79399,34 +79372,32 @@ async function generate_type_root({
|
|
|
79399
79372
|
const all_queries = (page?.query_options ?? []).concat(layout?.query_options ?? []);
|
|
79400
79373
|
const relative2 = path_exports.relative(target_dir, config.rootDir);
|
|
79401
79374
|
const definition = `
|
|
79402
|
-
import { DocumentHandle } from '${relative2}/plugins/houdini-react/runtime'
|
|
79375
|
+
import { DocumentHandle, RouteProp } from '${relative2}/plugins/houdini-react/runtime'
|
|
79403
79376
|
import React from 'react'
|
|
79404
|
-
|
|
79405
79377
|
${all_queries.map(
|
|
79406
|
-
(
|
|
79407
|
-
import type { ${
|
|
79378
|
+
(query) => dedent(`
|
|
79379
|
+
import type { ${query}$result, ${query}$artifact, ${query}$input } from '${config.artifactImportPath(query).replace("$houdini", relative2)}'
|
|
79408
79380
|
|
|
79409
79381
|
`)
|
|
79410
79382
|
).join("\n")}
|
|
79411
79383
|
|
|
79412
|
-
${`
|
|
79413
|
-
|
|
79414
|
-
${!page ? "" :
|
|
79415
|
-
|
|
79416
|
-
${
|
|
79384
|
+
${`export type PageProps = {
|
|
79385
|
+
Params: ${!page ? "{}" : paramsType(config, page.params)},
|
|
79386
|
+
${!page ? "" : `
|
|
79387
|
+
` + page.query_options.map(
|
|
79388
|
+
(query) => ` ${query}: ${query}$result,
|
|
79389
|
+
${query}$handle: DocumentHandle<${query}$artifact, ${query}$result, ${query}$input>,`
|
|
79417
79390
|
).join("\n")}
|
|
79418
79391
|
}
|
|
79419
79392
|
`}
|
|
79420
79393
|
|
|
79421
|
-
${`
|
|
79422
|
-
|
|
79394
|
+
${`export type LayoutProps = {
|
|
79395
|
+
Params: ${!page ? "{}" : paramsType(config, page.params)},
|
|
79423
79396
|
children: React.ReactNode,
|
|
79424
79397
|
${!layout ? "" : layout.query_options.map(
|
|
79425
|
-
(
|
|
79426
|
-
${
|
|
79427
|
-
).join("\n")}
|
|
79428
|
-
}
|
|
79429
|
-
`}
|
|
79398
|
+
(query) => ` ${query}: ${query}$result,
|
|
79399
|
+
${query}$handle: DocumentHandle<${query}$artifact, ${query}$result, ${query}$input>,`
|
|
79400
|
+
).join("\n")}}`}
|
|
79430
79401
|
`;
|
|
79431
79402
|
await fs_exports.writeFile(path_exports.join(target_dir, "$types.d.ts"), definition);
|
|
79432
79403
|
})
|
|
@@ -79478,6 +79449,28 @@ async function writeTsconfig(config) {
|
|
|
79478
79449
|
)
|
|
79479
79450
|
);
|
|
79480
79451
|
}
|
|
79452
|
+
function paramsType(config, params) {
|
|
79453
|
+
return `{
|
|
79454
|
+
${Object.entries(params ?? {}).map(([param, typeInfo]) => {
|
|
79455
|
+
let valueString = "string";
|
|
79456
|
+
if (typeInfo) {
|
|
79457
|
+
valueString = recast3.print(
|
|
79458
|
+
unwrappedTsTypeReference(
|
|
79459
|
+
config,
|
|
79460
|
+
"",
|
|
79461
|
+
/* @__PURE__ */ new Set(),
|
|
79462
|
+
{
|
|
79463
|
+
type: config.schema.getType(typeInfo.type),
|
|
79464
|
+
wrappers: typeInfo.wrappers
|
|
79465
|
+
},
|
|
79466
|
+
[]
|
|
79467
|
+
)
|
|
79468
|
+
).code;
|
|
79469
|
+
}
|
|
79470
|
+
return `${param}: ${valueString},`;
|
|
79471
|
+
}).join(", ")}
|
|
79472
|
+
}`;
|
|
79473
|
+
}
|
|
79481
79474
|
|
|
79482
79475
|
// src/plugin/codegen/index.ts
|
|
79483
79476
|
async function routerCodegen({
|
|
@@ -79490,10 +79483,10 @@ async function routerCodegen({
|
|
|
79490
79483
|
if (!document.artifact?.hasComponents) {
|
|
79491
79484
|
continue;
|
|
79492
79485
|
}
|
|
79493
|
-
const typeInfo = new
|
|
79494
|
-
|
|
79486
|
+
const typeInfo = new graphql7.TypeInfo(config.schema);
|
|
79487
|
+
graphql7.visit(
|
|
79495
79488
|
document.document,
|
|
79496
|
-
|
|
79489
|
+
graphql7.visitWithTypeInfo(typeInfo, {
|
|
79497
79490
|
FragmentSpread(node) {
|
|
79498
79491
|
const directive = node.directives?.find(
|
|
79499
79492
|
(directive2) => directive2.name.value === config.componentFieldDirective
|
|
@@ -79563,12 +79556,12 @@ ${Object.entries(manifest3.pages).map(([id, page]) => {
|
|
|
79563
79556
|
|
|
79564
79557
|
${""}
|
|
79565
79558
|
documents: {
|
|
79566
|
-
${queries.map((
|
|
79567
|
-
const artifact_path = config.artifactImportPath(
|
|
79568
|
-
return `${
|
|
79559
|
+
${queries.map((query) => {
|
|
79560
|
+
const artifact_path = config.artifactImportPath(query);
|
|
79561
|
+
return `${query}: {
|
|
79569
79562
|
artifact: () => import("${path_exports.relative(from, artifact_path)}"),
|
|
79570
|
-
loading: ${JSON.stringify(query_name_map[
|
|
79571
|
-
variables: ${JSON.stringify(query_name_map[
|
|
79563
|
+
loading: ${JSON.stringify(query_name_map[query]?.loading)},
|
|
79564
|
+
variables: ${JSON.stringify(query_name_map[query]?.variables)}
|
|
79572
79565
|
}`;
|
|
79573
79566
|
}).join(",\n ")}
|
|
79574
79567
|
},
|
|
@@ -79616,8 +79609,8 @@ async function extractDocuments({
|
|
|
79616
79609
|
}
|
|
79617
79610
|
|
|
79618
79611
|
// src/plugin/transform.ts
|
|
79619
|
-
var
|
|
79620
|
-
var
|
|
79612
|
+
var recast4 = __toESM(require_main4());
|
|
79613
|
+
var AST3 = recast4.types.builders;
|
|
79621
79614
|
async function transformFile(page) {
|
|
79622
79615
|
if (!page.filepath.endsWith(".tsx") && !page.filepath.endsWith(".jsx")) {
|
|
79623
79616
|
return { code: page.content, map: page.map };
|
|
@@ -79632,7 +79625,7 @@ async function transformFile(page) {
|
|
|
79632
79625
|
body: script.body
|
|
79633
79626
|
});
|
|
79634
79627
|
const properties = [
|
|
79635
|
-
|
|
79628
|
+
AST3.objectProperty(AST3.stringLiteral("artifact"), AST3.identifier(artifactID))
|
|
79636
79629
|
];
|
|
79637
79630
|
const { paginated, componentFields } = page.config.localDocumentData(parsedDocument);
|
|
79638
79631
|
if (paginated) {
|
|
@@ -79648,9 +79641,9 @@ async function transformFile(page) {
|
|
|
79648
79641
|
});
|
|
79649
79642
|
}
|
|
79650
79643
|
properties.push(
|
|
79651
|
-
|
|
79652
|
-
|
|
79653
|
-
|
|
79644
|
+
AST3.objectProperty(
|
|
79645
|
+
AST3.stringLiteral("refetchArtifact"),
|
|
79646
|
+
AST3.identifier(refetchArtifactName)
|
|
79654
79647
|
)
|
|
79655
79648
|
);
|
|
79656
79649
|
}
|
|
@@ -79669,7 +79662,7 @@ async function transformFile(page) {
|
|
|
79669
79662
|
import: null
|
|
79670
79663
|
});
|
|
79671
79664
|
}
|
|
79672
|
-
node.replaceWith(
|
|
79665
|
+
node.replaceWith(AST3.objectExpression(properties));
|
|
79673
79666
|
}
|
|
79674
79667
|
});
|
|
79675
79668
|
return printJS(script);
|
|
@@ -79792,12 +79785,12 @@ var vite_default = {
|
|
|
79792
79785
|
const queryName = parsedPath.name;
|
|
79793
79786
|
if (which === "pages") {
|
|
79794
79787
|
const page = manifest.pages[queryName];
|
|
79795
|
-
const pendingQueries = page.queries.filter((
|
|
79796
|
-
const page2 = Object.values(manifest.page_queries).find((q) => q.name ===
|
|
79788
|
+
const pendingQueries = page.queries.filter((query) => {
|
|
79789
|
+
const page2 = Object.values(manifest.page_queries).find((q) => q.name === query);
|
|
79797
79790
|
if (page2) {
|
|
79798
79791
|
return page2.loading;
|
|
79799
79792
|
}
|
|
79800
|
-
const layout = Object.values(manifest.layout_queries).find((q) => q.name ===
|
|
79793
|
+
const layout = Object.values(manifest.layout_queries).find((q) => q.name === query);
|
|
79801
79794
|
return layout?.loading;
|
|
79802
79795
|
});
|
|
79803
79796
|
return `
|
|
@@ -79827,6 +79820,15 @@ var vite_default = {
|
|
|
79827
79820
|
})
|
|
79828
79821
|
window.__houdini__hydration__layer__ ??= window.__houdini__cache__._internal_unstable.storage.createLayer(true)
|
|
79829
79822
|
|
|
79823
|
+
// link up the cache we just created with the client
|
|
79824
|
+
window.__houdini__client__.setCache(window.__houdini__cache__)
|
|
79825
|
+
|
|
79826
|
+
// hydrate the cache with the information from the initial payload
|
|
79827
|
+
window.__houdini__cache__?.hydrate(
|
|
79828
|
+
window.__houdini__initial__cache__,
|
|
79829
|
+
window.__houdini__hydration__layer__
|
|
79830
|
+
)
|
|
79831
|
+
|
|
79830
79832
|
// the artifacts are the source of the zip (without them, we can't prime either cache)
|
|
79831
79833
|
for (const [artifactName, artifact] of Object.entries(window.__houdini__pending_artifacts__ ?? {})) {
|
|
79832
79834
|
// save the value in the initial artifact cache
|
|
@@ -79835,13 +79837,14 @@ var vite_default = {
|
|
|
79835
79837
|
// if we also have data for the artifact, save it in the initial data cache
|
|
79836
79838
|
if (window.__houdini__pending_data__?.[artifactName]) {
|
|
79837
79839
|
const variables = window.__houdini__pending_variables__[artifactName]
|
|
79840
|
+
|
|
79838
79841
|
if (artifact.hasComponents) {
|
|
79839
79842
|
// we need to walk down the artifacts selection and instantiate any component fields
|
|
79840
79843
|
injectComponents({
|
|
79841
79844
|
cache: window.__houdini__cache__,
|
|
79842
79845
|
selection: artifact.selection,
|
|
79843
79846
|
data: window.__houdini__pending_data__[artifactName],
|
|
79844
|
-
variables
|
|
79847
|
+
variables,
|
|
79845
79848
|
})
|
|
79846
79849
|
}
|
|
79847
79850
|
|
|
@@ -79849,10 +79852,16 @@ var vite_default = {
|
|
|
79849
79852
|
const observer = window.__houdini__client__.observe({
|
|
79850
79853
|
artifact,
|
|
79851
79854
|
cache: window.__houdini__cache__,
|
|
79852
|
-
initialValue: window.
|
|
79855
|
+
initialValue: window.__houdini__cache__.read({selection: artifact.selection, variables}).data,
|
|
79853
79856
|
initialVariables: variables,
|
|
79854
79857
|
})
|
|
79855
79858
|
|
|
79859
|
+
// initialize the observer we just created
|
|
79860
|
+
observer.send({
|
|
79861
|
+
setup: true,
|
|
79862
|
+
variables,
|
|
79863
|
+
})
|
|
79864
|
+
|
|
79856
79865
|
// save it in the cache
|
|
79857
79866
|
initialData[artifactName] = observer
|
|
79858
79867
|
initialVariables[artifactName] = variables
|
|
@@ -79873,12 +79882,6 @@ var vite_default = {
|
|
|
79873
79882
|
})
|
|
79874
79883
|
}
|
|
79875
79884
|
|
|
79876
|
-
// hydrate the cache with the information from the initial payload
|
|
79877
|
-
window.__houdini__cache__?.hydrate(
|
|
79878
|
-
window.__houdini__initial__cache__,
|
|
79879
|
-
window.__houdini__hydration__layer__
|
|
79880
|
-
)
|
|
79881
|
-
|
|
79882
79885
|
// get the initial url from the window
|
|
79883
79886
|
const url = window.location.pathname
|
|
79884
79887
|
|