houdini-svelte 2.1.0 → 2.1.1
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 +660 -507
- package/build/plugin-esm/index.js +660 -507
- package/build/preprocess-cjs/index.js +615 -462
- package/build/preprocess-esm/index.js +615 -462
- package/build/test-cjs/index.js +576 -263
- package/build/test-esm/index.js +576 -263
- package/package.json +2 -2
package/build/test-cjs/index.js
CHANGED
|
@@ -86468,7 +86468,18 @@ var ListManager = class {
|
|
|
86468
86468
|
}
|
|
86469
86469
|
lists = /* @__PURE__ */ new Map();
|
|
86470
86470
|
listsByField = /* @__PURE__ */ new Map();
|
|
86471
|
-
get(listName, id2, allLists) {
|
|
86471
|
+
get(listName, id2, allLists, skipMatches) {
|
|
86472
|
+
const lists = this.getLists(listName, id2, allLists);
|
|
86473
|
+
if (!lists) {
|
|
86474
|
+
return null;
|
|
86475
|
+
}
|
|
86476
|
+
if (skipMatches) {
|
|
86477
|
+
return new ListCollection(lists.lists.filter((list3) => !skipMatches.has(list3.fieldRef)));
|
|
86478
|
+
} else {
|
|
86479
|
+
return lists;
|
|
86480
|
+
}
|
|
86481
|
+
}
|
|
86482
|
+
getLists(listName, id2, allLists) {
|
|
86472
86483
|
const matches = this.lists.get(listName);
|
|
86473
86484
|
if (!matches || matches.size === 0) {
|
|
86474
86485
|
return null;
|
|
@@ -86590,6 +86601,9 @@ var List = class {
|
|
|
86590
86601
|
this.manager = manager;
|
|
86591
86602
|
this.abstract = abstract;
|
|
86592
86603
|
}
|
|
86604
|
+
get fieldRef() {
|
|
86605
|
+
return `${this.recordID}.${this.key}`;
|
|
86606
|
+
}
|
|
86593
86607
|
when(when) {
|
|
86594
86608
|
return this.manager.lists.get(this.name).get(this.recordID).when(when);
|
|
86595
86609
|
}
|
|
@@ -87734,8 +87748,8 @@ var Cache = class {
|
|
|
87734
87748
|
variables
|
|
87735
87749
|
);
|
|
87736
87750
|
}
|
|
87737
|
-
list(name, parentID, allLists) {
|
|
87738
|
-
const handler = this._internal_unstable.lists.get(name, parentID, allLists);
|
|
87751
|
+
list(name, parentID, allLists, skipMatches) {
|
|
87752
|
+
const handler = this._internal_unstable.lists.get(name, parentID, allLists, skipMatches);
|
|
87739
87753
|
if (!handler) {
|
|
87740
87754
|
throw new Error(
|
|
87741
87755
|
`Cannot find list with name: ${name}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -88150,6 +88164,7 @@ var CacheInternal = class {
|
|
|
88150
88164
|
});
|
|
88151
88165
|
}
|
|
88152
88166
|
}
|
|
88167
|
+
const processedOperations = /* @__PURE__ */ new Set();
|
|
88153
88168
|
for (const operation of operations || []) {
|
|
88154
88169
|
let parentID;
|
|
88155
88170
|
if (operation.parentID) {
|
|
@@ -88169,7 +88184,12 @@ var CacheInternal = class {
|
|
|
88169
88184
|
const targets = Array.isArray(value) ? value : [value];
|
|
88170
88185
|
for (const target of targets) {
|
|
88171
88186
|
if (operation.action === "insert" && target instanceof Object && fieldSelection && operation.list) {
|
|
88172
|
-
this.cache.list(
|
|
88187
|
+
this.cache.list(
|
|
88188
|
+
operation.list,
|
|
88189
|
+
parentID,
|
|
88190
|
+
operation.target === "all",
|
|
88191
|
+
processedOperations
|
|
88192
|
+
).when(operation.when).addToList(
|
|
88173
88193
|
fieldSelection,
|
|
88174
88194
|
target,
|
|
88175
88195
|
variables,
|
|
@@ -88177,7 +88197,12 @@ var CacheInternal = class {
|
|
|
88177
88197
|
layer
|
|
88178
88198
|
);
|
|
88179
88199
|
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
88180
|
-
this.cache.list(
|
|
88200
|
+
this.cache.list(
|
|
88201
|
+
operation.list,
|
|
88202
|
+
parentID,
|
|
88203
|
+
operation.target === "all",
|
|
88204
|
+
processedOperations
|
|
88205
|
+
).when(operation.when).toggleElement({
|
|
88181
88206
|
selection: fieldSelection,
|
|
88182
88207
|
data: target,
|
|
88183
88208
|
variables,
|
|
@@ -88185,7 +88210,12 @@ var CacheInternal = class {
|
|
|
88185
88210
|
layer
|
|
88186
88211
|
});
|
|
88187
88212
|
} else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
|
|
88188
|
-
this.cache.list(
|
|
88213
|
+
this.cache.list(
|
|
88214
|
+
operation.list,
|
|
88215
|
+
parentID,
|
|
88216
|
+
operation.target === "all",
|
|
88217
|
+
processedOperations
|
|
88218
|
+
).when(operation.when).remove(target, variables, layer);
|
|
88189
88219
|
} else if (operation.action === "delete" && operation.type && target) {
|
|
88190
88220
|
const targetID = this.id(operation.type, target);
|
|
88191
88221
|
if (!targetID) {
|
|
@@ -88197,6 +88227,16 @@ var CacheInternal = class {
|
|
|
88197
88227
|
this.cache.delete(targetID, layer);
|
|
88198
88228
|
}
|
|
88199
88229
|
}
|
|
88230
|
+
if (operation.list) {
|
|
88231
|
+
const matchingLists = this.cache.list(
|
|
88232
|
+
operation.list,
|
|
88233
|
+
parentID,
|
|
88234
|
+
operation.target === "all"
|
|
88235
|
+
);
|
|
88236
|
+
for (const list3 of matchingLists.lists) {
|
|
88237
|
+
processedOperations.add(list3.fieldRef);
|
|
88238
|
+
}
|
|
88239
|
+
}
|
|
88200
88240
|
}
|
|
88201
88241
|
}
|
|
88202
88242
|
return toNotify;
|
|
@@ -143287,7 +143327,18 @@ var ListManager2 = class {
|
|
|
143287
143327
|
}
|
|
143288
143328
|
lists = /* @__PURE__ */ new Map();
|
|
143289
143329
|
listsByField = /* @__PURE__ */ new Map();
|
|
143290
|
-
get(listName, id2, allLists) {
|
|
143330
|
+
get(listName, id2, allLists, skipMatches) {
|
|
143331
|
+
const lists = this.getLists(listName, id2, allLists);
|
|
143332
|
+
if (!lists) {
|
|
143333
|
+
return null;
|
|
143334
|
+
}
|
|
143335
|
+
if (skipMatches) {
|
|
143336
|
+
return new ListCollection2(lists.lists.filter((list3) => !skipMatches.has(list3.fieldRef)));
|
|
143337
|
+
} else {
|
|
143338
|
+
return lists;
|
|
143339
|
+
}
|
|
143340
|
+
}
|
|
143341
|
+
getLists(listName, id2, allLists) {
|
|
143291
143342
|
const matches = this.lists.get(listName);
|
|
143292
143343
|
if (!matches || matches.size === 0) {
|
|
143293
143344
|
return null;
|
|
@@ -143409,6 +143460,9 @@ var List2 = class {
|
|
|
143409
143460
|
this.manager = manager;
|
|
143410
143461
|
this.abstract = abstract;
|
|
143411
143462
|
}
|
|
143463
|
+
get fieldRef() {
|
|
143464
|
+
return `${this.recordID}.${this.key}`;
|
|
143465
|
+
}
|
|
143412
143466
|
when(when) {
|
|
143413
143467
|
return this.manager.lists.get(this.name).get(this.recordID).when(when);
|
|
143414
143468
|
}
|
|
@@ -144553,8 +144607,8 @@ var Cache2 = class {
|
|
|
144553
144607
|
variables
|
|
144554
144608
|
);
|
|
144555
144609
|
}
|
|
144556
|
-
list(name, parentID, allLists) {
|
|
144557
|
-
const handler = this._internal_unstable.lists.get(name, parentID, allLists);
|
|
144610
|
+
list(name, parentID, allLists, skipMatches) {
|
|
144611
|
+
const handler = this._internal_unstable.lists.get(name, parentID, allLists, skipMatches);
|
|
144558
144612
|
if (!handler) {
|
|
144559
144613
|
throw new Error(
|
|
144560
144614
|
`Cannot find list with name: ${name}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -144969,6 +145023,7 @@ var CacheInternal2 = class {
|
|
|
144969
145023
|
});
|
|
144970
145024
|
}
|
|
144971
145025
|
}
|
|
145026
|
+
const processedOperations = /* @__PURE__ */ new Set();
|
|
144972
145027
|
for (const operation of operations || []) {
|
|
144973
145028
|
let parentID;
|
|
144974
145029
|
if (operation.parentID) {
|
|
@@ -144988,7 +145043,12 @@ var CacheInternal2 = class {
|
|
|
144988
145043
|
const targets = Array.isArray(value) ? value : [value];
|
|
144989
145044
|
for (const target of targets) {
|
|
144990
145045
|
if (operation.action === "insert" && target instanceof Object && fieldSelection && operation.list) {
|
|
144991
|
-
this.cache.list(
|
|
145046
|
+
this.cache.list(
|
|
145047
|
+
operation.list,
|
|
145048
|
+
parentID,
|
|
145049
|
+
operation.target === "all",
|
|
145050
|
+
processedOperations
|
|
145051
|
+
).when(operation.when).addToList(
|
|
144992
145052
|
fieldSelection,
|
|
144993
145053
|
target,
|
|
144994
145054
|
variables,
|
|
@@ -144996,7 +145056,12 @@ var CacheInternal2 = class {
|
|
|
144996
145056
|
layer
|
|
144997
145057
|
);
|
|
144998
145058
|
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
144999
|
-
this.cache.list(
|
|
145059
|
+
this.cache.list(
|
|
145060
|
+
operation.list,
|
|
145061
|
+
parentID,
|
|
145062
|
+
operation.target === "all",
|
|
145063
|
+
processedOperations
|
|
145064
|
+
).when(operation.when).toggleElement({
|
|
145000
145065
|
selection: fieldSelection,
|
|
145001
145066
|
data: target,
|
|
145002
145067
|
variables,
|
|
@@ -145004,7 +145069,12 @@ var CacheInternal2 = class {
|
|
|
145004
145069
|
layer
|
|
145005
145070
|
});
|
|
145006
145071
|
} else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
|
|
145007
|
-
this.cache.list(
|
|
145072
|
+
this.cache.list(
|
|
145073
|
+
operation.list,
|
|
145074
|
+
parentID,
|
|
145075
|
+
operation.target === "all",
|
|
145076
|
+
processedOperations
|
|
145077
|
+
).when(operation.when).remove(target, variables, layer);
|
|
145008
145078
|
} else if (operation.action === "delete" && operation.type && target) {
|
|
145009
145079
|
const targetID = this.id(operation.type, target);
|
|
145010
145080
|
if (!targetID) {
|
|
@@ -145016,6 +145086,16 @@ var CacheInternal2 = class {
|
|
|
145016
145086
|
this.cache.delete(targetID, layer);
|
|
145017
145087
|
}
|
|
145018
145088
|
}
|
|
145089
|
+
if (operation.list) {
|
|
145090
|
+
const matchingLists = this.cache.list(
|
|
145091
|
+
operation.list,
|
|
145092
|
+
parentID,
|
|
145093
|
+
operation.target === "all"
|
|
145094
|
+
);
|
|
145095
|
+
for (const list3 of matchingLists.lists) {
|
|
145096
|
+
processedOperations.add(list3.fieldRef);
|
|
145097
|
+
}
|
|
145098
|
+
}
|
|
145019
145099
|
}
|
|
145020
145100
|
}
|
|
145021
145101
|
return toNotify;
|
|
@@ -147577,6 +147657,46 @@ function objectNode([type, defaultValue]) {
|
|
|
147577
147657
|
return node;
|
|
147578
147658
|
}
|
|
147579
147659
|
var pageInfoSelection = [
|
|
147660
|
+
{
|
|
147661
|
+
kind: graphql13.Kind.FIELD,
|
|
147662
|
+
name: {
|
|
147663
|
+
kind: graphql13.Kind.NAME,
|
|
147664
|
+
value: "pageInfo"
|
|
147665
|
+
},
|
|
147666
|
+
selectionSet: {
|
|
147667
|
+
kind: graphql13.Kind.SELECTION_SET,
|
|
147668
|
+
selections: [
|
|
147669
|
+
{
|
|
147670
|
+
kind: graphql13.Kind.FIELD,
|
|
147671
|
+
name: {
|
|
147672
|
+
kind: graphql13.Kind.NAME,
|
|
147673
|
+
value: "hasPreviousPage"
|
|
147674
|
+
}
|
|
147675
|
+
},
|
|
147676
|
+
{
|
|
147677
|
+
kind: graphql13.Kind.FIELD,
|
|
147678
|
+
name: {
|
|
147679
|
+
kind: graphql13.Kind.NAME,
|
|
147680
|
+
value: "hasNextPage"
|
|
147681
|
+
}
|
|
147682
|
+
},
|
|
147683
|
+
{
|
|
147684
|
+
kind: graphql13.Kind.FIELD,
|
|
147685
|
+
name: {
|
|
147686
|
+
kind: graphql13.Kind.NAME,
|
|
147687
|
+
value: "startCursor"
|
|
147688
|
+
}
|
|
147689
|
+
},
|
|
147690
|
+
{
|
|
147691
|
+
kind: graphql13.Kind.FIELD,
|
|
147692
|
+
name: {
|
|
147693
|
+
kind: graphql13.Kind.NAME,
|
|
147694
|
+
value: "endCursor"
|
|
147695
|
+
}
|
|
147696
|
+
}
|
|
147697
|
+
]
|
|
147698
|
+
}
|
|
147699
|
+
},
|
|
147580
147700
|
{
|
|
147581
147701
|
kind: graphql13.Kind.FIELD,
|
|
147582
147702
|
name: {
|
|
@@ -207778,7 +207898,18 @@ var ListManager3 = class {
|
|
|
207778
207898
|
}
|
|
207779
207899
|
lists = /* @__PURE__ */ new Map();
|
|
207780
207900
|
listsByField = /* @__PURE__ */ new Map();
|
|
207781
|
-
get(listName, id2, allLists) {
|
|
207901
|
+
get(listName, id2, allLists, skipMatches) {
|
|
207902
|
+
const lists = this.getLists(listName, id2, allLists);
|
|
207903
|
+
if (!lists) {
|
|
207904
|
+
return null;
|
|
207905
|
+
}
|
|
207906
|
+
if (skipMatches) {
|
|
207907
|
+
return new ListCollection3(lists.lists.filter((list3) => !skipMatches.has(list3.fieldRef)));
|
|
207908
|
+
} else {
|
|
207909
|
+
return lists;
|
|
207910
|
+
}
|
|
207911
|
+
}
|
|
207912
|
+
getLists(listName, id2, allLists) {
|
|
207782
207913
|
const matches = this.lists.get(listName);
|
|
207783
207914
|
if (!matches || matches.size === 0) {
|
|
207784
207915
|
return null;
|
|
@@ -207900,6 +208031,9 @@ var List3 = class {
|
|
|
207900
208031
|
this.manager = manager;
|
|
207901
208032
|
this.abstract = abstract;
|
|
207902
208033
|
}
|
|
208034
|
+
get fieldRef() {
|
|
208035
|
+
return `${this.recordID}.${this.key}`;
|
|
208036
|
+
}
|
|
207903
208037
|
when(when) {
|
|
207904
208038
|
return this.manager.lists.get(this.name).get(this.recordID).when(when);
|
|
207905
208039
|
}
|
|
@@ -209044,8 +209178,8 @@ var Cache3 = class {
|
|
|
209044
209178
|
variables
|
|
209045
209179
|
);
|
|
209046
209180
|
}
|
|
209047
|
-
list(name, parentID, allLists) {
|
|
209048
|
-
const handler = this._internal_unstable.lists.get(name, parentID, allLists);
|
|
209181
|
+
list(name, parentID, allLists, skipMatches) {
|
|
209182
|
+
const handler = this._internal_unstable.lists.get(name, parentID, allLists, skipMatches);
|
|
209049
209183
|
if (!handler) {
|
|
209050
209184
|
throw new Error(
|
|
209051
209185
|
`Cannot find list with name: ${name}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -209460,6 +209594,7 @@ var CacheInternal3 = class {
|
|
|
209460
209594
|
});
|
|
209461
209595
|
}
|
|
209462
209596
|
}
|
|
209597
|
+
const processedOperations = /* @__PURE__ */ new Set();
|
|
209463
209598
|
for (const operation of operations || []) {
|
|
209464
209599
|
let parentID;
|
|
209465
209600
|
if (operation.parentID) {
|
|
@@ -209479,7 +209614,12 @@ var CacheInternal3 = class {
|
|
|
209479
209614
|
const targets = Array.isArray(value) ? value : [value];
|
|
209480
209615
|
for (const target of targets) {
|
|
209481
209616
|
if (operation.action === "insert" && target instanceof Object && fieldSelection && operation.list) {
|
|
209482
|
-
this.cache.list(
|
|
209617
|
+
this.cache.list(
|
|
209618
|
+
operation.list,
|
|
209619
|
+
parentID,
|
|
209620
|
+
operation.target === "all",
|
|
209621
|
+
processedOperations
|
|
209622
|
+
).when(operation.when).addToList(
|
|
209483
209623
|
fieldSelection,
|
|
209484
209624
|
target,
|
|
209485
209625
|
variables,
|
|
@@ -209487,7 +209627,12 @@ var CacheInternal3 = class {
|
|
|
209487
209627
|
layer
|
|
209488
209628
|
);
|
|
209489
209629
|
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
209490
|
-
this.cache.list(
|
|
209630
|
+
this.cache.list(
|
|
209631
|
+
operation.list,
|
|
209632
|
+
parentID,
|
|
209633
|
+
operation.target === "all",
|
|
209634
|
+
processedOperations
|
|
209635
|
+
).when(operation.when).toggleElement({
|
|
209491
209636
|
selection: fieldSelection,
|
|
209492
209637
|
data: target,
|
|
209493
209638
|
variables,
|
|
@@ -209495,7 +209640,12 @@ var CacheInternal3 = class {
|
|
|
209495
209640
|
layer
|
|
209496
209641
|
});
|
|
209497
209642
|
} else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
|
|
209498
|
-
this.cache.list(
|
|
209643
|
+
this.cache.list(
|
|
209644
|
+
operation.list,
|
|
209645
|
+
parentID,
|
|
209646
|
+
operation.target === "all",
|
|
209647
|
+
processedOperations
|
|
209648
|
+
).when(operation.when).remove(target, variables, layer);
|
|
209499
209649
|
} else if (operation.action === "delete" && operation.type && target) {
|
|
209500
209650
|
const targetID = this.id(operation.type, target);
|
|
209501
209651
|
if (!targetID) {
|
|
@@ -209507,6 +209657,16 @@ var CacheInternal3 = class {
|
|
|
209507
209657
|
this.cache.delete(targetID, layer);
|
|
209508
209658
|
}
|
|
209509
209659
|
}
|
|
209660
|
+
if (operation.list) {
|
|
209661
|
+
const matchingLists = this.cache.list(
|
|
209662
|
+
operation.list,
|
|
209663
|
+
parentID,
|
|
209664
|
+
operation.target === "all"
|
|
209665
|
+
);
|
|
209666
|
+
for (const list3 of matchingLists.lists) {
|
|
209667
|
+
processedOperations.add(list3.fieldRef);
|
|
209668
|
+
}
|
|
209669
|
+
}
|
|
209510
209670
|
}
|
|
209511
209671
|
}
|
|
209512
209672
|
return toNotify;
|
|
@@ -210648,6 +210808,46 @@ var { keys: keys2 } = Object;
|
|
|
210648
210808
|
var recast42 = __toESM4(require_main23(), 1);
|
|
210649
210809
|
var AST42 = recast42.types.builders;
|
|
210650
210810
|
var pageInfoSelection2 = [
|
|
210811
|
+
{
|
|
210812
|
+
kind: graphql132.Kind.FIELD,
|
|
210813
|
+
name: {
|
|
210814
|
+
kind: graphql132.Kind.NAME,
|
|
210815
|
+
value: "pageInfo"
|
|
210816
|
+
},
|
|
210817
|
+
selectionSet: {
|
|
210818
|
+
kind: graphql132.Kind.SELECTION_SET,
|
|
210819
|
+
selections: [
|
|
210820
|
+
{
|
|
210821
|
+
kind: graphql132.Kind.FIELD,
|
|
210822
|
+
name: {
|
|
210823
|
+
kind: graphql132.Kind.NAME,
|
|
210824
|
+
value: "hasPreviousPage"
|
|
210825
|
+
}
|
|
210826
|
+
},
|
|
210827
|
+
{
|
|
210828
|
+
kind: graphql132.Kind.FIELD,
|
|
210829
|
+
name: {
|
|
210830
|
+
kind: graphql132.Kind.NAME,
|
|
210831
|
+
value: "hasNextPage"
|
|
210832
|
+
}
|
|
210833
|
+
},
|
|
210834
|
+
{
|
|
210835
|
+
kind: graphql132.Kind.FIELD,
|
|
210836
|
+
name: {
|
|
210837
|
+
kind: graphql132.Kind.NAME,
|
|
210838
|
+
value: "startCursor"
|
|
210839
|
+
}
|
|
210840
|
+
},
|
|
210841
|
+
{
|
|
210842
|
+
kind: graphql132.Kind.FIELD,
|
|
210843
|
+
name: {
|
|
210844
|
+
kind: graphql132.Kind.NAME,
|
|
210845
|
+
value: "endCursor"
|
|
210846
|
+
}
|
|
210847
|
+
}
|
|
210848
|
+
]
|
|
210849
|
+
}
|
|
210850
|
+
},
|
|
210651
210851
|
{
|
|
210652
210852
|
kind: graphql132.Kind.FIELD,
|
|
210653
210853
|
name: {
|
|
@@ -231049,30 +231249,30 @@ var require_utils52 = __commonJS5({
|
|
|
231049
231249
|
validate32.oneOf = values;
|
|
231050
231250
|
return validate32;
|
|
231051
231251
|
}
|
|
231052
|
-
function assertNodeType(...
|
|
231252
|
+
function assertNodeType(...types18) {
|
|
231053
231253
|
function validate32(node, key2, val) {
|
|
231054
|
-
for (const type of
|
|
231254
|
+
for (const type of types18) {
|
|
231055
231255
|
if ((0, _is.default)(type, val)) {
|
|
231056
231256
|
(0, _validate.validateChild)(node, key2, val);
|
|
231057
231257
|
return;
|
|
231058
231258
|
}
|
|
231059
231259
|
}
|
|
231060
|
-
throw new TypeError(`Property ${key2} of ${node.type} expected node to be of a type ${JSON.stringify(
|
|
231260
|
+
throw new TypeError(`Property ${key2} of ${node.type} expected node to be of a type ${JSON.stringify(types18)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`);
|
|
231061
231261
|
}
|
|
231062
|
-
validate32.oneOfNodeTypes =
|
|
231262
|
+
validate32.oneOfNodeTypes = types18;
|
|
231063
231263
|
return validate32;
|
|
231064
231264
|
}
|
|
231065
|
-
function assertNodeOrValueType(...
|
|
231265
|
+
function assertNodeOrValueType(...types18) {
|
|
231066
231266
|
function validate32(node, key2, val) {
|
|
231067
|
-
for (const type of
|
|
231267
|
+
for (const type of types18) {
|
|
231068
231268
|
if (getType(val) === type || (0, _is.default)(type, val)) {
|
|
231069
231269
|
(0, _validate.validateChild)(node, key2, val);
|
|
231070
231270
|
return;
|
|
231071
231271
|
}
|
|
231072
231272
|
}
|
|
231073
|
-
throw new TypeError(`Property ${key2} of ${node.type} expected node to be of a type ${JSON.stringify(
|
|
231273
|
+
throw new TypeError(`Property ${key2} of ${node.type} expected node to be of a type ${JSON.stringify(types18)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`);
|
|
231074
231274
|
}
|
|
231075
|
-
validate32.oneOfNodeOrValueTypes =
|
|
231275
|
+
validate32.oneOfNodeOrValueTypes = types18;
|
|
231076
231276
|
return validate32;
|
|
231077
231277
|
}
|
|
231078
231278
|
function assertValueType(type) {
|
|
@@ -235476,10 +235676,10 @@ var require_generated24 = __commonJS5({
|
|
|
235476
235676
|
body
|
|
235477
235677
|
});
|
|
235478
235678
|
}
|
|
235479
|
-
function intersectionTypeAnnotation(
|
|
235679
|
+
function intersectionTypeAnnotation(types18) {
|
|
235480
235680
|
return (0, _validateNode.default)({
|
|
235481
235681
|
type: "IntersectionTypeAnnotation",
|
|
235482
|
-
types:
|
|
235682
|
+
types: types18
|
|
235483
235683
|
});
|
|
235484
235684
|
}
|
|
235485
235685
|
function mixedTypeAnnotation() {
|
|
@@ -235602,10 +235802,10 @@ var require_generated24 = __commonJS5({
|
|
|
235602
235802
|
type: "ThisTypeAnnotation"
|
|
235603
235803
|
};
|
|
235604
235804
|
}
|
|
235605
|
-
function tupleTypeAnnotation(
|
|
235805
|
+
function tupleTypeAnnotation(types18) {
|
|
235606
235806
|
return (0, _validateNode.default)({
|
|
235607
235807
|
type: "TupleTypeAnnotation",
|
|
235608
|
-
types:
|
|
235808
|
+
types: types18
|
|
235609
235809
|
});
|
|
235610
235810
|
}
|
|
235611
235811
|
function typeofTypeAnnotation(argument) {
|
|
@@ -235656,10 +235856,10 @@ var require_generated24 = __commonJS5({
|
|
|
235656
235856
|
params
|
|
235657
235857
|
});
|
|
235658
235858
|
}
|
|
235659
|
-
function unionTypeAnnotation(
|
|
235859
|
+
function unionTypeAnnotation(types18) {
|
|
235660
235860
|
return (0, _validateNode.default)({
|
|
235661
235861
|
type: "UnionTypeAnnotation",
|
|
235662
|
-
types:
|
|
235862
|
+
types: types18
|
|
235663
235863
|
});
|
|
235664
235864
|
}
|
|
235665
235865
|
function variance(kind) {
|
|
@@ -236172,16 +236372,16 @@ var require_generated24 = __commonJS5({
|
|
|
236172
236372
|
optional
|
|
236173
236373
|
});
|
|
236174
236374
|
}
|
|
236175
|
-
function tsUnionType(
|
|
236375
|
+
function tsUnionType(types18) {
|
|
236176
236376
|
return (0, _validateNode.default)({
|
|
236177
236377
|
type: "TSUnionType",
|
|
236178
|
-
types:
|
|
236378
|
+
types: types18
|
|
236179
236379
|
});
|
|
236180
236380
|
}
|
|
236181
|
-
function tsIntersectionType(
|
|
236381
|
+
function tsIntersectionType(types18) {
|
|
236182
236382
|
return (0, _validateNode.default)({
|
|
236183
236383
|
type: "TSIntersectionType",
|
|
236184
|
-
types:
|
|
236384
|
+
types: types18
|
|
236185
236385
|
});
|
|
236186
236386
|
}
|
|
236187
236387
|
function tsConditionalType(checkType, extendsType, trueType, falseType) {
|
|
@@ -237782,12 +237982,12 @@ var require_removeTypeDuplicates5 = __commonJS5({
|
|
|
237782
237982
|
const generics = /* @__PURE__ */ new Map();
|
|
237783
237983
|
const bases = /* @__PURE__ */ new Map();
|
|
237784
237984
|
const typeGroups = /* @__PURE__ */ new Set();
|
|
237785
|
-
const
|
|
237985
|
+
const types18 = [];
|
|
237786
237986
|
for (let i22 = 0; i22 < nodes.length; i22++) {
|
|
237787
237987
|
const node = nodes[i22];
|
|
237788
237988
|
if (!node)
|
|
237789
237989
|
continue;
|
|
237790
|
-
if (
|
|
237990
|
+
if (types18.indexOf(node) >= 0) {
|
|
237791
237991
|
continue;
|
|
237792
237992
|
}
|
|
237793
237993
|
if ((0, _generated.isAnyTypeAnnotation)(node)) {
|
|
@@ -237821,15 +238021,15 @@ var require_removeTypeDuplicates5 = __commonJS5({
|
|
|
237821
238021
|
}
|
|
237822
238022
|
continue;
|
|
237823
238023
|
}
|
|
237824
|
-
|
|
238024
|
+
types18.push(node);
|
|
237825
238025
|
}
|
|
237826
238026
|
for (const [, baseType] of bases) {
|
|
237827
|
-
|
|
238027
|
+
types18.push(baseType);
|
|
237828
238028
|
}
|
|
237829
238029
|
for (const [, genericName] of generics) {
|
|
237830
|
-
|
|
238030
|
+
types18.push(genericName);
|
|
237831
238031
|
}
|
|
237832
|
-
return
|
|
238032
|
+
return types18;
|
|
237833
238033
|
}
|
|
237834
238034
|
}
|
|
237835
238035
|
});
|
|
@@ -237842,8 +238042,8 @@ var require_createFlowUnionType4 = __commonJS5({
|
|
|
237842
238042
|
exports.default = createFlowUnionType;
|
|
237843
238043
|
var _generated = require_generated24();
|
|
237844
238044
|
var _removeTypeDuplicates = require_removeTypeDuplicates5();
|
|
237845
|
-
function createFlowUnionType(
|
|
237846
|
-
const flattened = (0, _removeTypeDuplicates.default)(
|
|
238045
|
+
function createFlowUnionType(types18) {
|
|
238046
|
+
const flattened = (0, _removeTypeDuplicates.default)(types18);
|
|
237847
238047
|
if (flattened.length === 1) {
|
|
237848
238048
|
return flattened[0];
|
|
237849
238049
|
} else {
|
|
@@ -237868,12 +238068,12 @@ var require_removeTypeDuplicates24 = __commonJS5({
|
|
|
237868
238068
|
const generics = /* @__PURE__ */ new Map();
|
|
237869
238069
|
const bases = /* @__PURE__ */ new Map();
|
|
237870
238070
|
const typeGroups = /* @__PURE__ */ new Set();
|
|
237871
|
-
const
|
|
238071
|
+
const types18 = [];
|
|
237872
238072
|
for (let i22 = 0; i22 < nodes.length; i22++) {
|
|
237873
238073
|
const node = nodes[i22];
|
|
237874
238074
|
if (!node)
|
|
237875
238075
|
continue;
|
|
237876
|
-
if (
|
|
238076
|
+
if (types18.indexOf(node) >= 0) {
|
|
237877
238077
|
continue;
|
|
237878
238078
|
}
|
|
237879
238079
|
if ((0, _generated.isTSAnyKeyword)(node)) {
|
|
@@ -237907,15 +238107,15 @@ var require_removeTypeDuplicates24 = __commonJS5({
|
|
|
237907
238107
|
}
|
|
237908
238108
|
continue;
|
|
237909
238109
|
}
|
|
237910
|
-
|
|
238110
|
+
types18.push(node);
|
|
237911
238111
|
}
|
|
237912
238112
|
for (const [, baseType] of bases) {
|
|
237913
|
-
|
|
238113
|
+
types18.push(baseType);
|
|
237914
238114
|
}
|
|
237915
238115
|
for (const [, genericName] of generics) {
|
|
237916
|
-
|
|
238116
|
+
types18.push(genericName);
|
|
237917
238117
|
}
|
|
237918
|
-
return
|
|
238118
|
+
return types18;
|
|
237919
238119
|
}
|
|
237920
238120
|
}
|
|
237921
238121
|
});
|
|
@@ -237930,10 +238130,10 @@ var require_createTSUnionType4 = __commonJS5({
|
|
|
237930
238130
|
var _removeTypeDuplicates = require_removeTypeDuplicates24();
|
|
237931
238131
|
var _index = require_generated7();
|
|
237932
238132
|
function createTSUnionType(typeAnnotations) {
|
|
237933
|
-
const
|
|
238133
|
+
const types18 = typeAnnotations.map((type) => {
|
|
237934
238134
|
return (0, _index.isTSTypeAnnotation)(type) ? type.typeAnnotation : type;
|
|
237935
238135
|
});
|
|
237936
|
-
const flattened = (0, _removeTypeDuplicates.default)(
|
|
238136
|
+
const flattened = (0, _removeTypeDuplicates.default)(types18);
|
|
237937
238137
|
if (flattened.length === 1) {
|
|
237938
238138
|
return flattened[0];
|
|
237939
238139
|
} else {
|
|
@@ -242197,14 +242397,14 @@ var require_lib64 = __commonJS5({
|
|
|
242197
242397
|
this.preserveSpace = !!preserveSpace;
|
|
242198
242398
|
}
|
|
242199
242399
|
};
|
|
242200
|
-
var
|
|
242400
|
+
var types18 = {
|
|
242201
242401
|
brace: new TokContext3("{"),
|
|
242202
242402
|
j_oTag: new TokContext3("<tag"),
|
|
242203
242403
|
j_cTag: new TokContext3("</tag"),
|
|
242204
242404
|
j_expr: new TokContext3("<tag>...</tag>", true)
|
|
242205
242405
|
};
|
|
242206
242406
|
{
|
|
242207
|
-
|
|
242407
|
+
types18.template = new TokContext3("`", true);
|
|
242208
242408
|
}
|
|
242209
242409
|
var beforeExpr2 = true;
|
|
242210
242410
|
var startsExpr2 = true;
|
|
@@ -242742,17 +242942,17 @@ var require_lib64 = __commonJS5({
|
|
|
242742
242942
|
context.pop();
|
|
242743
242943
|
};
|
|
242744
242944
|
tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = (context) => {
|
|
242745
|
-
context.push(
|
|
242945
|
+
context.push(types18.brace);
|
|
242746
242946
|
};
|
|
242747
242947
|
tokenTypes[22].updateContext = (context) => {
|
|
242748
|
-
if (context[context.length - 1] ===
|
|
242948
|
+
if (context[context.length - 1] === types18.template) {
|
|
242749
242949
|
context.pop();
|
|
242750
242950
|
} else {
|
|
242751
|
-
context.push(
|
|
242951
|
+
context.push(types18.template);
|
|
242752
242952
|
}
|
|
242753
242953
|
};
|
|
242754
242954
|
tokenTypes[142].updateContext = (context) => {
|
|
242755
|
-
context.push(
|
|
242955
|
+
context.push(types18.j_expr, types18.j_oTag);
|
|
242756
242956
|
};
|
|
242757
242957
|
}
|
|
242758
242958
|
var nonASCIIidentifierStartChars2 = "\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";
|
|
@@ -243312,7 +243512,7 @@ var require_lib64 = __commonJS5({
|
|
|
243312
243512
|
this.end = 0;
|
|
243313
243513
|
this.lastTokEndLoc = null;
|
|
243314
243514
|
this.lastTokStartLoc = null;
|
|
243315
|
-
this.context = [
|
|
243515
|
+
this.context = [types18.brace];
|
|
243316
243516
|
this.firstInvalidTemplateEscapePos = null;
|
|
243317
243517
|
this.strictErrors = /* @__PURE__ */ new Map();
|
|
243318
243518
|
this.tokensLength = 0;
|
|
@@ -247139,7 +247339,7 @@ var require_lib64 = __commonJS5({
|
|
|
247139
247339
|
context
|
|
247140
247340
|
} = this.state;
|
|
247141
247341
|
const currentContext = context[context.length - 1];
|
|
247142
|
-
if (currentContext ===
|
|
247342
|
+
if (currentContext === types18.j_oTag || currentContext === types18.j_expr) {
|
|
247143
247343
|
context.pop();
|
|
247144
247344
|
}
|
|
247145
247345
|
}
|
|
@@ -248161,9 +248361,9 @@ var require_lib64 = __commonJS5({
|
|
|
248161
248361
|
switch (this.state.type) {
|
|
248162
248362
|
case 5:
|
|
248163
248363
|
node = this.startNode();
|
|
248164
|
-
this.setContext(
|
|
248364
|
+
this.setContext(types18.brace);
|
|
248165
248365
|
this.next();
|
|
248166
|
-
node = this.jsxParseExpressionContainer(node,
|
|
248366
|
+
node = this.jsxParseExpressionContainer(node, types18.j_oTag);
|
|
248167
248367
|
if (node.expression.type === "JSXEmptyExpression") {
|
|
248168
248368
|
this.raise(JsxErrors.AttributeIsEmpty, node);
|
|
248169
248369
|
}
|
|
@@ -248182,7 +248382,7 @@ var require_lib64 = __commonJS5({
|
|
|
248182
248382
|
jsxParseSpreadChild(node) {
|
|
248183
248383
|
this.next();
|
|
248184
248384
|
node.expression = this.parseExpression();
|
|
248185
|
-
this.setContext(
|
|
248385
|
+
this.setContext(types18.j_expr);
|
|
248186
248386
|
this.state.canStartJSXElement = true;
|
|
248187
248387
|
this.expect(8);
|
|
248188
248388
|
return this.finishNode(node, "JSXSpreadChild");
|
|
@@ -248202,11 +248402,11 @@ var require_lib64 = __commonJS5({
|
|
|
248202
248402
|
jsxParseAttribute() {
|
|
248203
248403
|
const node = this.startNode();
|
|
248204
248404
|
if (this.match(5)) {
|
|
248205
|
-
this.setContext(
|
|
248405
|
+
this.setContext(types18.brace);
|
|
248206
248406
|
this.next();
|
|
248207
248407
|
this.expect(21);
|
|
248208
248408
|
node.argument = this.parseMaybeAssignAllowIn();
|
|
248209
|
-
this.setContext(
|
|
248409
|
+
this.setContext(types18.j_oTag);
|
|
248210
248410
|
this.state.canStartJSXElement = true;
|
|
248211
248411
|
this.expect(8);
|
|
248212
248412
|
return this.finishNode(node, "JSXSpreadAttribute");
|
|
@@ -248265,12 +248465,12 @@ var require_lib64 = __commonJS5({
|
|
|
248265
248465
|
break;
|
|
248266
248466
|
case 5: {
|
|
248267
248467
|
const node2 = this.startNode();
|
|
248268
|
-
this.setContext(
|
|
248468
|
+
this.setContext(types18.brace);
|
|
248269
248469
|
this.next();
|
|
248270
248470
|
if (this.match(21)) {
|
|
248271
248471
|
children.push(this.jsxParseSpreadChild(node2));
|
|
248272
248472
|
} else {
|
|
248273
|
-
children.push(this.jsxParseExpressionContainer(node2,
|
|
248473
|
+
children.push(this.jsxParseExpressionContainer(node2, types18.j_expr));
|
|
248274
248474
|
}
|
|
248275
248475
|
break;
|
|
248276
248476
|
}
|
|
@@ -248335,11 +248535,11 @@ var require_lib64 = __commonJS5({
|
|
|
248335
248535
|
}
|
|
248336
248536
|
getTokenFromCode(code2) {
|
|
248337
248537
|
const context = this.curContext();
|
|
248338
|
-
if (context ===
|
|
248538
|
+
if (context === types18.j_expr) {
|
|
248339
248539
|
this.jsxReadToken();
|
|
248340
248540
|
return;
|
|
248341
248541
|
}
|
|
248342
|
-
if (context ===
|
|
248542
|
+
if (context === types18.j_oTag || context === types18.j_cTag) {
|
|
248343
248543
|
if (isIdentifierStart2(code2)) {
|
|
248344
248544
|
this.jsxReadWord();
|
|
248345
248545
|
return;
|
|
@@ -248349,7 +248549,7 @@ var require_lib64 = __commonJS5({
|
|
|
248349
248549
|
this.finishToken(143);
|
|
248350
248550
|
return;
|
|
248351
248551
|
}
|
|
248352
|
-
if ((code2 === 34 || code2 === 39) && context ===
|
|
248552
|
+
if ((code2 === 34 || code2 === 39) && context === types18.j_oTag) {
|
|
248353
248553
|
this.jsxReadString(code2);
|
|
248354
248554
|
return;
|
|
248355
248555
|
}
|
|
@@ -248367,17 +248567,17 @@ var require_lib64 = __commonJS5({
|
|
|
248367
248567
|
type
|
|
248368
248568
|
} = this.state;
|
|
248369
248569
|
if (type === 56 && prevType === 142) {
|
|
248370
|
-
context.splice(-2, 2,
|
|
248570
|
+
context.splice(-2, 2, types18.j_cTag);
|
|
248371
248571
|
this.state.canStartJSXElement = false;
|
|
248372
248572
|
} else if (type === 142) {
|
|
248373
|
-
context.push(
|
|
248573
|
+
context.push(types18.j_oTag);
|
|
248374
248574
|
} else if (type === 143) {
|
|
248375
248575
|
const out = context[context.length - 1];
|
|
248376
|
-
if (out ===
|
|
248576
|
+
if (out === types18.j_oTag && prevType === 56 || out === types18.j_cTag) {
|
|
248377
248577
|
context.pop();
|
|
248378
|
-
this.state.canStartJSXElement = context[context.length - 1] ===
|
|
248578
|
+
this.state.canStartJSXElement = context[context.length - 1] === types18.j_expr;
|
|
248379
248579
|
} else {
|
|
248380
|
-
this.setContext(
|
|
248580
|
+
this.setContext(types18.j_expr);
|
|
248381
248581
|
this.state.canStartJSXElement = true;
|
|
248382
248582
|
}
|
|
248383
248583
|
} else {
|
|
@@ -249752,14 +249952,14 @@ var require_lib64 = __commonJS5({
|
|
|
249752
249952
|
tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
|
|
249753
249953
|
const node = this.startNode();
|
|
249754
249954
|
const hasLeadingOperator = this.eat(operator);
|
|
249755
|
-
const
|
|
249955
|
+
const types19 = [];
|
|
249756
249956
|
do {
|
|
249757
|
-
|
|
249957
|
+
types19.push(parseConstituentType());
|
|
249758
249958
|
} while (this.eat(operator));
|
|
249759
|
-
if (
|
|
249760
|
-
return
|
|
249959
|
+
if (types19.length === 1 && !hasLeadingOperator) {
|
|
249960
|
+
return types19[0];
|
|
249761
249961
|
}
|
|
249762
|
-
node.types =
|
|
249962
|
+
node.types = types19;
|
|
249763
249963
|
return this.finishNode(node, kind);
|
|
249764
249964
|
}
|
|
249765
249965
|
tsParseIntersectionTypeOrHigher() {
|
|
@@ -250323,7 +250523,7 @@ var require_lib64 = __commonJS5({
|
|
|
250323
250523
|
}));
|
|
250324
250524
|
if (node.params.length === 0) {
|
|
250325
250525
|
this.raise(TSErrors.EmptyTypeArguments, node);
|
|
250326
|
-
} else if (!this.state.inType && this.curContext() ===
|
|
250526
|
+
} else if (!this.state.inType && this.curContext() === types18.brace) {
|
|
250327
250527
|
this.reScan_lt_gt();
|
|
250328
250528
|
}
|
|
250329
250529
|
this.expect(48);
|
|
@@ -250949,7 +251149,7 @@ var require_lib64 = __commonJS5({
|
|
|
250949
251149
|
context
|
|
250950
251150
|
} = this.state;
|
|
250951
251151
|
const currentContext = context[context.length - 1];
|
|
250952
|
-
if (currentContext ===
|
|
251152
|
+
if (currentContext === types18.j_oTag || currentContext === types18.j_expr) {
|
|
250953
251153
|
context.pop();
|
|
250954
251154
|
}
|
|
250955
251155
|
}
|
|
@@ -256077,9 +256277,9 @@ var require_shared4 = __commonJS5({
|
|
|
256077
256277
|
var tslib_1 = require_tslib4();
|
|
256078
256278
|
var types_1 = tslib_1.__importDefault(require_types4());
|
|
256079
256279
|
function default_1(fork) {
|
|
256080
|
-
var
|
|
256081
|
-
var Type =
|
|
256082
|
-
var builtin =
|
|
256280
|
+
var types18 = fork.use(types_1.default);
|
|
256281
|
+
var Type = types18.Type;
|
|
256282
|
+
var builtin = types18.builtInTypes;
|
|
256083
256283
|
var isNumber = builtin.number;
|
|
256084
256284
|
function geq(than) {
|
|
256085
256285
|
return Type.from(function(value) {
|
|
@@ -256227,9 +256427,9 @@ var require_types4 = __commonJS5({
|
|
|
256227
256427
|
}(BaseType);
|
|
256228
256428
|
var OrType = function(_super) {
|
|
256229
256429
|
tslib_1.__extends(OrType2, _super);
|
|
256230
|
-
function OrType2(
|
|
256430
|
+
function OrType2(types18) {
|
|
256231
256431
|
var _this = _super.call(this) || this;
|
|
256232
|
-
_this.types =
|
|
256432
|
+
_this.types = types18;
|
|
256233
256433
|
_this.kind = "OrType";
|
|
256234
256434
|
return _this;
|
|
256235
256435
|
}
|
|
@@ -256370,11 +256570,11 @@ var require_types4 = __commonJS5({
|
|
|
256370
256570
|
function typesPlugin(_fork) {
|
|
256371
256571
|
var Type = {
|
|
256372
256572
|
or: function() {
|
|
256373
|
-
var
|
|
256573
|
+
var types18 = [];
|
|
256374
256574
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
256375
|
-
|
|
256575
|
+
types18[_i] = arguments[_i];
|
|
256376
256576
|
}
|
|
256377
|
-
return new OrType(
|
|
256577
|
+
return new OrType(types18.map(function(type) {
|
|
256378
256578
|
return Type.from(type);
|
|
256379
256579
|
}));
|
|
256380
256580
|
},
|
|
@@ -256817,9 +257017,9 @@ var require_path24 = __commonJS5({
|
|
|
256817
257017
|
var Op = Object.prototype;
|
|
256818
257018
|
var hasOwn2 = Op.hasOwnProperty;
|
|
256819
257019
|
function pathPlugin(fork) {
|
|
256820
|
-
var
|
|
256821
|
-
var isArray2 =
|
|
256822
|
-
var isNumber =
|
|
257020
|
+
var types18 = fork.use(types_1.default);
|
|
257021
|
+
var isArray2 = types18.builtInTypes.array;
|
|
257022
|
+
var isNumber = types18.builtInTypes.number;
|
|
256823
257023
|
var Path = function Path2(value, parentPath, name) {
|
|
256824
257024
|
if (!(this instanceof Path2)) {
|
|
256825
257025
|
throw new Error("Path constructor cannot be invoked without 'new'");
|
|
@@ -257119,13 +257319,13 @@ var require_scope4 = __commonJS5({
|
|
|
257119
257319
|
var types_1 = tslib_1.__importDefault(require_types4());
|
|
257120
257320
|
var hasOwn2 = Object.prototype.hasOwnProperty;
|
|
257121
257321
|
function scopePlugin(fork) {
|
|
257122
|
-
var
|
|
257123
|
-
var Type =
|
|
257124
|
-
var namedTypes =
|
|
257322
|
+
var types18 = fork.use(types_1.default);
|
|
257323
|
+
var Type = types18.Type;
|
|
257324
|
+
var namedTypes = types18.namedTypes;
|
|
257125
257325
|
var Node3 = namedTypes.Node;
|
|
257126
257326
|
var Expression = namedTypes.Expression;
|
|
257127
|
-
var isArray2 =
|
|
257128
|
-
var b2 =
|
|
257327
|
+
var isArray2 = types18.builtInTypes.array;
|
|
257328
|
+
var b2 = types18.builders;
|
|
257129
257329
|
var Scope4 = function Scope22(path32, parentScope) {
|
|
257130
257330
|
if (!(this instanceof Scope22)) {
|
|
257131
257331
|
throw new Error("Scope constructor cannot be invoked without 'new'");
|
|
@@ -257188,7 +257388,7 @@ var require_scope4 = __commonJS5({
|
|
|
257188
257388
|
++index;
|
|
257189
257389
|
}
|
|
257190
257390
|
var name = prefix + index;
|
|
257191
|
-
return this.bindings[name] =
|
|
257391
|
+
return this.bindings[name] = types18.builders.identifier(name);
|
|
257192
257392
|
};
|
|
257193
257393
|
Sp.injectTemporary = function(identifier, init2) {
|
|
257194
257394
|
identifier || (identifier = this.declareTemporary());
|
|
@@ -257264,7 +257464,7 @@ var require_scope4 = __commonJS5({
|
|
|
257264
257464
|
bindings
|
|
257265
257465
|
);
|
|
257266
257466
|
} else if (Node3.check(node) && !Expression.check(node)) {
|
|
257267
|
-
|
|
257467
|
+
types18.eachField(node, function(name, child) {
|
|
257268
257468
|
var childPath = path32.get(name);
|
|
257269
257469
|
if (!pathHasValue(childPath, child)) {
|
|
257270
257470
|
throw new Error("");
|
|
@@ -257342,24 +257542,24 @@ var require_scope4 = __commonJS5({
|
|
|
257342
257542
|
addPattern(patternPath.get("argument"), bindings);
|
|
257343
257543
|
}
|
|
257344
257544
|
}
|
|
257345
|
-
function addTypePattern(patternPath,
|
|
257545
|
+
function addTypePattern(patternPath, types19) {
|
|
257346
257546
|
var pattern = patternPath.value;
|
|
257347
257547
|
namedTypes.Pattern.assert(pattern);
|
|
257348
257548
|
if (namedTypes.Identifier.check(pattern)) {
|
|
257349
|
-
if (hasOwn2.call(
|
|
257350
|
-
|
|
257549
|
+
if (hasOwn2.call(types19, pattern.name)) {
|
|
257550
|
+
types19[pattern.name].push(patternPath);
|
|
257351
257551
|
} else {
|
|
257352
|
-
|
|
257552
|
+
types19[pattern.name] = [patternPath];
|
|
257353
257553
|
}
|
|
257354
257554
|
}
|
|
257355
257555
|
}
|
|
257356
|
-
function addTypeParameter(parameterPath,
|
|
257556
|
+
function addTypeParameter(parameterPath, types19) {
|
|
257357
257557
|
var parameter = parameterPath.value;
|
|
257358
257558
|
FlowOrTSTypeParameterType.assert(parameter);
|
|
257359
|
-
if (hasOwn2.call(
|
|
257360
|
-
|
|
257559
|
+
if (hasOwn2.call(types19, parameter.name)) {
|
|
257560
|
+
types19[parameter.name].push(parameterPath);
|
|
257361
257561
|
} else {
|
|
257362
|
-
|
|
257562
|
+
types19[parameter.name] = [parameterPath];
|
|
257363
257563
|
}
|
|
257364
257564
|
}
|
|
257365
257565
|
Sp.lookup = function(name) {
|
|
@@ -257398,11 +257598,11 @@ var require_node_path4 = __commonJS5({
|
|
|
257398
257598
|
var scope_1 = tslib_1.__importDefault(require_scope4());
|
|
257399
257599
|
var shared_1 = require_shared4();
|
|
257400
257600
|
function nodePathPlugin(fork) {
|
|
257401
|
-
var
|
|
257402
|
-
var n2 =
|
|
257403
|
-
var b2 =
|
|
257404
|
-
var isNumber =
|
|
257405
|
-
var isArray2 =
|
|
257601
|
+
var types18 = fork.use(types_1.default);
|
|
257602
|
+
var n2 = types18.namedTypes;
|
|
257603
|
+
var b2 = types18.builders;
|
|
257604
|
+
var isNumber = types18.builtInTypes.number;
|
|
257605
|
+
var isArray2 = types18.builtInTypes.array;
|
|
257406
257606
|
var Path = fork.use(path_1.default);
|
|
257407
257607
|
var Scope4 = fork.use(scope_1.default);
|
|
257408
257608
|
var NodePath = function NodePath2(value, parentPath, name) {
|
|
@@ -257493,7 +257693,7 @@ var require_node_path4 = __commonJS5({
|
|
|
257493
257693
|
return scope || null;
|
|
257494
257694
|
};
|
|
257495
257695
|
NPp.getValueProperty = function(name) {
|
|
257496
|
-
return
|
|
257696
|
+
return types18.getFieldValue(this.value, name);
|
|
257497
257697
|
};
|
|
257498
257698
|
NPp.needsParens = function(assumeExpressionContext) {
|
|
257499
257699
|
var pp2 = this.parentPath;
|
|
@@ -257635,7 +257835,7 @@ var require_node_path4 = __commonJS5({
|
|
|
257635
257835
|
return node.some(containsCallExpression);
|
|
257636
257836
|
}
|
|
257637
257837
|
if (n2.Node.check(node)) {
|
|
257638
|
-
return
|
|
257838
|
+
return types18.someField(node, function(_name, child) {
|
|
257639
257839
|
return containsCallExpression(child);
|
|
257640
257840
|
});
|
|
257641
257841
|
}
|
|
@@ -257754,11 +257954,11 @@ var require_path_visitor4 = __commonJS5({
|
|
|
257754
257954
|
var shared_1 = require_shared4();
|
|
257755
257955
|
var hasOwn2 = Object.prototype.hasOwnProperty;
|
|
257756
257956
|
function pathVisitorPlugin(fork) {
|
|
257757
|
-
var
|
|
257957
|
+
var types18 = fork.use(types_1.default);
|
|
257758
257958
|
var NodePath = fork.use(node_path_1.default);
|
|
257759
|
-
var isArray2 =
|
|
257760
|
-
var isObject2 =
|
|
257761
|
-
var isFunction =
|
|
257959
|
+
var isArray2 = types18.builtInTypes.array;
|
|
257960
|
+
var isObject2 = types18.builtInTypes.object;
|
|
257961
|
+
var isFunction = types18.builtInTypes.function;
|
|
257762
257962
|
var undefined2;
|
|
257763
257963
|
var PathVisitor = function PathVisitor2() {
|
|
257764
257964
|
if (!(this instanceof PathVisitor2)) {
|
|
@@ -257778,7 +257978,7 @@ var require_path_visitor4 = __commonJS5({
|
|
|
257778
257978
|
typeNames[methodName.slice("visit".length)] = true;
|
|
257779
257979
|
}
|
|
257780
257980
|
}
|
|
257781
|
-
var supertypeTable =
|
|
257981
|
+
var supertypeTable = types18.computeSupertypeLookupTable(typeNames);
|
|
257782
257982
|
var methodNameTable = /* @__PURE__ */ Object.create(null);
|
|
257783
257983
|
var typeNameKeys = Object.keys(supertypeTable);
|
|
257784
257984
|
var typeNameCount = typeNameKeys.length;
|
|
@@ -257897,7 +258097,7 @@ var require_path_visitor4 = __commonJS5({
|
|
|
257897
258097
|
path32.each(visitor.visitWithoutReset, visitor);
|
|
257898
258098
|
} else if (!isObject2.check(value)) {
|
|
257899
258099
|
} else {
|
|
257900
|
-
var childNames =
|
|
258100
|
+
var childNames = types18.getFieldNames(value);
|
|
257901
258101
|
if (visitor._shouldVisitComments && value.comments && childNames.indexOf("comments") < 0) {
|
|
257902
258102
|
childNames.push("comments");
|
|
257903
258103
|
}
|
|
@@ -257906,7 +258106,7 @@ var require_path_visitor4 = __commonJS5({
|
|
|
257906
258106
|
for (var i22 = 0; i22 < childCount; ++i22) {
|
|
257907
258107
|
var childName = childNames[i22];
|
|
257908
258108
|
if (!hasOwn2.call(value, childName)) {
|
|
257909
|
-
value[childName] =
|
|
258109
|
+
value[childName] = types18.getFieldValue(value, childName);
|
|
257910
258110
|
}
|
|
257911
258111
|
childPaths.push(path32.get(childName));
|
|
257912
258112
|
}
|
|
@@ -258047,13 +258247,13 @@ var require_equiv4 = __commonJS5({
|
|
|
258047
258247
|
var shared_1 = require_shared4();
|
|
258048
258248
|
var types_1 = tslib_1.__importDefault(require_types4());
|
|
258049
258249
|
function default_1(fork) {
|
|
258050
|
-
var
|
|
258051
|
-
var getFieldNames =
|
|
258052
|
-
var getFieldValue =
|
|
258053
|
-
var isArray2 =
|
|
258054
|
-
var isObject2 =
|
|
258055
|
-
var isDate =
|
|
258056
|
-
var isRegExp =
|
|
258250
|
+
var types18 = fork.use(types_1.default);
|
|
258251
|
+
var getFieldNames = types18.getFieldNames;
|
|
258252
|
+
var getFieldValue = types18.getFieldValue;
|
|
258253
|
+
var isArray2 = types18.builtInTypes.array;
|
|
258254
|
+
var isObject2 = types18.builtInTypes.object;
|
|
258255
|
+
var isDate = types18.builtInTypes.Date;
|
|
258256
|
+
var isRegExp = types18.builtInTypes.RegExp;
|
|
258057
258257
|
var hasOwn2 = Object.prototype.hasOwnProperty;
|
|
258058
258258
|
function astNodesAreEquivalent(a2, b2, problemPath) {
|
|
258059
258259
|
if (isArray2.check(problemPath)) {
|
|
@@ -258204,24 +258404,24 @@ var require_fork4 = __commonJS5({
|
|
|
258204
258404
|
var shared_1 = require_shared4();
|
|
258205
258405
|
function default_1(plugins) {
|
|
258206
258406
|
var fork = createFork();
|
|
258207
|
-
var
|
|
258407
|
+
var types18 = fork.use(types_1.default);
|
|
258208
258408
|
plugins.forEach(fork.use);
|
|
258209
|
-
|
|
258409
|
+
types18.finalize();
|
|
258210
258410
|
var PathVisitor = fork.use(path_visitor_1.default);
|
|
258211
258411
|
return {
|
|
258212
|
-
Type:
|
|
258213
|
-
builtInTypes:
|
|
258214
|
-
namedTypes:
|
|
258215
|
-
builders:
|
|
258216
|
-
defineMethod:
|
|
258217
|
-
getFieldNames:
|
|
258218
|
-
getFieldValue:
|
|
258219
|
-
eachField:
|
|
258220
|
-
someField:
|
|
258221
|
-
getSupertypeNames:
|
|
258222
|
-
getBuilderName:
|
|
258412
|
+
Type: types18.Type,
|
|
258413
|
+
builtInTypes: types18.builtInTypes,
|
|
258414
|
+
namedTypes: types18.namedTypes,
|
|
258415
|
+
builders: types18.builders,
|
|
258416
|
+
defineMethod: types18.defineMethod,
|
|
258417
|
+
getFieldNames: types18.getFieldNames,
|
|
258418
|
+
getFieldValue: types18.getFieldValue,
|
|
258419
|
+
eachField: types18.eachField,
|
|
258420
|
+
someField: types18.someField,
|
|
258421
|
+
getSupertypeNames: types18.getSupertypeNames,
|
|
258422
|
+
getBuilderName: types18.getBuilderName,
|
|
258223
258423
|
astNodesAreEquivalent: fork.use(equiv_1.default),
|
|
258224
|
-
finalize:
|
|
258424
|
+
finalize: types18.finalize,
|
|
258225
258425
|
Path: fork.use(path_1.default),
|
|
258226
258426
|
NodePath: fork.use(node_path_1.default),
|
|
258227
258427
|
PathVisitor,
|
|
@@ -258381,8 +258581,8 @@ var require_core34 = __commonJS5({
|
|
|
258381
258581
|
var types_1 = tslib_1.__importDefault(require_types4());
|
|
258382
258582
|
var shared_1 = tslib_1.__importStar(require_shared4());
|
|
258383
258583
|
function default_1(fork) {
|
|
258384
|
-
var
|
|
258385
|
-
var Type =
|
|
258584
|
+
var types18 = fork.use(types_1.default);
|
|
258585
|
+
var Type = types18.Type;
|
|
258386
258586
|
var def = Type.def;
|
|
258387
258587
|
var or = Type.or;
|
|
258388
258588
|
var shared2 = fork.use(shared_1.default);
|
|
@@ -258472,9 +258672,9 @@ var require_es64 = __commonJS5({
|
|
|
258472
258672
|
var shared_1 = tslib_1.__importStar(require_shared4());
|
|
258473
258673
|
function default_1(fork) {
|
|
258474
258674
|
fork.use(core_1.default);
|
|
258475
|
-
var
|
|
258476
|
-
var def =
|
|
258477
|
-
var or =
|
|
258675
|
+
var types18 = fork.use(types_1.default);
|
|
258676
|
+
var def = types18.Type.def;
|
|
258677
|
+
var or = types18.Type.or;
|
|
258478
258678
|
var defaults = fork.use(shared_1.default).defaults;
|
|
258479
258679
|
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"]);
|
|
258480
258680
|
def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field(
|
|
@@ -258560,8 +258760,8 @@ var require_es20174 = __commonJS5({
|
|
|
258560
258760
|
var shared_1 = tslib_1.__importStar(require_shared4());
|
|
258561
258761
|
function default_1(fork) {
|
|
258562
258762
|
fork.use(es2016_1.default);
|
|
258563
|
-
var
|
|
258564
|
-
var def =
|
|
258763
|
+
var types18 = fork.use(types_1.default);
|
|
258764
|
+
var def = types18.Type.def;
|
|
258565
258765
|
var defaults = fork.use(shared_1.default).defaults;
|
|
258566
258766
|
def("Function").field("async", Boolean, defaults["false"]);
|
|
258567
258767
|
def("AwaitExpression").bases("Expression").build("argument").field("argument", def("Expression"));
|
|
@@ -258582,9 +258782,9 @@ var require_es20184 = __commonJS5({
|
|
|
258582
258782
|
var shared_1 = tslib_1.__importStar(require_shared4());
|
|
258583
258783
|
function default_1(fork) {
|
|
258584
258784
|
fork.use(es2017_1.default);
|
|
258585
|
-
var
|
|
258586
|
-
var def =
|
|
258587
|
-
var or =
|
|
258785
|
+
var types18 = fork.use(types_1.default);
|
|
258786
|
+
var def = types18.Type.def;
|
|
258787
|
+
var or = types18.Type.or;
|
|
258588
258788
|
var defaults = fork.use(shared_1.default).defaults;
|
|
258589
258789
|
def("ForOfStatement").field("await", Boolean, defaults["false"]);
|
|
258590
258790
|
def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
|
|
@@ -258613,9 +258813,9 @@ var require_es20194 = __commonJS5({
|
|
|
258613
258813
|
var shared_1 = tslib_1.__importStar(require_shared4());
|
|
258614
258814
|
function default_1(fork) {
|
|
258615
258815
|
fork.use(es2018_1.default);
|
|
258616
|
-
var
|
|
258617
|
-
var def =
|
|
258618
|
-
var or =
|
|
258816
|
+
var types18 = fork.use(types_1.default);
|
|
258817
|
+
var def = types18.Type.def;
|
|
258818
|
+
var or = types18.Type.or;
|
|
258619
258819
|
var defaults = fork.use(shared_1.default).defaults;
|
|
258620
258820
|
def("CatchClause").field("param", or(def("Pattern"), null), defaults["null"]);
|
|
258621
258821
|
}
|
|
@@ -258637,9 +258837,9 @@ var require_es202024 = __commonJS5({
|
|
|
258637
258837
|
function default_1(fork) {
|
|
258638
258838
|
fork.use(es2020_1.default);
|
|
258639
258839
|
fork.use(es2019_1.default);
|
|
258640
|
-
var
|
|
258641
|
-
var def =
|
|
258642
|
-
var or =
|
|
258840
|
+
var types18 = fork.use(types_1.default);
|
|
258841
|
+
var def = types18.Type.def;
|
|
258842
|
+
var or = types18.Type.or;
|
|
258643
258843
|
var shared2 = fork.use(shared_1.default);
|
|
258644
258844
|
var defaults = shared2.defaults;
|
|
258645
258845
|
def("ImportExpression").bases("Expression").build("source").field("source", def("Expression"));
|
|
@@ -258685,8 +258885,8 @@ var require_es20224 = __commonJS5({
|
|
|
258685
258885
|
var shared_1 = require_shared4();
|
|
258686
258886
|
function default_1(fork) {
|
|
258687
258887
|
fork.use(es2021_1.default);
|
|
258688
|
-
var
|
|
258689
|
-
var def =
|
|
258888
|
+
var types18 = fork.use(types_1.default);
|
|
258889
|
+
var def = types18.Type.def;
|
|
258690
258890
|
def("StaticBlock").bases("Declaration").build("body").field("body", [def("Statement")]);
|
|
258691
258891
|
}
|
|
258692
258892
|
exports.default = default_1;
|
|
@@ -258705,9 +258905,9 @@ var require_es_proposals4 = __commonJS5({
|
|
|
258705
258905
|
var es2022_1 = tslib_1.__importDefault(require_es20224());
|
|
258706
258906
|
function default_1(fork) {
|
|
258707
258907
|
fork.use(es2022_1.default);
|
|
258708
|
-
var
|
|
258709
|
-
var Type =
|
|
258710
|
-
var def =
|
|
258908
|
+
var types18 = fork.use(types_1.default);
|
|
258909
|
+
var Type = types18.Type;
|
|
258910
|
+
var def = types18.Type.def;
|
|
258711
258911
|
var or = Type.or;
|
|
258712
258912
|
var shared2 = fork.use(shared_1.default);
|
|
258713
258913
|
var defaults = shared2.defaults;
|
|
@@ -258745,9 +258945,9 @@ var require_jsx24 = __commonJS5({
|
|
|
258745
258945
|
var shared_1 = tslib_1.__importStar(require_shared4());
|
|
258746
258946
|
function default_1(fork) {
|
|
258747
258947
|
fork.use(es_proposals_1.default);
|
|
258748
|
-
var
|
|
258749
|
-
var def =
|
|
258750
|
-
var or =
|
|
258948
|
+
var types18 = fork.use(types_1.default);
|
|
258949
|
+
var def = types18.Type.def;
|
|
258950
|
+
var or = types18.Type.or;
|
|
258751
258951
|
var defaults = fork.use(shared_1.default).defaults;
|
|
258752
258952
|
def("JSXAttribute").bases("Node").build("name", "value").field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or(
|
|
258753
258953
|
def("Literal"),
|
|
@@ -258803,9 +259003,9 @@ var require_type_annotations4 = __commonJS5({
|
|
|
258803
259003
|
var types_1 = tslib_1.__importDefault(require_types4());
|
|
258804
259004
|
var shared_1 = tslib_1.__importStar(require_shared4());
|
|
258805
259005
|
function default_1(fork) {
|
|
258806
|
-
var
|
|
258807
|
-
var def =
|
|
258808
|
-
var or =
|
|
259006
|
+
var types18 = fork.use(types_1.default);
|
|
259007
|
+
var def = types18.Type.def;
|
|
259008
|
+
var or = types18.Type.or;
|
|
258809
259009
|
var defaults = fork.use(shared_1.default).defaults;
|
|
258810
259010
|
var TypeAnnotation = or(def("TypeAnnotation"), def("TSTypeAnnotation"), null);
|
|
258811
259011
|
var TypeParamDecl = or(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null);
|
|
@@ -258838,9 +259038,9 @@ var require_flow24 = __commonJS5({
|
|
|
258838
259038
|
function default_1(fork) {
|
|
258839
259039
|
fork.use(es_proposals_1.default);
|
|
258840
259040
|
fork.use(type_annotations_1.default);
|
|
258841
|
-
var
|
|
258842
|
-
var def =
|
|
258843
|
-
var or =
|
|
259041
|
+
var types18 = fork.use(types_1.default);
|
|
259042
|
+
var def = types18.Type.def;
|
|
259043
|
+
var or = types18.Type.or;
|
|
258844
259044
|
var defaults = fork.use(shared_1.default).defaults;
|
|
258845
259045
|
def("Flow").bases("Node");
|
|
258846
259046
|
def("FlowType").bases("Flow");
|
|
@@ -258952,10 +259152,10 @@ var require_esprima6 = __commonJS5({
|
|
|
258952
259152
|
var shared_1 = tslib_1.__importStar(require_shared4());
|
|
258953
259153
|
function default_1(fork) {
|
|
258954
259154
|
fork.use(es_proposals_1.default);
|
|
258955
|
-
var
|
|
259155
|
+
var types18 = fork.use(types_1.default);
|
|
258956
259156
|
var defaults = fork.use(shared_1.default).defaults;
|
|
258957
|
-
var def =
|
|
258958
|
-
var or =
|
|
259157
|
+
var def = types18.Type.def;
|
|
259158
|
+
var or = types18.Type.or;
|
|
258959
259159
|
def("VariableDeclaration").field("declarations", [or(
|
|
258960
259160
|
def("VariableDeclarator"),
|
|
258961
259161
|
def("Identifier")
|
|
@@ -258998,11 +259198,11 @@ var require_babel_core4 = __commonJS5({
|
|
|
258998
259198
|
function default_1(fork) {
|
|
258999
259199
|
var _a, _b, _c, _d, _e;
|
|
259000
259200
|
fork.use(es_proposals_1.default);
|
|
259001
|
-
var
|
|
259201
|
+
var types18 = fork.use(types_1.default);
|
|
259002
259202
|
var defaults = fork.use(shared_1.default).defaults;
|
|
259003
|
-
var def =
|
|
259004
|
-
var or =
|
|
259005
|
-
var isUndefined =
|
|
259203
|
+
var def = types18.Type.def;
|
|
259204
|
+
var or = types18.Type.or;
|
|
259205
|
+
var isUndefined = types18.builtInTypes.undefined;
|
|
259006
259206
|
def("Noop").bases("Statement").build();
|
|
259007
259207
|
def("DoExpression").bases("Expression").build("body").field("body", [def("Statement")]);
|
|
259008
259208
|
def("BindExpression").bases("Expression").build("object", "callee").field("object", or(def("Expression"), null)).field("callee", def("Expression"));
|
|
@@ -259027,7 +259227,7 @@ var require_babel_core4 = __commonJS5({
|
|
|
259027
259227
|
raw: String
|
|
259028
259228
|
},
|
|
259029
259229
|
function getDefault() {
|
|
259030
|
-
var value =
|
|
259230
|
+
var value = types18.getFieldValue(this, "value");
|
|
259031
259231
|
return {
|
|
259032
259232
|
rawValue: value,
|
|
259033
259233
|
raw: toRaw ? toRaw(value) : String(value)
|
|
@@ -259128,8 +259328,8 @@ var require_babel4 = __commonJS5({
|
|
|
259128
259328
|
var flow_1 = tslib_1.__importDefault(require_flow24());
|
|
259129
259329
|
var shared_1 = require_shared4();
|
|
259130
259330
|
function default_1(fork) {
|
|
259131
|
-
var
|
|
259132
|
-
var def =
|
|
259331
|
+
var types18 = fork.use(types_1.default);
|
|
259332
|
+
var def = types18.Type.def;
|
|
259133
259333
|
fork.use(babel_core_1.default);
|
|
259134
259334
|
fork.use(flow_1.default);
|
|
259135
259335
|
def("V8IntrinsicIdentifier").bases("Expression").build("name").field("name", String);
|
|
@@ -259153,12 +259353,12 @@ var require_typescript24 = __commonJS5({
|
|
|
259153
259353
|
function default_1(fork) {
|
|
259154
259354
|
fork.use(babel_core_1.default);
|
|
259155
259355
|
fork.use(type_annotations_1.default);
|
|
259156
|
-
var
|
|
259157
|
-
var n2 =
|
|
259158
|
-
var def =
|
|
259159
|
-
var or =
|
|
259356
|
+
var types18 = fork.use(types_1.default);
|
|
259357
|
+
var n2 = types18.namedTypes;
|
|
259358
|
+
var def = types18.Type.def;
|
|
259359
|
+
var or = types18.Type.or;
|
|
259160
259360
|
var defaults = fork.use(shared_1.default).defaults;
|
|
259161
|
-
var StringLiteral =
|
|
259361
|
+
var StringLiteral = types18.Type.from(function(value, deep) {
|
|
259162
259362
|
if (n2.StringLiteral && n2.StringLiteral.check(value, deep)) {
|
|
259163
259363
|
return true;
|
|
259164
259364
|
}
|
|
@@ -261106,8 +261306,8 @@ var require_util24 = __commonJS5({
|
|
|
261106
261306
|
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;
|
|
261107
261307
|
var tslib_1 = require_tslib4();
|
|
261108
261308
|
var assert_1 = tslib_1.__importDefault(__require4("assert"));
|
|
261109
|
-
var
|
|
261110
|
-
var n2 =
|
|
261309
|
+
var types18 = tslib_1.__importStar(require_main5());
|
|
261310
|
+
var n2 = types18.namedTypes;
|
|
261111
261311
|
var source_map_1 = tslib_1.__importDefault(require_source_map4());
|
|
261112
261312
|
var SourceMapConsumer = source_map_1.default.SourceMapConsumer;
|
|
261113
261313
|
var SourceMapGenerator = source_map_1.default.SourceMapGenerator;
|
|
@@ -268413,10 +268613,10 @@ var require_comments4 = __commonJS5({
|
|
|
268413
268613
|
exports.printComments = exports.attach = void 0;
|
|
268414
268614
|
var tslib_1 = require_tslib4();
|
|
268415
268615
|
var assert_1 = tslib_1.__importDefault(__require4("assert"));
|
|
268416
|
-
var
|
|
268417
|
-
var n2 =
|
|
268418
|
-
var isArray2 =
|
|
268419
|
-
var isObject2 =
|
|
268616
|
+
var types18 = tslib_1.__importStar(require_main5());
|
|
268617
|
+
var n2 = types18.namedTypes;
|
|
268618
|
+
var isArray2 = types18.builtInTypes.array;
|
|
268619
|
+
var isObject2 = types18.builtInTypes.object;
|
|
268420
268620
|
var lines_1 = require_lines4();
|
|
268421
268621
|
var util_1 = require_util24();
|
|
268422
268622
|
var childNodesCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -268447,7 +268647,7 @@ var require_comments4 = __commonJS5({
|
|
|
268447
268647
|
if (isArray2.check(node)) {
|
|
268448
268648
|
names = Object.keys(node);
|
|
268449
268649
|
} else if (isObject2.check(node)) {
|
|
268450
|
-
names =
|
|
268650
|
+
names = types18.getFieldNames(node);
|
|
268451
268651
|
} else {
|
|
268452
268652
|
return resultArray;
|
|
268453
268653
|
}
|
|
@@ -268625,7 +268825,7 @@ var require_comments4 = __commonJS5({
|
|
|
268625
268825
|
function printComments(path32, print132) {
|
|
268626
268826
|
var value = path32.getValue();
|
|
268627
268827
|
var innerLines = print132(path32);
|
|
268628
|
-
var comments = n2.Node.check(value) &&
|
|
268828
|
+
var comments = n2.Node.check(value) && types18.getFieldValue(value, "comments");
|
|
268629
268829
|
if (!comments || comments.length === 0) {
|
|
268630
268830
|
return innerLines;
|
|
268631
268831
|
}
|
|
@@ -268633,8 +268833,8 @@ var require_comments4 = __commonJS5({
|
|
|
268633
268833
|
var trailingParts = [innerLines];
|
|
268634
268834
|
path32.each(function(commentPath) {
|
|
268635
268835
|
var comment = commentPath.getValue();
|
|
268636
|
-
var leading =
|
|
268637
|
-
var trailing =
|
|
268836
|
+
var leading = types18.getFieldValue(comment, "leading");
|
|
268837
|
+
var trailing = types18.getFieldValue(comment, "trailing");
|
|
268638
268838
|
if (leading || trailing && !(n2.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
268639
268839
|
leadingParts.push(printLeadingComment(commentPath, print132));
|
|
268640
268840
|
} else if (trailing) {
|
|
@@ -268654,10 +268854,10 @@ var require_parser4 = __commonJS5({
|
|
|
268654
268854
|
exports.parse = void 0;
|
|
268655
268855
|
var tslib_1 = require_tslib4();
|
|
268656
268856
|
var assert_1 = tslib_1.__importDefault(__require4("assert"));
|
|
268657
|
-
var
|
|
268658
|
-
var b2 =
|
|
268659
|
-
var isObject2 =
|
|
268660
|
-
var isArray2 =
|
|
268857
|
+
var types18 = tslib_1.__importStar(require_main5());
|
|
268858
|
+
var b2 = types18.builders;
|
|
268859
|
+
var isObject2 = types18.builtInTypes.object;
|
|
268860
|
+
var isArray2 = types18.builtInTypes.array;
|
|
268661
268861
|
var options_1 = require_options4();
|
|
268662
268862
|
var lines_1 = require_lines4();
|
|
268663
268863
|
var comments_1 = require_comments4();
|
|
@@ -268841,11 +269041,11 @@ var require_fast_path4 = __commonJS5({
|
|
|
268841
269041
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
268842
269042
|
var tslib_1 = require_tslib4();
|
|
268843
269043
|
var assert_1 = tslib_1.__importDefault(__require4("assert"));
|
|
268844
|
-
var
|
|
269044
|
+
var types18 = tslib_1.__importStar(require_main5());
|
|
268845
269045
|
var util = tslib_1.__importStar(require_util24());
|
|
268846
|
-
var n2 =
|
|
268847
|
-
var isArray2 =
|
|
268848
|
-
var isNumber =
|
|
269046
|
+
var n2 = types18.namedTypes;
|
|
269047
|
+
var isArray2 = types18.builtInTypes.array;
|
|
269048
|
+
var isNumber = types18.builtInTypes.number;
|
|
268849
269049
|
var PRECEDENCE = {};
|
|
268850
269050
|
[
|
|
268851
269051
|
["??"],
|
|
@@ -268874,7 +269074,7 @@ var require_fast_path4 = __commonJS5({
|
|
|
268874
269074
|
if (obj instanceof FastPath) {
|
|
268875
269075
|
return obj.copy();
|
|
268876
269076
|
}
|
|
268877
|
-
if (obj instanceof
|
|
269077
|
+
if (obj instanceof types18.NodePath) {
|
|
268878
269078
|
var copy = Object.create(FastPath.prototype);
|
|
268879
269079
|
var stack = [obj.value];
|
|
268880
269080
|
for (var pp2 = void 0; pp2 = obj.parentPath; obj = pp2)
|
|
@@ -269185,7 +269385,7 @@ var require_fast_path4 = __commonJS5({
|
|
|
269185
269385
|
return node.some(containsCallExpression);
|
|
269186
269386
|
}
|
|
269187
269387
|
if (n2.Node.check(node)) {
|
|
269188
|
-
return
|
|
269388
|
+
return types18.someField(node, function(_name, child) {
|
|
269189
269389
|
return containsCallExpression(child);
|
|
269190
269390
|
});
|
|
269191
269391
|
}
|
|
@@ -269273,16 +269473,16 @@ var require_patcher4 = __commonJS5({
|
|
|
269273
269473
|
var tslib_1 = require_tslib4();
|
|
269274
269474
|
var assert_1 = tslib_1.__importDefault(__require4("assert"));
|
|
269275
269475
|
var linesModule = tslib_1.__importStar(require_lines4());
|
|
269276
|
-
var
|
|
269277
|
-
var Printable =
|
|
269278
|
-
var Expression =
|
|
269279
|
-
var ReturnStatement =
|
|
269280
|
-
var SourceLocation3 =
|
|
269476
|
+
var types18 = tslib_1.__importStar(require_main5());
|
|
269477
|
+
var Printable = types18.namedTypes.Printable;
|
|
269478
|
+
var Expression = types18.namedTypes.Expression;
|
|
269479
|
+
var ReturnStatement = types18.namedTypes.ReturnStatement;
|
|
269480
|
+
var SourceLocation3 = types18.namedTypes.SourceLocation;
|
|
269281
269481
|
var util_1 = require_util24();
|
|
269282
269482
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path4());
|
|
269283
|
-
var isObject2 =
|
|
269284
|
-
var isArray2 =
|
|
269285
|
-
var isString =
|
|
269483
|
+
var isObject2 = types18.builtInTypes.object;
|
|
269484
|
+
var isArray2 = types18.builtInTypes.array;
|
|
269485
|
+
var isString = types18.builtInTypes.string;
|
|
269286
269486
|
var riskyAdjoiningCharExp = /[0-9a-z_$]/i;
|
|
269287
269487
|
var Patcher = function Patcher2(lines) {
|
|
269288
269488
|
assert_1.default.ok(this instanceof Patcher2);
|
|
@@ -269552,8 +269752,8 @@ var require_patcher4 = __commonJS5({
|
|
|
269552
269752
|
if (k2.charAt(0) === "_") {
|
|
269553
269753
|
continue;
|
|
269554
269754
|
}
|
|
269555
|
-
newPath.stack.push(k2,
|
|
269556
|
-
oldPath.stack.push(k2,
|
|
269755
|
+
newPath.stack.push(k2, types18.getFieldValue(newNode, k2));
|
|
269756
|
+
oldPath.stack.push(k2, types18.getFieldValue(oldNode, k2));
|
|
269557
269757
|
var canReprint = findAnyReprints(newPath, oldPath, reprints);
|
|
269558
269758
|
newPath.stack.length -= 2;
|
|
269559
269759
|
oldPath.stack.length -= 2;
|
|
@@ -269575,16 +269775,16 @@ var require_printer4 = __commonJS5({
|
|
|
269575
269775
|
exports.Printer = void 0;
|
|
269576
269776
|
var tslib_1 = require_tslib4();
|
|
269577
269777
|
var assert_1 = tslib_1.__importDefault(__require4("assert"));
|
|
269578
|
-
var
|
|
269778
|
+
var types18 = tslib_1.__importStar(require_main5());
|
|
269579
269779
|
var comments_1 = require_comments4();
|
|
269580
269780
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path4());
|
|
269581
269781
|
var lines_1 = require_lines4();
|
|
269582
269782
|
var options_1 = require_options4();
|
|
269583
269783
|
var patcher_1 = require_patcher4();
|
|
269584
269784
|
var util = tslib_1.__importStar(require_util24());
|
|
269585
|
-
var namedTypes =
|
|
269586
|
-
var isString =
|
|
269587
|
-
var isObject2 =
|
|
269785
|
+
var namedTypes = types18.namedTypes;
|
|
269786
|
+
var isString = types18.builtInTypes.string;
|
|
269787
|
+
var isObject2 = types18.builtInTypes.object;
|
|
269588
269788
|
var PrintResult = function PrintResult2(code, sourceMap) {
|
|
269589
269789
|
assert_1.default.ok(this instanceof PrintResult2);
|
|
269590
269790
|
isString.assert(code);
|
|
@@ -269746,7 +269946,7 @@ var require_printer4 = __commonJS5({
|
|
|
269746
269946
|
case "OptionalMemberExpression": {
|
|
269747
269947
|
parts.push(path32.call(print132, "object"));
|
|
269748
269948
|
var property = path32.call(print132, "property");
|
|
269749
|
-
var optional =
|
|
269949
|
+
var optional = types18.getFieldValue(n2, "optional");
|
|
269750
269950
|
if (n2.computed) {
|
|
269751
269951
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
269752
269952
|
} else {
|
|
@@ -270017,7 +270217,7 @@ var require_printer4 = __commonJS5({
|
|
|
270017
270217
|
if (n2.typeArguments) {
|
|
270018
270218
|
parts.push(path32.call(print132, "typeArguments"));
|
|
270019
270219
|
}
|
|
270020
|
-
if (
|
|
270220
|
+
if (types18.getFieldValue(n2, "optional")) {
|
|
270021
270221
|
parts.push("?.");
|
|
270022
270222
|
}
|
|
270023
270223
|
parts.push(printArgumentsList(path32, options, print132));
|
|
@@ -271696,8 +271896,8 @@ var require_printer4 = __commonJS5({
|
|
|
271696
271896
|
});
|
|
271697
271897
|
}
|
|
271698
271898
|
function getPossibleRaw(node) {
|
|
271699
|
-
var value =
|
|
271700
|
-
var extra =
|
|
271899
|
+
var value = types18.getFieldValue(node, "value");
|
|
271900
|
+
var extra = types18.getFieldValue(node, "extra");
|
|
271701
271901
|
if (extra && typeof extra.raw === "string" && value == extra.rawValue) {
|
|
271702
271902
|
return extra.raw;
|
|
271703
271903
|
}
|
|
@@ -271743,8 +271943,8 @@ var require_main24 = __commonJS5({
|
|
|
271743
271943
|
exports.run = exports.prettyPrint = exports.print = exports.visit = exports.types = exports.parse = void 0;
|
|
271744
271944
|
var tslib_1 = require_tslib4();
|
|
271745
271945
|
var fs_1 = tslib_1.__importDefault(__require4("fs"));
|
|
271746
|
-
var
|
|
271747
|
-
exports.types =
|
|
271946
|
+
var types18 = tslib_1.__importStar(require_main5());
|
|
271947
|
+
exports.types = types18;
|
|
271748
271948
|
var parser_1 = require_parser4();
|
|
271749
271949
|
Object.defineProperty(exports, "parse", { enumerable: true, get: function() {
|
|
271750
271950
|
return parser_1.parse;
|
|
@@ -272404,7 +272604,7 @@ var printDocASTReducer4 = {
|
|
|
272404
272604
|
leave: ({ name, interfaces, directives, fields }) => join5(["interface", name, wrap4("implements ", join5(interfaces, " & ")), join5(directives, " "), block4(fields)], " ")
|
|
272405
272605
|
},
|
|
272406
272606
|
UnionTypeDefinition: {
|
|
272407
|
-
leave: ({ name, directives, types:
|
|
272607
|
+
leave: ({ name, directives, types: types18 }) => join5(["union", name, join5(directives, " "), wrap4("= ", join5(types18, " | "))], " ")
|
|
272408
272608
|
},
|
|
272409
272609
|
EnumTypeDefinition: {
|
|
272410
272610
|
leave: ({ name, directives, values }) => join5(["enum", name, join5(directives, " "), block4(values)], " ")
|
|
@@ -272431,7 +272631,7 @@ var printDocASTReducer4 = {
|
|
|
272431
272631
|
leave: ({ name, interfaces, directives, fields }) => join5(["extend interface", name, wrap4("implements ", join5(interfaces, " & ")), join5(directives, " "), block4(fields)], " ")
|
|
272432
272632
|
},
|
|
272433
272633
|
UnionTypeExtension: {
|
|
272434
|
-
leave: ({ name, directives, types:
|
|
272634
|
+
leave: ({ name, directives, types: types18 }) => join5(["extend union", name, join5(directives, " "), wrap4("= ", join5(types18, " | "))], " ")
|
|
272435
272635
|
},
|
|
272436
272636
|
EnumTypeExtension: {
|
|
272437
272637
|
leave: ({ name, directives, values }) => join5(["extend enum", name, join5(directives, " "), block4(values)], " ")
|
|
@@ -273846,7 +274046,18 @@ var ListManager4 = class {
|
|
|
273846
274046
|
}
|
|
273847
274047
|
lists = /* @__PURE__ */ new Map();
|
|
273848
274048
|
listsByField = /* @__PURE__ */ new Map();
|
|
273849
|
-
get(listName, id2, allLists) {
|
|
274049
|
+
get(listName, id2, allLists, skipMatches) {
|
|
274050
|
+
const lists = this.getLists(listName, id2, allLists);
|
|
274051
|
+
if (!lists) {
|
|
274052
|
+
return null;
|
|
274053
|
+
}
|
|
274054
|
+
if (skipMatches) {
|
|
274055
|
+
return new ListCollection4(lists.lists.filter((list3) => !skipMatches.has(list3.fieldRef)));
|
|
274056
|
+
} else {
|
|
274057
|
+
return lists;
|
|
274058
|
+
}
|
|
274059
|
+
}
|
|
274060
|
+
getLists(listName, id2, allLists) {
|
|
273850
274061
|
const matches = this.lists.get(listName);
|
|
273851
274062
|
if (!matches || matches.size === 0) {
|
|
273852
274063
|
return null;
|
|
@@ -273968,6 +274179,9 @@ var List4 = class {
|
|
|
273968
274179
|
this.manager = manager;
|
|
273969
274180
|
this.abstract = abstract;
|
|
273970
274181
|
}
|
|
274182
|
+
get fieldRef() {
|
|
274183
|
+
return `${this.recordID}.${this.key}`;
|
|
274184
|
+
}
|
|
273971
274185
|
when(when) {
|
|
273972
274186
|
return this.manager.lists.get(this.name).get(this.recordID).when(when);
|
|
273973
274187
|
}
|
|
@@ -275112,8 +275326,8 @@ var Cache4 = class {
|
|
|
275112
275326
|
variables
|
|
275113
275327
|
);
|
|
275114
275328
|
}
|
|
275115
|
-
list(name, parentID, allLists) {
|
|
275116
|
-
const handler = this._internal_unstable.lists.get(name, parentID, allLists);
|
|
275329
|
+
list(name, parentID, allLists, skipMatches) {
|
|
275330
|
+
const handler = this._internal_unstable.lists.get(name, parentID, allLists, skipMatches);
|
|
275117
275331
|
if (!handler) {
|
|
275118
275332
|
throw new Error(
|
|
275119
275333
|
`Cannot find list with name: ${name}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -275528,6 +275742,7 @@ var CacheInternal4 = class {
|
|
|
275528
275742
|
});
|
|
275529
275743
|
}
|
|
275530
275744
|
}
|
|
275745
|
+
const processedOperations = /* @__PURE__ */ new Set();
|
|
275531
275746
|
for (const operation of operations || []) {
|
|
275532
275747
|
let parentID;
|
|
275533
275748
|
if (operation.parentID) {
|
|
@@ -275547,7 +275762,12 @@ var CacheInternal4 = class {
|
|
|
275547
275762
|
const targets = Array.isArray(value) ? value : [value];
|
|
275548
275763
|
for (const target of targets) {
|
|
275549
275764
|
if (operation.action === "insert" && target instanceof Object && fieldSelection && operation.list) {
|
|
275550
|
-
this.cache.list(
|
|
275765
|
+
this.cache.list(
|
|
275766
|
+
operation.list,
|
|
275767
|
+
parentID,
|
|
275768
|
+
operation.target === "all",
|
|
275769
|
+
processedOperations
|
|
275770
|
+
).when(operation.when).addToList(
|
|
275551
275771
|
fieldSelection,
|
|
275552
275772
|
target,
|
|
275553
275773
|
variables,
|
|
@@ -275555,7 +275775,12 @@ var CacheInternal4 = class {
|
|
|
275555
275775
|
layer
|
|
275556
275776
|
);
|
|
275557
275777
|
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
275558
|
-
this.cache.list(
|
|
275778
|
+
this.cache.list(
|
|
275779
|
+
operation.list,
|
|
275780
|
+
parentID,
|
|
275781
|
+
operation.target === "all",
|
|
275782
|
+
processedOperations
|
|
275783
|
+
).when(operation.when).toggleElement({
|
|
275559
275784
|
selection: fieldSelection,
|
|
275560
275785
|
data: target,
|
|
275561
275786
|
variables,
|
|
@@ -275563,7 +275788,12 @@ var CacheInternal4 = class {
|
|
|
275563
275788
|
layer
|
|
275564
275789
|
});
|
|
275565
275790
|
} else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
|
|
275566
|
-
this.cache.list(
|
|
275791
|
+
this.cache.list(
|
|
275792
|
+
operation.list,
|
|
275793
|
+
parentID,
|
|
275794
|
+
operation.target === "all",
|
|
275795
|
+
processedOperations
|
|
275796
|
+
).when(operation.when).remove(target, variables, layer);
|
|
275567
275797
|
} else if (operation.action === "delete" && operation.type && target) {
|
|
275568
275798
|
const targetID = this.id(operation.type, target);
|
|
275569
275799
|
if (!targetID) {
|
|
@@ -275575,6 +275805,16 @@ var CacheInternal4 = class {
|
|
|
275575
275805
|
this.cache.delete(targetID, layer);
|
|
275576
275806
|
}
|
|
275577
275807
|
}
|
|
275808
|
+
if (operation.list) {
|
|
275809
|
+
const matchingLists = this.cache.list(
|
|
275810
|
+
operation.list,
|
|
275811
|
+
parentID,
|
|
275812
|
+
operation.target === "all"
|
|
275813
|
+
);
|
|
275814
|
+
for (const list3 of matchingLists.lists) {
|
|
275815
|
+
processedOperations.add(list3.fieldRef);
|
|
275816
|
+
}
|
|
275817
|
+
}
|
|
275578
275818
|
}
|
|
275579
275819
|
}
|
|
275580
275820
|
return toNotify;
|
|
@@ -276040,6 +276280,46 @@ var { keys: keys3 } = Object;
|
|
|
276040
276280
|
var recast43 = __toESM5(require_main24(), 1);
|
|
276041
276281
|
var AST43 = recast43.types.builders;
|
|
276042
276282
|
var pageInfoSelection3 = [
|
|
276283
|
+
{
|
|
276284
|
+
kind: graphql133.Kind.FIELD,
|
|
276285
|
+
name: {
|
|
276286
|
+
kind: graphql133.Kind.NAME,
|
|
276287
|
+
value: "pageInfo"
|
|
276288
|
+
},
|
|
276289
|
+
selectionSet: {
|
|
276290
|
+
kind: graphql133.Kind.SELECTION_SET,
|
|
276291
|
+
selections: [
|
|
276292
|
+
{
|
|
276293
|
+
kind: graphql133.Kind.FIELD,
|
|
276294
|
+
name: {
|
|
276295
|
+
kind: graphql133.Kind.NAME,
|
|
276296
|
+
value: "hasPreviousPage"
|
|
276297
|
+
}
|
|
276298
|
+
},
|
|
276299
|
+
{
|
|
276300
|
+
kind: graphql133.Kind.FIELD,
|
|
276301
|
+
name: {
|
|
276302
|
+
kind: graphql133.Kind.NAME,
|
|
276303
|
+
value: "hasNextPage"
|
|
276304
|
+
}
|
|
276305
|
+
},
|
|
276306
|
+
{
|
|
276307
|
+
kind: graphql133.Kind.FIELD,
|
|
276308
|
+
name: {
|
|
276309
|
+
kind: graphql133.Kind.NAME,
|
|
276310
|
+
value: "startCursor"
|
|
276311
|
+
}
|
|
276312
|
+
},
|
|
276313
|
+
{
|
|
276314
|
+
kind: graphql133.Kind.FIELD,
|
|
276315
|
+
name: {
|
|
276316
|
+
kind: graphql133.Kind.NAME,
|
|
276317
|
+
value: "endCursor"
|
|
276318
|
+
}
|
|
276319
|
+
}
|
|
276320
|
+
]
|
|
276321
|
+
}
|
|
276322
|
+
},
|
|
276043
276323
|
{
|
|
276044
276324
|
kind: graphql133.Kind.FIELD,
|
|
276045
276325
|
name: {
|
|
@@ -276310,7 +276590,7 @@ var printDocASTReducer22 = {
|
|
|
276310
276590
|
], " ")
|
|
276311
276591
|
},
|
|
276312
276592
|
UnionTypeDefinition: {
|
|
276313
|
-
leave: ({ name, directives, types:
|
|
276593
|
+
leave: ({ name, directives, types: types18 }) => join32(["union", name, join32(directives, " "), wrap22("= ", join32(types18, " | "))], " ")
|
|
276314
276594
|
},
|
|
276315
276595
|
EnumTypeDefinition: {
|
|
276316
276596
|
leave: ({ name, directives, values }) => join32(["enum", name, join32(directives, " "), block22(values)], " ")
|
|
@@ -276349,7 +276629,7 @@ var printDocASTReducer22 = {
|
|
|
276349
276629
|
], " ")
|
|
276350
276630
|
},
|
|
276351
276631
|
UnionTypeExtension: {
|
|
276352
|
-
leave: ({ name, directives, types:
|
|
276632
|
+
leave: ({ name, directives, types: types18 }) => join32(["extend union", name, join32(directives, " "), wrap22("= ", join32(types18, " | "))], " ")
|
|
276353
276633
|
},
|
|
276354
276634
|
EnumTypeExtension: {
|
|
276355
276635
|
leave: ({ name, directives, values }) => join32(["extend enum", name, join32(directives, " "), block22(values)], " ")
|
|
@@ -276386,6 +276666,8 @@ For more information, please visit these links:
|
|
|
276386
276666
|
- https://graphql.org/learn/global-object-identification/
|
|
276387
276667
|
- ${siteURL3}/guides/caching-data#custom-ids
|
|
276388
276668
|
`;
|
|
276669
|
+
var recast142 = __toESM5(require_main24(), 1);
|
|
276670
|
+
var AST142 = recast142.types.builders;
|
|
276389
276671
|
function find_insert_index(script) {
|
|
276390
276672
|
let insert_index = script.body.findIndex((statement) => {
|
|
276391
276673
|
return statement.type !== "ImportDeclaration";
|
|
@@ -276404,7 +276686,7 @@ function find_exported_fn(body, name) {
|
|
|
276404
276686
|
if (exportDeclaration.declaration?.type === "FunctionDeclaration") {
|
|
276405
276687
|
const value = exportDeclaration.declaration;
|
|
276406
276688
|
if (value.id?.name === name) {
|
|
276407
|
-
return exportDeclaration.declaration;
|
|
276689
|
+
return { declaration: exportDeclaration.declaration, export: exportDeclaration };
|
|
276408
276690
|
}
|
|
276409
276691
|
} else if (exportDeclaration.declaration?.type === "VariableDeclaration") {
|
|
276410
276692
|
const value = exportDeclaration.declaration;
|
|
@@ -276423,7 +276705,10 @@ function find_exported_fn(body, name) {
|
|
|
276423
276705
|
init2 = init2.arguments[0];
|
|
276424
276706
|
}
|
|
276425
276707
|
if (init2.type === "FunctionExpression" || init2.type === "ArrowFunctionExpression") {
|
|
276426
|
-
return init2;
|
|
276708
|
+
return { declaration: init2, export: exportDeclaration };
|
|
276709
|
+
}
|
|
276710
|
+
if (init2.type === "Identifier" || init2.type === "CallExpression") {
|
|
276711
|
+
return { declaration: init2, export: exportDeclaration };
|
|
276427
276712
|
}
|
|
276428
276713
|
} else {
|
|
276429
276714
|
continue;
|
|
@@ -276435,10 +276720,10 @@ function find_exported_fn(body, name) {
|
|
|
276435
276720
|
if (!exported) {
|
|
276436
276721
|
return null;
|
|
276437
276722
|
}
|
|
276438
|
-
return exported.declaration;
|
|
276723
|
+
return { declaration: exported.declaration, export: exported };
|
|
276439
276724
|
}
|
|
276440
|
-
var
|
|
276441
|
-
var
|
|
276725
|
+
var recast152 = __toESM5(require_main24(), 1);
|
|
276726
|
+
var AST152 = recast152.types.builders;
|
|
276442
276727
|
function ensure_imports({
|
|
276443
276728
|
config: config2,
|
|
276444
276729
|
script,
|
|
@@ -276454,13 +276739,13 @@ function ensure_imports({
|
|
|
276454
276739
|
if (!has_import) {
|
|
276455
276740
|
script.body.unshift({
|
|
276456
276741
|
type: "ImportDeclaration",
|
|
276457
|
-
source:
|
|
276742
|
+
source: AST152.stringLiteral(sourceModule),
|
|
276458
276743
|
importKind
|
|
276459
276744
|
});
|
|
276460
276745
|
}
|
|
276461
276746
|
return { ids: [], added: has_import ? 0 : 1 };
|
|
276462
276747
|
}
|
|
276463
|
-
const idList = (Array.isArray(importID) ? importID : [importID]).map((id2) =>
|
|
276748
|
+
const idList = (Array.isArray(importID) ? importID : [importID]).map((id2) => AST152.identifier(id2));
|
|
276464
276749
|
const toImport = idList.filter(
|
|
276465
276750
|
(identifier) => !script.body.find(
|
|
276466
276751
|
(statement) => statement.type === "ImportDeclaration" && statement.specifiers?.find(
|
|
@@ -276471,16 +276756,16 @@ function ensure_imports({
|
|
|
276471
276756
|
if (toImport.length > 0) {
|
|
276472
276757
|
script.body.unshift({
|
|
276473
276758
|
type: "ImportDeclaration",
|
|
276474
|
-
source:
|
|
276759
|
+
source: AST152.stringLiteral(sourceModule),
|
|
276475
276760
|
specifiers: toImport.map(
|
|
276476
|
-
(identifier, i22) => !Array.isArray(importID) ?
|
|
276761
|
+
(identifier, i22) => !Array.isArray(importID) ? AST152.importDefaultSpecifier(identifier) : AST152.importSpecifier(identifier, as?.[i22] ? AST152.identifier(as[i22]) : identifier)
|
|
276477
276762
|
),
|
|
276478
276763
|
importKind
|
|
276479
276764
|
});
|
|
276480
276765
|
}
|
|
276481
276766
|
for (const [i22, target] of (as ?? []).entries()) {
|
|
276482
276767
|
if (target) {
|
|
276483
|
-
idList[i22] =
|
|
276768
|
+
idList[i22] = AST152.identifier(target);
|
|
276484
276769
|
}
|
|
276485
276770
|
}
|
|
276486
276771
|
return {
|
|
@@ -295077,24 +295362,28 @@ function add_load_return(page, properties) {
|
|
|
295077
295362
|
} else {
|
|
295078
295363
|
return_statement = AST20.returnStatement(AST20.objectExpression([]));
|
|
295079
295364
|
body.body.push(return_statement);
|
|
295080
|
-
return_statement_index = body.body.length - 1;
|
|
295081
295365
|
}
|
|
295082
|
-
|
|
295083
|
-
|
|
295084
|
-
|
|
295085
|
-
|
|
295086
|
-
|
|
295087
|
-
|
|
295088
|
-
|
|
295089
|
-
|
|
295090
|
-
|
|
295091
|
-
|
|
295092
|
-
|
|
295366
|
+
return walk(body, {
|
|
295367
|
+
enter(node) {
|
|
295368
|
+
if (node.type === "ReturnStatement") {
|
|
295369
|
+
const returnedValue = node.argument;
|
|
295370
|
+
this.replace(
|
|
295371
|
+
AST20.returnStatement(
|
|
295372
|
+
AST20.objectExpression([
|
|
295373
|
+
...properties(event_id),
|
|
295374
|
+
AST20.spreadElement(returnedValue ?? AST20.objectExpression([]))
|
|
295375
|
+
])
|
|
295376
|
+
)
|
|
295377
|
+
);
|
|
295378
|
+
}
|
|
295379
|
+
}
|
|
295380
|
+
});
|
|
295093
295381
|
});
|
|
295094
295382
|
}
|
|
295095
295383
|
function modify_load(page, cb) {
|
|
295096
|
-
let
|
|
295384
|
+
let exported = find_exported_fn(page.script.body, "load");
|
|
295097
295385
|
let event_id = AST20.identifier("event");
|
|
295386
|
+
let load_fn = exported?.declaration || null;
|
|
295098
295387
|
let body = AST20.blockStatement([]);
|
|
295099
295388
|
if (load_fn?.type === "ArrowFunctionExpression") {
|
|
295100
295389
|
if (load_fn.body.type === "BlockStatement") {
|
|
@@ -295103,7 +295392,7 @@ function modify_load(page, cb) {
|
|
|
295103
295392
|
body = AST20.blockStatement([AST20.returnStatement(load_fn.body)]);
|
|
295104
295393
|
load_fn.body = body;
|
|
295105
295394
|
}
|
|
295106
|
-
} else if (load_fn) {
|
|
295395
|
+
} else if (load_fn && "body" in load_fn) {
|
|
295107
295396
|
body = load_fn.body;
|
|
295108
295397
|
}
|
|
295109
295398
|
if (!load_fn) {
|
|
@@ -295119,6 +295408,30 @@ function modify_load(page, cb) {
|
|
|
295119
295408
|
AST20.exportNamedDeclaration(load_fn)
|
|
295120
295409
|
);
|
|
295121
295410
|
body = load_fn.body;
|
|
295411
|
+
} else if (load_fn.type === "CallExpression" || load_fn.type === "Identifier") {
|
|
295412
|
+
const exportStatement = exported?.export;
|
|
295413
|
+
if (!exportStatement) {
|
|
295414
|
+
return;
|
|
295415
|
+
}
|
|
295416
|
+
const intermediateID = AST20.identifier("houdini__intermediate__load__");
|
|
295417
|
+
page.script.body.push(
|
|
295418
|
+
AST20.variableDeclaration("const", [AST20.variableDeclarator(intermediateID, load_fn)])
|
|
295419
|
+
);
|
|
295420
|
+
const newLoad = AST20.arrowFunctionExpression(
|
|
295421
|
+
[AST20.identifier("event")],
|
|
295422
|
+
AST20.blockStatement([
|
|
295423
|
+
AST20.variableDeclaration("const", [
|
|
295424
|
+
AST20.variableDeclarator(
|
|
295425
|
+
AST20.identifier("result"),
|
|
295426
|
+
AST20.callExpression(intermediateID, [AST20.identifier("event")])
|
|
295427
|
+
)
|
|
295428
|
+
]),
|
|
295429
|
+
AST20.returnStatement(AST20.identifier("result"))
|
|
295430
|
+
])
|
|
295431
|
+
);
|
|
295432
|
+
exportStatement.declaration.declarations[0].init = newLoad;
|
|
295433
|
+
load_fn = newLoad;
|
|
295434
|
+
body = newLoad.body;
|
|
295122
295435
|
} else {
|
|
295123
295436
|
if (load_fn.params.length === 0) {
|
|
295124
295437
|
load_fn.params.push(event_id);
|
|
@@ -295136,7 +295449,7 @@ function modify_load(page, cb) {
|
|
|
295136
295449
|
);
|
|
295137
295450
|
}
|
|
295138
295451
|
}
|
|
295139
|
-
cb(body, event_id);
|
|
295452
|
+
load_fn.body = cb(body, event_id);
|
|
295140
295453
|
}
|
|
295141
295454
|
|
|
295142
295455
|
// src/plugin/transforms/kit/index.ts
|