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-esm/index.js
CHANGED
|
@@ -86460,7 +86460,18 @@ var ListManager = class {
|
|
|
86460
86460
|
}
|
|
86461
86461
|
lists = /* @__PURE__ */ new Map();
|
|
86462
86462
|
listsByField = /* @__PURE__ */ new Map();
|
|
86463
|
-
get(listName, id2, allLists) {
|
|
86463
|
+
get(listName, id2, allLists, skipMatches) {
|
|
86464
|
+
const lists = this.getLists(listName, id2, allLists);
|
|
86465
|
+
if (!lists) {
|
|
86466
|
+
return null;
|
|
86467
|
+
}
|
|
86468
|
+
if (skipMatches) {
|
|
86469
|
+
return new ListCollection(lists.lists.filter((list3) => !skipMatches.has(list3.fieldRef)));
|
|
86470
|
+
} else {
|
|
86471
|
+
return lists;
|
|
86472
|
+
}
|
|
86473
|
+
}
|
|
86474
|
+
getLists(listName, id2, allLists) {
|
|
86464
86475
|
const matches = this.lists.get(listName);
|
|
86465
86476
|
if (!matches || matches.size === 0) {
|
|
86466
86477
|
return null;
|
|
@@ -86582,6 +86593,9 @@ var List = class {
|
|
|
86582
86593
|
this.manager = manager;
|
|
86583
86594
|
this.abstract = abstract;
|
|
86584
86595
|
}
|
|
86596
|
+
get fieldRef() {
|
|
86597
|
+
return `${this.recordID}.${this.key}`;
|
|
86598
|
+
}
|
|
86585
86599
|
when(when) {
|
|
86586
86600
|
return this.manager.lists.get(this.name).get(this.recordID).when(when);
|
|
86587
86601
|
}
|
|
@@ -87726,8 +87740,8 @@ var Cache = class {
|
|
|
87726
87740
|
variables
|
|
87727
87741
|
);
|
|
87728
87742
|
}
|
|
87729
|
-
list(name, parentID, allLists) {
|
|
87730
|
-
const handler = this._internal_unstable.lists.get(name, parentID, allLists);
|
|
87743
|
+
list(name, parentID, allLists, skipMatches) {
|
|
87744
|
+
const handler = this._internal_unstable.lists.get(name, parentID, allLists, skipMatches);
|
|
87731
87745
|
if (!handler) {
|
|
87732
87746
|
throw new Error(
|
|
87733
87747
|
`Cannot find list with name: ${name}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -88142,6 +88156,7 @@ var CacheInternal = class {
|
|
|
88142
88156
|
});
|
|
88143
88157
|
}
|
|
88144
88158
|
}
|
|
88159
|
+
const processedOperations = /* @__PURE__ */ new Set();
|
|
88145
88160
|
for (const operation of operations || []) {
|
|
88146
88161
|
let parentID;
|
|
88147
88162
|
if (operation.parentID) {
|
|
@@ -88161,7 +88176,12 @@ var CacheInternal = class {
|
|
|
88161
88176
|
const targets = Array.isArray(value) ? value : [value];
|
|
88162
88177
|
for (const target of targets) {
|
|
88163
88178
|
if (operation.action === "insert" && target instanceof Object && fieldSelection && operation.list) {
|
|
88164
|
-
this.cache.list(
|
|
88179
|
+
this.cache.list(
|
|
88180
|
+
operation.list,
|
|
88181
|
+
parentID,
|
|
88182
|
+
operation.target === "all",
|
|
88183
|
+
processedOperations
|
|
88184
|
+
).when(operation.when).addToList(
|
|
88165
88185
|
fieldSelection,
|
|
88166
88186
|
target,
|
|
88167
88187
|
variables,
|
|
@@ -88169,7 +88189,12 @@ var CacheInternal = class {
|
|
|
88169
88189
|
layer
|
|
88170
88190
|
);
|
|
88171
88191
|
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
88172
|
-
this.cache.list(
|
|
88192
|
+
this.cache.list(
|
|
88193
|
+
operation.list,
|
|
88194
|
+
parentID,
|
|
88195
|
+
operation.target === "all",
|
|
88196
|
+
processedOperations
|
|
88197
|
+
).when(operation.when).toggleElement({
|
|
88173
88198
|
selection: fieldSelection,
|
|
88174
88199
|
data: target,
|
|
88175
88200
|
variables,
|
|
@@ -88177,7 +88202,12 @@ var CacheInternal = class {
|
|
|
88177
88202
|
layer
|
|
88178
88203
|
});
|
|
88179
88204
|
} else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
|
|
88180
|
-
this.cache.list(
|
|
88205
|
+
this.cache.list(
|
|
88206
|
+
operation.list,
|
|
88207
|
+
parentID,
|
|
88208
|
+
operation.target === "all",
|
|
88209
|
+
processedOperations
|
|
88210
|
+
).when(operation.when).remove(target, variables, layer);
|
|
88181
88211
|
} else if (operation.action === "delete" && operation.type && target) {
|
|
88182
88212
|
const targetID = this.id(operation.type, target);
|
|
88183
88213
|
if (!targetID) {
|
|
@@ -88189,6 +88219,16 @@ var CacheInternal = class {
|
|
|
88189
88219
|
this.cache.delete(targetID, layer);
|
|
88190
88220
|
}
|
|
88191
88221
|
}
|
|
88222
|
+
if (operation.list) {
|
|
88223
|
+
const matchingLists = this.cache.list(
|
|
88224
|
+
operation.list,
|
|
88225
|
+
parentID,
|
|
88226
|
+
operation.target === "all"
|
|
88227
|
+
);
|
|
88228
|
+
for (const list3 of matchingLists.lists) {
|
|
88229
|
+
processedOperations.add(list3.fieldRef);
|
|
88230
|
+
}
|
|
88231
|
+
}
|
|
88192
88232
|
}
|
|
88193
88233
|
}
|
|
88194
88234
|
return toNotify;
|
|
@@ -143278,7 +143318,18 @@ var ListManager2 = class {
|
|
|
143278
143318
|
}
|
|
143279
143319
|
lists = /* @__PURE__ */ new Map();
|
|
143280
143320
|
listsByField = /* @__PURE__ */ new Map();
|
|
143281
|
-
get(listName, id2, allLists) {
|
|
143321
|
+
get(listName, id2, allLists, skipMatches) {
|
|
143322
|
+
const lists = this.getLists(listName, id2, allLists);
|
|
143323
|
+
if (!lists) {
|
|
143324
|
+
return null;
|
|
143325
|
+
}
|
|
143326
|
+
if (skipMatches) {
|
|
143327
|
+
return new ListCollection2(lists.lists.filter((list3) => !skipMatches.has(list3.fieldRef)));
|
|
143328
|
+
} else {
|
|
143329
|
+
return lists;
|
|
143330
|
+
}
|
|
143331
|
+
}
|
|
143332
|
+
getLists(listName, id2, allLists) {
|
|
143282
143333
|
const matches = this.lists.get(listName);
|
|
143283
143334
|
if (!matches || matches.size === 0) {
|
|
143284
143335
|
return null;
|
|
@@ -143400,6 +143451,9 @@ var List2 = class {
|
|
|
143400
143451
|
this.manager = manager;
|
|
143401
143452
|
this.abstract = abstract;
|
|
143402
143453
|
}
|
|
143454
|
+
get fieldRef() {
|
|
143455
|
+
return `${this.recordID}.${this.key}`;
|
|
143456
|
+
}
|
|
143403
143457
|
when(when) {
|
|
143404
143458
|
return this.manager.lists.get(this.name).get(this.recordID).when(when);
|
|
143405
143459
|
}
|
|
@@ -144544,8 +144598,8 @@ var Cache2 = class {
|
|
|
144544
144598
|
variables
|
|
144545
144599
|
);
|
|
144546
144600
|
}
|
|
144547
|
-
list(name, parentID, allLists) {
|
|
144548
|
-
const handler = this._internal_unstable.lists.get(name, parentID, allLists);
|
|
144601
|
+
list(name, parentID, allLists, skipMatches) {
|
|
144602
|
+
const handler = this._internal_unstable.lists.get(name, parentID, allLists, skipMatches);
|
|
144549
144603
|
if (!handler) {
|
|
144550
144604
|
throw new Error(
|
|
144551
144605
|
`Cannot find list with name: ${name}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -144960,6 +145014,7 @@ var CacheInternal2 = class {
|
|
|
144960
145014
|
});
|
|
144961
145015
|
}
|
|
144962
145016
|
}
|
|
145017
|
+
const processedOperations = /* @__PURE__ */ new Set();
|
|
144963
145018
|
for (const operation of operations || []) {
|
|
144964
145019
|
let parentID;
|
|
144965
145020
|
if (operation.parentID) {
|
|
@@ -144979,7 +145034,12 @@ var CacheInternal2 = class {
|
|
|
144979
145034
|
const targets = Array.isArray(value) ? value : [value];
|
|
144980
145035
|
for (const target of targets) {
|
|
144981
145036
|
if (operation.action === "insert" && target instanceof Object && fieldSelection && operation.list) {
|
|
144982
|
-
this.cache.list(
|
|
145037
|
+
this.cache.list(
|
|
145038
|
+
operation.list,
|
|
145039
|
+
parentID,
|
|
145040
|
+
operation.target === "all",
|
|
145041
|
+
processedOperations
|
|
145042
|
+
).when(operation.when).addToList(
|
|
144983
145043
|
fieldSelection,
|
|
144984
145044
|
target,
|
|
144985
145045
|
variables,
|
|
@@ -144987,7 +145047,12 @@ var CacheInternal2 = class {
|
|
|
144987
145047
|
layer
|
|
144988
145048
|
);
|
|
144989
145049
|
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
144990
|
-
this.cache.list(
|
|
145050
|
+
this.cache.list(
|
|
145051
|
+
operation.list,
|
|
145052
|
+
parentID,
|
|
145053
|
+
operation.target === "all",
|
|
145054
|
+
processedOperations
|
|
145055
|
+
).when(operation.when).toggleElement({
|
|
144991
145056
|
selection: fieldSelection,
|
|
144992
145057
|
data: target,
|
|
144993
145058
|
variables,
|
|
@@ -144995,7 +145060,12 @@ var CacheInternal2 = class {
|
|
|
144995
145060
|
layer
|
|
144996
145061
|
});
|
|
144997
145062
|
} else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
|
|
144998
|
-
this.cache.list(
|
|
145063
|
+
this.cache.list(
|
|
145064
|
+
operation.list,
|
|
145065
|
+
parentID,
|
|
145066
|
+
operation.target === "all",
|
|
145067
|
+
processedOperations
|
|
145068
|
+
).when(operation.when).remove(target, variables, layer);
|
|
144999
145069
|
} else if (operation.action === "delete" && operation.type && target) {
|
|
145000
145070
|
const targetID = this.id(operation.type, target);
|
|
145001
145071
|
if (!targetID) {
|
|
@@ -145007,6 +145077,16 @@ var CacheInternal2 = class {
|
|
|
145007
145077
|
this.cache.delete(targetID, layer);
|
|
145008
145078
|
}
|
|
145009
145079
|
}
|
|
145080
|
+
if (operation.list) {
|
|
145081
|
+
const matchingLists = this.cache.list(
|
|
145082
|
+
operation.list,
|
|
145083
|
+
parentID,
|
|
145084
|
+
operation.target === "all"
|
|
145085
|
+
);
|
|
145086
|
+
for (const list3 of matchingLists.lists) {
|
|
145087
|
+
processedOperations.add(list3.fieldRef);
|
|
145088
|
+
}
|
|
145089
|
+
}
|
|
145010
145090
|
}
|
|
145011
145091
|
}
|
|
145012
145092
|
return toNotify;
|
|
@@ -147568,6 +147648,46 @@ function objectNode([type, defaultValue]) {
|
|
|
147568
147648
|
return node;
|
|
147569
147649
|
}
|
|
147570
147650
|
var pageInfoSelection = [
|
|
147651
|
+
{
|
|
147652
|
+
kind: graphql13.Kind.FIELD,
|
|
147653
|
+
name: {
|
|
147654
|
+
kind: graphql13.Kind.NAME,
|
|
147655
|
+
value: "pageInfo"
|
|
147656
|
+
},
|
|
147657
|
+
selectionSet: {
|
|
147658
|
+
kind: graphql13.Kind.SELECTION_SET,
|
|
147659
|
+
selections: [
|
|
147660
|
+
{
|
|
147661
|
+
kind: graphql13.Kind.FIELD,
|
|
147662
|
+
name: {
|
|
147663
|
+
kind: graphql13.Kind.NAME,
|
|
147664
|
+
value: "hasPreviousPage"
|
|
147665
|
+
}
|
|
147666
|
+
},
|
|
147667
|
+
{
|
|
147668
|
+
kind: graphql13.Kind.FIELD,
|
|
147669
|
+
name: {
|
|
147670
|
+
kind: graphql13.Kind.NAME,
|
|
147671
|
+
value: "hasNextPage"
|
|
147672
|
+
}
|
|
147673
|
+
},
|
|
147674
|
+
{
|
|
147675
|
+
kind: graphql13.Kind.FIELD,
|
|
147676
|
+
name: {
|
|
147677
|
+
kind: graphql13.Kind.NAME,
|
|
147678
|
+
value: "startCursor"
|
|
147679
|
+
}
|
|
147680
|
+
},
|
|
147681
|
+
{
|
|
147682
|
+
kind: graphql13.Kind.FIELD,
|
|
147683
|
+
name: {
|
|
147684
|
+
kind: graphql13.Kind.NAME,
|
|
147685
|
+
value: "endCursor"
|
|
147686
|
+
}
|
|
147687
|
+
}
|
|
147688
|
+
]
|
|
147689
|
+
}
|
|
147690
|
+
},
|
|
147571
147691
|
{
|
|
147572
147692
|
kind: graphql13.Kind.FIELD,
|
|
147573
147693
|
name: {
|
|
@@ -207768,7 +207888,18 @@ var ListManager3 = class {
|
|
|
207768
207888
|
}
|
|
207769
207889
|
lists = /* @__PURE__ */ new Map();
|
|
207770
207890
|
listsByField = /* @__PURE__ */ new Map();
|
|
207771
|
-
get(listName, id2, allLists) {
|
|
207891
|
+
get(listName, id2, allLists, skipMatches) {
|
|
207892
|
+
const lists = this.getLists(listName, id2, allLists);
|
|
207893
|
+
if (!lists) {
|
|
207894
|
+
return null;
|
|
207895
|
+
}
|
|
207896
|
+
if (skipMatches) {
|
|
207897
|
+
return new ListCollection3(lists.lists.filter((list3) => !skipMatches.has(list3.fieldRef)));
|
|
207898
|
+
} else {
|
|
207899
|
+
return lists;
|
|
207900
|
+
}
|
|
207901
|
+
}
|
|
207902
|
+
getLists(listName, id2, allLists) {
|
|
207772
207903
|
const matches = this.lists.get(listName);
|
|
207773
207904
|
if (!matches || matches.size === 0) {
|
|
207774
207905
|
return null;
|
|
@@ -207890,6 +208021,9 @@ var List3 = class {
|
|
|
207890
208021
|
this.manager = manager;
|
|
207891
208022
|
this.abstract = abstract;
|
|
207892
208023
|
}
|
|
208024
|
+
get fieldRef() {
|
|
208025
|
+
return `${this.recordID}.${this.key}`;
|
|
208026
|
+
}
|
|
207893
208027
|
when(when) {
|
|
207894
208028
|
return this.manager.lists.get(this.name).get(this.recordID).when(when);
|
|
207895
208029
|
}
|
|
@@ -209034,8 +209168,8 @@ var Cache3 = class {
|
|
|
209034
209168
|
variables
|
|
209035
209169
|
);
|
|
209036
209170
|
}
|
|
209037
|
-
list(name, parentID, allLists) {
|
|
209038
|
-
const handler = this._internal_unstable.lists.get(name, parentID, allLists);
|
|
209171
|
+
list(name, parentID, allLists, skipMatches) {
|
|
209172
|
+
const handler = this._internal_unstable.lists.get(name, parentID, allLists, skipMatches);
|
|
209039
209173
|
if (!handler) {
|
|
209040
209174
|
throw new Error(
|
|
209041
209175
|
`Cannot find list with name: ${name}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -209450,6 +209584,7 @@ var CacheInternal3 = class {
|
|
|
209450
209584
|
});
|
|
209451
209585
|
}
|
|
209452
209586
|
}
|
|
209587
|
+
const processedOperations = /* @__PURE__ */ new Set();
|
|
209453
209588
|
for (const operation of operations || []) {
|
|
209454
209589
|
let parentID;
|
|
209455
209590
|
if (operation.parentID) {
|
|
@@ -209469,7 +209604,12 @@ var CacheInternal3 = class {
|
|
|
209469
209604
|
const targets = Array.isArray(value) ? value : [value];
|
|
209470
209605
|
for (const target of targets) {
|
|
209471
209606
|
if (operation.action === "insert" && target instanceof Object && fieldSelection && operation.list) {
|
|
209472
|
-
this.cache.list(
|
|
209607
|
+
this.cache.list(
|
|
209608
|
+
operation.list,
|
|
209609
|
+
parentID,
|
|
209610
|
+
operation.target === "all",
|
|
209611
|
+
processedOperations
|
|
209612
|
+
).when(operation.when).addToList(
|
|
209473
209613
|
fieldSelection,
|
|
209474
209614
|
target,
|
|
209475
209615
|
variables,
|
|
@@ -209477,7 +209617,12 @@ var CacheInternal3 = class {
|
|
|
209477
209617
|
layer
|
|
209478
209618
|
);
|
|
209479
209619
|
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
209480
|
-
this.cache.list(
|
|
209620
|
+
this.cache.list(
|
|
209621
|
+
operation.list,
|
|
209622
|
+
parentID,
|
|
209623
|
+
operation.target === "all",
|
|
209624
|
+
processedOperations
|
|
209625
|
+
).when(operation.when).toggleElement({
|
|
209481
209626
|
selection: fieldSelection,
|
|
209482
209627
|
data: target,
|
|
209483
209628
|
variables,
|
|
@@ -209485,7 +209630,12 @@ var CacheInternal3 = class {
|
|
|
209485
209630
|
layer
|
|
209486
209631
|
});
|
|
209487
209632
|
} else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
|
|
209488
|
-
this.cache.list(
|
|
209633
|
+
this.cache.list(
|
|
209634
|
+
operation.list,
|
|
209635
|
+
parentID,
|
|
209636
|
+
operation.target === "all",
|
|
209637
|
+
processedOperations
|
|
209638
|
+
).when(operation.when).remove(target, variables, layer);
|
|
209489
209639
|
} else if (operation.action === "delete" && operation.type && target) {
|
|
209490
209640
|
const targetID = this.id(operation.type, target);
|
|
209491
209641
|
if (!targetID) {
|
|
@@ -209497,6 +209647,16 @@ var CacheInternal3 = class {
|
|
|
209497
209647
|
this.cache.delete(targetID, layer);
|
|
209498
209648
|
}
|
|
209499
209649
|
}
|
|
209650
|
+
if (operation.list) {
|
|
209651
|
+
const matchingLists = this.cache.list(
|
|
209652
|
+
operation.list,
|
|
209653
|
+
parentID,
|
|
209654
|
+
operation.target === "all"
|
|
209655
|
+
);
|
|
209656
|
+
for (const list3 of matchingLists.lists) {
|
|
209657
|
+
processedOperations.add(list3.fieldRef);
|
|
209658
|
+
}
|
|
209659
|
+
}
|
|
209500
209660
|
}
|
|
209501
209661
|
}
|
|
209502
209662
|
return toNotify;
|
|
@@ -210638,6 +210798,46 @@ var { keys: keys2 } = Object;
|
|
|
210638
210798
|
var recast42 = __toESM4(require_main23(), 1);
|
|
210639
210799
|
var AST42 = recast42.types.builders;
|
|
210640
210800
|
var pageInfoSelection2 = [
|
|
210801
|
+
{
|
|
210802
|
+
kind: graphql132.Kind.FIELD,
|
|
210803
|
+
name: {
|
|
210804
|
+
kind: graphql132.Kind.NAME,
|
|
210805
|
+
value: "pageInfo"
|
|
210806
|
+
},
|
|
210807
|
+
selectionSet: {
|
|
210808
|
+
kind: graphql132.Kind.SELECTION_SET,
|
|
210809
|
+
selections: [
|
|
210810
|
+
{
|
|
210811
|
+
kind: graphql132.Kind.FIELD,
|
|
210812
|
+
name: {
|
|
210813
|
+
kind: graphql132.Kind.NAME,
|
|
210814
|
+
value: "hasPreviousPage"
|
|
210815
|
+
}
|
|
210816
|
+
},
|
|
210817
|
+
{
|
|
210818
|
+
kind: graphql132.Kind.FIELD,
|
|
210819
|
+
name: {
|
|
210820
|
+
kind: graphql132.Kind.NAME,
|
|
210821
|
+
value: "hasNextPage"
|
|
210822
|
+
}
|
|
210823
|
+
},
|
|
210824
|
+
{
|
|
210825
|
+
kind: graphql132.Kind.FIELD,
|
|
210826
|
+
name: {
|
|
210827
|
+
kind: graphql132.Kind.NAME,
|
|
210828
|
+
value: "startCursor"
|
|
210829
|
+
}
|
|
210830
|
+
},
|
|
210831
|
+
{
|
|
210832
|
+
kind: graphql132.Kind.FIELD,
|
|
210833
|
+
name: {
|
|
210834
|
+
kind: graphql132.Kind.NAME,
|
|
210835
|
+
value: "endCursor"
|
|
210836
|
+
}
|
|
210837
|
+
}
|
|
210838
|
+
]
|
|
210839
|
+
}
|
|
210840
|
+
},
|
|
210641
210841
|
{
|
|
210642
210842
|
kind: graphql132.Kind.FIELD,
|
|
210643
210843
|
name: {
|
|
@@ -231038,30 +231238,30 @@ var require_utils52 = __commonJS5({
|
|
|
231038
231238
|
validate32.oneOf = values;
|
|
231039
231239
|
return validate32;
|
|
231040
231240
|
}
|
|
231041
|
-
function assertNodeType(...
|
|
231241
|
+
function assertNodeType(...types18) {
|
|
231042
231242
|
function validate32(node, key2, val) {
|
|
231043
|
-
for (const type of
|
|
231243
|
+
for (const type of types18) {
|
|
231044
231244
|
if ((0, _is.default)(type, val)) {
|
|
231045
231245
|
(0, _validate.validateChild)(node, key2, val);
|
|
231046
231246
|
return;
|
|
231047
231247
|
}
|
|
231048
231248
|
}
|
|
231049
|
-
throw new TypeError(`Property ${key2} of ${node.type} expected node to be of a type ${JSON.stringify(
|
|
231249
|
+
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)}`);
|
|
231050
231250
|
}
|
|
231051
|
-
validate32.oneOfNodeTypes =
|
|
231251
|
+
validate32.oneOfNodeTypes = types18;
|
|
231052
231252
|
return validate32;
|
|
231053
231253
|
}
|
|
231054
|
-
function assertNodeOrValueType(...
|
|
231254
|
+
function assertNodeOrValueType(...types18) {
|
|
231055
231255
|
function validate32(node, key2, val) {
|
|
231056
|
-
for (const type of
|
|
231256
|
+
for (const type of types18) {
|
|
231057
231257
|
if (getType(val) === type || (0, _is.default)(type, val)) {
|
|
231058
231258
|
(0, _validate.validateChild)(node, key2, val);
|
|
231059
231259
|
return;
|
|
231060
231260
|
}
|
|
231061
231261
|
}
|
|
231062
|
-
throw new TypeError(`Property ${key2} of ${node.type} expected node to be of a type ${JSON.stringify(
|
|
231262
|
+
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)}`);
|
|
231063
231263
|
}
|
|
231064
|
-
validate32.oneOfNodeOrValueTypes =
|
|
231264
|
+
validate32.oneOfNodeOrValueTypes = types18;
|
|
231065
231265
|
return validate32;
|
|
231066
231266
|
}
|
|
231067
231267
|
function assertValueType(type) {
|
|
@@ -235465,10 +235665,10 @@ var require_generated24 = __commonJS5({
|
|
|
235465
235665
|
body
|
|
235466
235666
|
});
|
|
235467
235667
|
}
|
|
235468
|
-
function intersectionTypeAnnotation(
|
|
235668
|
+
function intersectionTypeAnnotation(types18) {
|
|
235469
235669
|
return (0, _validateNode.default)({
|
|
235470
235670
|
type: "IntersectionTypeAnnotation",
|
|
235471
|
-
types:
|
|
235671
|
+
types: types18
|
|
235472
235672
|
});
|
|
235473
235673
|
}
|
|
235474
235674
|
function mixedTypeAnnotation() {
|
|
@@ -235591,10 +235791,10 @@ var require_generated24 = __commonJS5({
|
|
|
235591
235791
|
type: "ThisTypeAnnotation"
|
|
235592
235792
|
};
|
|
235593
235793
|
}
|
|
235594
|
-
function tupleTypeAnnotation(
|
|
235794
|
+
function tupleTypeAnnotation(types18) {
|
|
235595
235795
|
return (0, _validateNode.default)({
|
|
235596
235796
|
type: "TupleTypeAnnotation",
|
|
235597
|
-
types:
|
|
235797
|
+
types: types18
|
|
235598
235798
|
});
|
|
235599
235799
|
}
|
|
235600
235800
|
function typeofTypeAnnotation(argument) {
|
|
@@ -235645,10 +235845,10 @@ var require_generated24 = __commonJS5({
|
|
|
235645
235845
|
params
|
|
235646
235846
|
});
|
|
235647
235847
|
}
|
|
235648
|
-
function unionTypeAnnotation(
|
|
235848
|
+
function unionTypeAnnotation(types18) {
|
|
235649
235849
|
return (0, _validateNode.default)({
|
|
235650
235850
|
type: "UnionTypeAnnotation",
|
|
235651
|
-
types:
|
|
235851
|
+
types: types18
|
|
235652
235852
|
});
|
|
235653
235853
|
}
|
|
235654
235854
|
function variance(kind) {
|
|
@@ -236161,16 +236361,16 @@ var require_generated24 = __commonJS5({
|
|
|
236161
236361
|
optional
|
|
236162
236362
|
});
|
|
236163
236363
|
}
|
|
236164
|
-
function tsUnionType(
|
|
236364
|
+
function tsUnionType(types18) {
|
|
236165
236365
|
return (0, _validateNode.default)({
|
|
236166
236366
|
type: "TSUnionType",
|
|
236167
|
-
types:
|
|
236367
|
+
types: types18
|
|
236168
236368
|
});
|
|
236169
236369
|
}
|
|
236170
|
-
function tsIntersectionType(
|
|
236370
|
+
function tsIntersectionType(types18) {
|
|
236171
236371
|
return (0, _validateNode.default)({
|
|
236172
236372
|
type: "TSIntersectionType",
|
|
236173
|
-
types:
|
|
236373
|
+
types: types18
|
|
236174
236374
|
});
|
|
236175
236375
|
}
|
|
236176
236376
|
function tsConditionalType(checkType, extendsType, trueType, falseType) {
|
|
@@ -237771,12 +237971,12 @@ var require_removeTypeDuplicates5 = __commonJS5({
|
|
|
237771
237971
|
const generics = /* @__PURE__ */ new Map();
|
|
237772
237972
|
const bases = /* @__PURE__ */ new Map();
|
|
237773
237973
|
const typeGroups = /* @__PURE__ */ new Set();
|
|
237774
|
-
const
|
|
237974
|
+
const types18 = [];
|
|
237775
237975
|
for (let i22 = 0; i22 < nodes.length; i22++) {
|
|
237776
237976
|
const node = nodes[i22];
|
|
237777
237977
|
if (!node)
|
|
237778
237978
|
continue;
|
|
237779
|
-
if (
|
|
237979
|
+
if (types18.indexOf(node) >= 0) {
|
|
237780
237980
|
continue;
|
|
237781
237981
|
}
|
|
237782
237982
|
if ((0, _generated.isAnyTypeAnnotation)(node)) {
|
|
@@ -237810,15 +238010,15 @@ var require_removeTypeDuplicates5 = __commonJS5({
|
|
|
237810
238010
|
}
|
|
237811
238011
|
continue;
|
|
237812
238012
|
}
|
|
237813
|
-
|
|
238013
|
+
types18.push(node);
|
|
237814
238014
|
}
|
|
237815
238015
|
for (const [, baseType] of bases) {
|
|
237816
|
-
|
|
238016
|
+
types18.push(baseType);
|
|
237817
238017
|
}
|
|
237818
238018
|
for (const [, genericName] of generics) {
|
|
237819
|
-
|
|
238019
|
+
types18.push(genericName);
|
|
237820
238020
|
}
|
|
237821
|
-
return
|
|
238021
|
+
return types18;
|
|
237822
238022
|
}
|
|
237823
238023
|
}
|
|
237824
238024
|
});
|
|
@@ -237831,8 +238031,8 @@ var require_createFlowUnionType4 = __commonJS5({
|
|
|
237831
238031
|
exports.default = createFlowUnionType;
|
|
237832
238032
|
var _generated = require_generated24();
|
|
237833
238033
|
var _removeTypeDuplicates = require_removeTypeDuplicates5();
|
|
237834
|
-
function createFlowUnionType(
|
|
237835
|
-
const flattened = (0, _removeTypeDuplicates.default)(
|
|
238034
|
+
function createFlowUnionType(types18) {
|
|
238035
|
+
const flattened = (0, _removeTypeDuplicates.default)(types18);
|
|
237836
238036
|
if (flattened.length === 1) {
|
|
237837
238037
|
return flattened[0];
|
|
237838
238038
|
} else {
|
|
@@ -237857,12 +238057,12 @@ var require_removeTypeDuplicates24 = __commonJS5({
|
|
|
237857
238057
|
const generics = /* @__PURE__ */ new Map();
|
|
237858
238058
|
const bases = /* @__PURE__ */ new Map();
|
|
237859
238059
|
const typeGroups = /* @__PURE__ */ new Set();
|
|
237860
|
-
const
|
|
238060
|
+
const types18 = [];
|
|
237861
238061
|
for (let i22 = 0; i22 < nodes.length; i22++) {
|
|
237862
238062
|
const node = nodes[i22];
|
|
237863
238063
|
if (!node)
|
|
237864
238064
|
continue;
|
|
237865
|
-
if (
|
|
238065
|
+
if (types18.indexOf(node) >= 0) {
|
|
237866
238066
|
continue;
|
|
237867
238067
|
}
|
|
237868
238068
|
if ((0, _generated.isTSAnyKeyword)(node)) {
|
|
@@ -237896,15 +238096,15 @@ var require_removeTypeDuplicates24 = __commonJS5({
|
|
|
237896
238096
|
}
|
|
237897
238097
|
continue;
|
|
237898
238098
|
}
|
|
237899
|
-
|
|
238099
|
+
types18.push(node);
|
|
237900
238100
|
}
|
|
237901
238101
|
for (const [, baseType] of bases) {
|
|
237902
|
-
|
|
238102
|
+
types18.push(baseType);
|
|
237903
238103
|
}
|
|
237904
238104
|
for (const [, genericName] of generics) {
|
|
237905
|
-
|
|
238105
|
+
types18.push(genericName);
|
|
237906
238106
|
}
|
|
237907
|
-
return
|
|
238107
|
+
return types18;
|
|
237908
238108
|
}
|
|
237909
238109
|
}
|
|
237910
238110
|
});
|
|
@@ -237919,10 +238119,10 @@ var require_createTSUnionType4 = __commonJS5({
|
|
|
237919
238119
|
var _removeTypeDuplicates = require_removeTypeDuplicates24();
|
|
237920
238120
|
var _index = require_generated7();
|
|
237921
238121
|
function createTSUnionType(typeAnnotations) {
|
|
237922
|
-
const
|
|
238122
|
+
const types18 = typeAnnotations.map((type) => {
|
|
237923
238123
|
return (0, _index.isTSTypeAnnotation)(type) ? type.typeAnnotation : type;
|
|
237924
238124
|
});
|
|
237925
|
-
const flattened = (0, _removeTypeDuplicates.default)(
|
|
238125
|
+
const flattened = (0, _removeTypeDuplicates.default)(types18);
|
|
237926
238126
|
if (flattened.length === 1) {
|
|
237927
238127
|
return flattened[0];
|
|
237928
238128
|
} else {
|
|
@@ -242186,14 +242386,14 @@ var require_lib64 = __commonJS5({
|
|
|
242186
242386
|
this.preserveSpace = !!preserveSpace;
|
|
242187
242387
|
}
|
|
242188
242388
|
};
|
|
242189
|
-
var
|
|
242389
|
+
var types18 = {
|
|
242190
242390
|
brace: new TokContext3("{"),
|
|
242191
242391
|
j_oTag: new TokContext3("<tag"),
|
|
242192
242392
|
j_cTag: new TokContext3("</tag"),
|
|
242193
242393
|
j_expr: new TokContext3("<tag>...</tag>", true)
|
|
242194
242394
|
};
|
|
242195
242395
|
{
|
|
242196
|
-
|
|
242396
|
+
types18.template = new TokContext3("`", true);
|
|
242197
242397
|
}
|
|
242198
242398
|
var beforeExpr2 = true;
|
|
242199
242399
|
var startsExpr2 = true;
|
|
@@ -242731,17 +242931,17 @@ var require_lib64 = __commonJS5({
|
|
|
242731
242931
|
context.pop();
|
|
242732
242932
|
};
|
|
242733
242933
|
tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = (context) => {
|
|
242734
|
-
context.push(
|
|
242934
|
+
context.push(types18.brace);
|
|
242735
242935
|
};
|
|
242736
242936
|
tokenTypes[22].updateContext = (context) => {
|
|
242737
|
-
if (context[context.length - 1] ===
|
|
242937
|
+
if (context[context.length - 1] === types18.template) {
|
|
242738
242938
|
context.pop();
|
|
242739
242939
|
} else {
|
|
242740
|
-
context.push(
|
|
242940
|
+
context.push(types18.template);
|
|
242741
242941
|
}
|
|
242742
242942
|
};
|
|
242743
242943
|
tokenTypes[142].updateContext = (context) => {
|
|
242744
|
-
context.push(
|
|
242944
|
+
context.push(types18.j_expr, types18.j_oTag);
|
|
242745
242945
|
};
|
|
242746
242946
|
}
|
|
242747
242947
|
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";
|
|
@@ -243301,7 +243501,7 @@ var require_lib64 = __commonJS5({
|
|
|
243301
243501
|
this.end = 0;
|
|
243302
243502
|
this.lastTokEndLoc = null;
|
|
243303
243503
|
this.lastTokStartLoc = null;
|
|
243304
|
-
this.context = [
|
|
243504
|
+
this.context = [types18.brace];
|
|
243305
243505
|
this.firstInvalidTemplateEscapePos = null;
|
|
243306
243506
|
this.strictErrors = /* @__PURE__ */ new Map();
|
|
243307
243507
|
this.tokensLength = 0;
|
|
@@ -247128,7 +247328,7 @@ var require_lib64 = __commonJS5({
|
|
|
247128
247328
|
context
|
|
247129
247329
|
} = this.state;
|
|
247130
247330
|
const currentContext = context[context.length - 1];
|
|
247131
|
-
if (currentContext ===
|
|
247331
|
+
if (currentContext === types18.j_oTag || currentContext === types18.j_expr) {
|
|
247132
247332
|
context.pop();
|
|
247133
247333
|
}
|
|
247134
247334
|
}
|
|
@@ -248150,9 +248350,9 @@ var require_lib64 = __commonJS5({
|
|
|
248150
248350
|
switch (this.state.type) {
|
|
248151
248351
|
case 5:
|
|
248152
248352
|
node = this.startNode();
|
|
248153
|
-
this.setContext(
|
|
248353
|
+
this.setContext(types18.brace);
|
|
248154
248354
|
this.next();
|
|
248155
|
-
node = this.jsxParseExpressionContainer(node,
|
|
248355
|
+
node = this.jsxParseExpressionContainer(node, types18.j_oTag);
|
|
248156
248356
|
if (node.expression.type === "JSXEmptyExpression") {
|
|
248157
248357
|
this.raise(JsxErrors.AttributeIsEmpty, node);
|
|
248158
248358
|
}
|
|
@@ -248171,7 +248371,7 @@ var require_lib64 = __commonJS5({
|
|
|
248171
248371
|
jsxParseSpreadChild(node) {
|
|
248172
248372
|
this.next();
|
|
248173
248373
|
node.expression = this.parseExpression();
|
|
248174
|
-
this.setContext(
|
|
248374
|
+
this.setContext(types18.j_expr);
|
|
248175
248375
|
this.state.canStartJSXElement = true;
|
|
248176
248376
|
this.expect(8);
|
|
248177
248377
|
return this.finishNode(node, "JSXSpreadChild");
|
|
@@ -248191,11 +248391,11 @@ var require_lib64 = __commonJS5({
|
|
|
248191
248391
|
jsxParseAttribute() {
|
|
248192
248392
|
const node = this.startNode();
|
|
248193
248393
|
if (this.match(5)) {
|
|
248194
|
-
this.setContext(
|
|
248394
|
+
this.setContext(types18.brace);
|
|
248195
248395
|
this.next();
|
|
248196
248396
|
this.expect(21);
|
|
248197
248397
|
node.argument = this.parseMaybeAssignAllowIn();
|
|
248198
|
-
this.setContext(
|
|
248398
|
+
this.setContext(types18.j_oTag);
|
|
248199
248399
|
this.state.canStartJSXElement = true;
|
|
248200
248400
|
this.expect(8);
|
|
248201
248401
|
return this.finishNode(node, "JSXSpreadAttribute");
|
|
@@ -248254,12 +248454,12 @@ var require_lib64 = __commonJS5({
|
|
|
248254
248454
|
break;
|
|
248255
248455
|
case 5: {
|
|
248256
248456
|
const node2 = this.startNode();
|
|
248257
|
-
this.setContext(
|
|
248457
|
+
this.setContext(types18.brace);
|
|
248258
248458
|
this.next();
|
|
248259
248459
|
if (this.match(21)) {
|
|
248260
248460
|
children.push(this.jsxParseSpreadChild(node2));
|
|
248261
248461
|
} else {
|
|
248262
|
-
children.push(this.jsxParseExpressionContainer(node2,
|
|
248462
|
+
children.push(this.jsxParseExpressionContainer(node2, types18.j_expr));
|
|
248263
248463
|
}
|
|
248264
248464
|
break;
|
|
248265
248465
|
}
|
|
@@ -248324,11 +248524,11 @@ var require_lib64 = __commonJS5({
|
|
|
248324
248524
|
}
|
|
248325
248525
|
getTokenFromCode(code2) {
|
|
248326
248526
|
const context = this.curContext();
|
|
248327
|
-
if (context ===
|
|
248527
|
+
if (context === types18.j_expr) {
|
|
248328
248528
|
this.jsxReadToken();
|
|
248329
248529
|
return;
|
|
248330
248530
|
}
|
|
248331
|
-
if (context ===
|
|
248531
|
+
if (context === types18.j_oTag || context === types18.j_cTag) {
|
|
248332
248532
|
if (isIdentifierStart2(code2)) {
|
|
248333
248533
|
this.jsxReadWord();
|
|
248334
248534
|
return;
|
|
@@ -248338,7 +248538,7 @@ var require_lib64 = __commonJS5({
|
|
|
248338
248538
|
this.finishToken(143);
|
|
248339
248539
|
return;
|
|
248340
248540
|
}
|
|
248341
|
-
if ((code2 === 34 || code2 === 39) && context ===
|
|
248541
|
+
if ((code2 === 34 || code2 === 39) && context === types18.j_oTag) {
|
|
248342
248542
|
this.jsxReadString(code2);
|
|
248343
248543
|
return;
|
|
248344
248544
|
}
|
|
@@ -248356,17 +248556,17 @@ var require_lib64 = __commonJS5({
|
|
|
248356
248556
|
type
|
|
248357
248557
|
} = this.state;
|
|
248358
248558
|
if (type === 56 && prevType === 142) {
|
|
248359
|
-
context.splice(-2, 2,
|
|
248559
|
+
context.splice(-2, 2, types18.j_cTag);
|
|
248360
248560
|
this.state.canStartJSXElement = false;
|
|
248361
248561
|
} else if (type === 142) {
|
|
248362
|
-
context.push(
|
|
248562
|
+
context.push(types18.j_oTag);
|
|
248363
248563
|
} else if (type === 143) {
|
|
248364
248564
|
const out = context[context.length - 1];
|
|
248365
|
-
if (out ===
|
|
248565
|
+
if (out === types18.j_oTag && prevType === 56 || out === types18.j_cTag) {
|
|
248366
248566
|
context.pop();
|
|
248367
|
-
this.state.canStartJSXElement = context[context.length - 1] ===
|
|
248567
|
+
this.state.canStartJSXElement = context[context.length - 1] === types18.j_expr;
|
|
248368
248568
|
} else {
|
|
248369
|
-
this.setContext(
|
|
248569
|
+
this.setContext(types18.j_expr);
|
|
248370
248570
|
this.state.canStartJSXElement = true;
|
|
248371
248571
|
}
|
|
248372
248572
|
} else {
|
|
@@ -249741,14 +249941,14 @@ var require_lib64 = __commonJS5({
|
|
|
249741
249941
|
tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
|
|
249742
249942
|
const node = this.startNode();
|
|
249743
249943
|
const hasLeadingOperator = this.eat(operator);
|
|
249744
|
-
const
|
|
249944
|
+
const types19 = [];
|
|
249745
249945
|
do {
|
|
249746
|
-
|
|
249946
|
+
types19.push(parseConstituentType());
|
|
249747
249947
|
} while (this.eat(operator));
|
|
249748
|
-
if (
|
|
249749
|
-
return
|
|
249948
|
+
if (types19.length === 1 && !hasLeadingOperator) {
|
|
249949
|
+
return types19[0];
|
|
249750
249950
|
}
|
|
249751
|
-
node.types =
|
|
249951
|
+
node.types = types19;
|
|
249752
249952
|
return this.finishNode(node, kind);
|
|
249753
249953
|
}
|
|
249754
249954
|
tsParseIntersectionTypeOrHigher() {
|
|
@@ -250312,7 +250512,7 @@ var require_lib64 = __commonJS5({
|
|
|
250312
250512
|
}));
|
|
250313
250513
|
if (node.params.length === 0) {
|
|
250314
250514
|
this.raise(TSErrors.EmptyTypeArguments, node);
|
|
250315
|
-
} else if (!this.state.inType && this.curContext() ===
|
|
250515
|
+
} else if (!this.state.inType && this.curContext() === types18.brace) {
|
|
250316
250516
|
this.reScan_lt_gt();
|
|
250317
250517
|
}
|
|
250318
250518
|
this.expect(48);
|
|
@@ -250938,7 +251138,7 @@ var require_lib64 = __commonJS5({
|
|
|
250938
251138
|
context
|
|
250939
251139
|
} = this.state;
|
|
250940
251140
|
const currentContext = context[context.length - 1];
|
|
250941
|
-
if (currentContext ===
|
|
251141
|
+
if (currentContext === types18.j_oTag || currentContext === types18.j_expr) {
|
|
250942
251142
|
context.pop();
|
|
250943
251143
|
}
|
|
250944
251144
|
}
|
|
@@ -256066,9 +256266,9 @@ var require_shared4 = __commonJS5({
|
|
|
256066
256266
|
var tslib_1 = require_tslib4();
|
|
256067
256267
|
var types_1 = tslib_1.__importDefault(require_types4());
|
|
256068
256268
|
function default_1(fork) {
|
|
256069
|
-
var
|
|
256070
|
-
var Type =
|
|
256071
|
-
var builtin =
|
|
256269
|
+
var types18 = fork.use(types_1.default);
|
|
256270
|
+
var Type = types18.Type;
|
|
256271
|
+
var builtin = types18.builtInTypes;
|
|
256072
256272
|
var isNumber = builtin.number;
|
|
256073
256273
|
function geq(than) {
|
|
256074
256274
|
return Type.from(function(value) {
|
|
@@ -256216,9 +256416,9 @@ var require_types4 = __commonJS5({
|
|
|
256216
256416
|
}(BaseType);
|
|
256217
256417
|
var OrType = function(_super) {
|
|
256218
256418
|
tslib_1.__extends(OrType2, _super);
|
|
256219
|
-
function OrType2(
|
|
256419
|
+
function OrType2(types18) {
|
|
256220
256420
|
var _this = _super.call(this) || this;
|
|
256221
|
-
_this.types =
|
|
256421
|
+
_this.types = types18;
|
|
256222
256422
|
_this.kind = "OrType";
|
|
256223
256423
|
return _this;
|
|
256224
256424
|
}
|
|
@@ -256359,11 +256559,11 @@ var require_types4 = __commonJS5({
|
|
|
256359
256559
|
function typesPlugin(_fork) {
|
|
256360
256560
|
var Type = {
|
|
256361
256561
|
or: function() {
|
|
256362
|
-
var
|
|
256562
|
+
var types18 = [];
|
|
256363
256563
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
256364
|
-
|
|
256564
|
+
types18[_i] = arguments[_i];
|
|
256365
256565
|
}
|
|
256366
|
-
return new OrType(
|
|
256566
|
+
return new OrType(types18.map(function(type) {
|
|
256367
256567
|
return Type.from(type);
|
|
256368
256568
|
}));
|
|
256369
256569
|
},
|
|
@@ -256806,9 +257006,9 @@ var require_path24 = __commonJS5({
|
|
|
256806
257006
|
var Op = Object.prototype;
|
|
256807
257007
|
var hasOwn2 = Op.hasOwnProperty;
|
|
256808
257008
|
function pathPlugin(fork) {
|
|
256809
|
-
var
|
|
256810
|
-
var isArray2 =
|
|
256811
|
-
var isNumber =
|
|
257009
|
+
var types18 = fork.use(types_1.default);
|
|
257010
|
+
var isArray2 = types18.builtInTypes.array;
|
|
257011
|
+
var isNumber = types18.builtInTypes.number;
|
|
256812
257012
|
var Path = function Path2(value, parentPath, name) {
|
|
256813
257013
|
if (!(this instanceof Path2)) {
|
|
256814
257014
|
throw new Error("Path constructor cannot be invoked without 'new'");
|
|
@@ -257108,13 +257308,13 @@ var require_scope4 = __commonJS5({
|
|
|
257108
257308
|
var types_1 = tslib_1.__importDefault(require_types4());
|
|
257109
257309
|
var hasOwn2 = Object.prototype.hasOwnProperty;
|
|
257110
257310
|
function scopePlugin(fork) {
|
|
257111
|
-
var
|
|
257112
|
-
var Type =
|
|
257113
|
-
var namedTypes =
|
|
257311
|
+
var types18 = fork.use(types_1.default);
|
|
257312
|
+
var Type = types18.Type;
|
|
257313
|
+
var namedTypes = types18.namedTypes;
|
|
257114
257314
|
var Node3 = namedTypes.Node;
|
|
257115
257315
|
var Expression = namedTypes.Expression;
|
|
257116
|
-
var isArray2 =
|
|
257117
|
-
var b2 =
|
|
257316
|
+
var isArray2 = types18.builtInTypes.array;
|
|
257317
|
+
var b2 = types18.builders;
|
|
257118
257318
|
var Scope4 = function Scope22(path32, parentScope) {
|
|
257119
257319
|
if (!(this instanceof Scope22)) {
|
|
257120
257320
|
throw new Error("Scope constructor cannot be invoked without 'new'");
|
|
@@ -257177,7 +257377,7 @@ var require_scope4 = __commonJS5({
|
|
|
257177
257377
|
++index;
|
|
257178
257378
|
}
|
|
257179
257379
|
var name = prefix + index;
|
|
257180
|
-
return this.bindings[name] =
|
|
257380
|
+
return this.bindings[name] = types18.builders.identifier(name);
|
|
257181
257381
|
};
|
|
257182
257382
|
Sp.injectTemporary = function(identifier, init2) {
|
|
257183
257383
|
identifier || (identifier = this.declareTemporary());
|
|
@@ -257253,7 +257453,7 @@ var require_scope4 = __commonJS5({
|
|
|
257253
257453
|
bindings
|
|
257254
257454
|
);
|
|
257255
257455
|
} else if (Node3.check(node) && !Expression.check(node)) {
|
|
257256
|
-
|
|
257456
|
+
types18.eachField(node, function(name, child) {
|
|
257257
257457
|
var childPath = path32.get(name);
|
|
257258
257458
|
if (!pathHasValue(childPath, child)) {
|
|
257259
257459
|
throw new Error("");
|
|
@@ -257331,24 +257531,24 @@ var require_scope4 = __commonJS5({
|
|
|
257331
257531
|
addPattern(patternPath.get("argument"), bindings);
|
|
257332
257532
|
}
|
|
257333
257533
|
}
|
|
257334
|
-
function addTypePattern(patternPath,
|
|
257534
|
+
function addTypePattern(patternPath, types19) {
|
|
257335
257535
|
var pattern = patternPath.value;
|
|
257336
257536
|
namedTypes.Pattern.assert(pattern);
|
|
257337
257537
|
if (namedTypes.Identifier.check(pattern)) {
|
|
257338
|
-
if (hasOwn2.call(
|
|
257339
|
-
|
|
257538
|
+
if (hasOwn2.call(types19, pattern.name)) {
|
|
257539
|
+
types19[pattern.name].push(patternPath);
|
|
257340
257540
|
} else {
|
|
257341
|
-
|
|
257541
|
+
types19[pattern.name] = [patternPath];
|
|
257342
257542
|
}
|
|
257343
257543
|
}
|
|
257344
257544
|
}
|
|
257345
|
-
function addTypeParameter(parameterPath,
|
|
257545
|
+
function addTypeParameter(parameterPath, types19) {
|
|
257346
257546
|
var parameter = parameterPath.value;
|
|
257347
257547
|
FlowOrTSTypeParameterType.assert(parameter);
|
|
257348
|
-
if (hasOwn2.call(
|
|
257349
|
-
|
|
257548
|
+
if (hasOwn2.call(types19, parameter.name)) {
|
|
257549
|
+
types19[parameter.name].push(parameterPath);
|
|
257350
257550
|
} else {
|
|
257351
|
-
|
|
257551
|
+
types19[parameter.name] = [parameterPath];
|
|
257352
257552
|
}
|
|
257353
257553
|
}
|
|
257354
257554
|
Sp.lookup = function(name) {
|
|
@@ -257387,11 +257587,11 @@ var require_node_path4 = __commonJS5({
|
|
|
257387
257587
|
var scope_1 = tslib_1.__importDefault(require_scope4());
|
|
257388
257588
|
var shared_1 = require_shared4();
|
|
257389
257589
|
function nodePathPlugin(fork) {
|
|
257390
|
-
var
|
|
257391
|
-
var n2 =
|
|
257392
|
-
var b2 =
|
|
257393
|
-
var isNumber =
|
|
257394
|
-
var isArray2 =
|
|
257590
|
+
var types18 = fork.use(types_1.default);
|
|
257591
|
+
var n2 = types18.namedTypes;
|
|
257592
|
+
var b2 = types18.builders;
|
|
257593
|
+
var isNumber = types18.builtInTypes.number;
|
|
257594
|
+
var isArray2 = types18.builtInTypes.array;
|
|
257395
257595
|
var Path = fork.use(path_1.default);
|
|
257396
257596
|
var Scope4 = fork.use(scope_1.default);
|
|
257397
257597
|
var NodePath = function NodePath2(value, parentPath, name) {
|
|
@@ -257482,7 +257682,7 @@ var require_node_path4 = __commonJS5({
|
|
|
257482
257682
|
return scope || null;
|
|
257483
257683
|
};
|
|
257484
257684
|
NPp.getValueProperty = function(name) {
|
|
257485
|
-
return
|
|
257685
|
+
return types18.getFieldValue(this.value, name);
|
|
257486
257686
|
};
|
|
257487
257687
|
NPp.needsParens = function(assumeExpressionContext) {
|
|
257488
257688
|
var pp2 = this.parentPath;
|
|
@@ -257624,7 +257824,7 @@ var require_node_path4 = __commonJS5({
|
|
|
257624
257824
|
return node.some(containsCallExpression);
|
|
257625
257825
|
}
|
|
257626
257826
|
if (n2.Node.check(node)) {
|
|
257627
|
-
return
|
|
257827
|
+
return types18.someField(node, function(_name, child) {
|
|
257628
257828
|
return containsCallExpression(child);
|
|
257629
257829
|
});
|
|
257630
257830
|
}
|
|
@@ -257743,11 +257943,11 @@ var require_path_visitor4 = __commonJS5({
|
|
|
257743
257943
|
var shared_1 = require_shared4();
|
|
257744
257944
|
var hasOwn2 = Object.prototype.hasOwnProperty;
|
|
257745
257945
|
function pathVisitorPlugin(fork) {
|
|
257746
|
-
var
|
|
257946
|
+
var types18 = fork.use(types_1.default);
|
|
257747
257947
|
var NodePath = fork.use(node_path_1.default);
|
|
257748
|
-
var isArray2 =
|
|
257749
|
-
var isObject2 =
|
|
257750
|
-
var isFunction =
|
|
257948
|
+
var isArray2 = types18.builtInTypes.array;
|
|
257949
|
+
var isObject2 = types18.builtInTypes.object;
|
|
257950
|
+
var isFunction = types18.builtInTypes.function;
|
|
257751
257951
|
var undefined2;
|
|
257752
257952
|
var PathVisitor = function PathVisitor2() {
|
|
257753
257953
|
if (!(this instanceof PathVisitor2)) {
|
|
@@ -257767,7 +257967,7 @@ var require_path_visitor4 = __commonJS5({
|
|
|
257767
257967
|
typeNames[methodName.slice("visit".length)] = true;
|
|
257768
257968
|
}
|
|
257769
257969
|
}
|
|
257770
|
-
var supertypeTable =
|
|
257970
|
+
var supertypeTable = types18.computeSupertypeLookupTable(typeNames);
|
|
257771
257971
|
var methodNameTable = /* @__PURE__ */ Object.create(null);
|
|
257772
257972
|
var typeNameKeys = Object.keys(supertypeTable);
|
|
257773
257973
|
var typeNameCount = typeNameKeys.length;
|
|
@@ -257886,7 +258086,7 @@ var require_path_visitor4 = __commonJS5({
|
|
|
257886
258086
|
path32.each(visitor.visitWithoutReset, visitor);
|
|
257887
258087
|
} else if (!isObject2.check(value)) {
|
|
257888
258088
|
} else {
|
|
257889
|
-
var childNames =
|
|
258089
|
+
var childNames = types18.getFieldNames(value);
|
|
257890
258090
|
if (visitor._shouldVisitComments && value.comments && childNames.indexOf("comments") < 0) {
|
|
257891
258091
|
childNames.push("comments");
|
|
257892
258092
|
}
|
|
@@ -257895,7 +258095,7 @@ var require_path_visitor4 = __commonJS5({
|
|
|
257895
258095
|
for (var i22 = 0; i22 < childCount; ++i22) {
|
|
257896
258096
|
var childName = childNames[i22];
|
|
257897
258097
|
if (!hasOwn2.call(value, childName)) {
|
|
257898
|
-
value[childName] =
|
|
258098
|
+
value[childName] = types18.getFieldValue(value, childName);
|
|
257899
258099
|
}
|
|
257900
258100
|
childPaths.push(path32.get(childName));
|
|
257901
258101
|
}
|
|
@@ -258036,13 +258236,13 @@ var require_equiv4 = __commonJS5({
|
|
|
258036
258236
|
var shared_1 = require_shared4();
|
|
258037
258237
|
var types_1 = tslib_1.__importDefault(require_types4());
|
|
258038
258238
|
function default_1(fork) {
|
|
258039
|
-
var
|
|
258040
|
-
var getFieldNames =
|
|
258041
|
-
var getFieldValue =
|
|
258042
|
-
var isArray2 =
|
|
258043
|
-
var isObject2 =
|
|
258044
|
-
var isDate =
|
|
258045
|
-
var isRegExp =
|
|
258239
|
+
var types18 = fork.use(types_1.default);
|
|
258240
|
+
var getFieldNames = types18.getFieldNames;
|
|
258241
|
+
var getFieldValue = types18.getFieldValue;
|
|
258242
|
+
var isArray2 = types18.builtInTypes.array;
|
|
258243
|
+
var isObject2 = types18.builtInTypes.object;
|
|
258244
|
+
var isDate = types18.builtInTypes.Date;
|
|
258245
|
+
var isRegExp = types18.builtInTypes.RegExp;
|
|
258046
258246
|
var hasOwn2 = Object.prototype.hasOwnProperty;
|
|
258047
258247
|
function astNodesAreEquivalent(a2, b2, problemPath) {
|
|
258048
258248
|
if (isArray2.check(problemPath)) {
|
|
@@ -258193,24 +258393,24 @@ var require_fork4 = __commonJS5({
|
|
|
258193
258393
|
var shared_1 = require_shared4();
|
|
258194
258394
|
function default_1(plugins) {
|
|
258195
258395
|
var fork = createFork();
|
|
258196
|
-
var
|
|
258396
|
+
var types18 = fork.use(types_1.default);
|
|
258197
258397
|
plugins.forEach(fork.use);
|
|
258198
|
-
|
|
258398
|
+
types18.finalize();
|
|
258199
258399
|
var PathVisitor = fork.use(path_visitor_1.default);
|
|
258200
258400
|
return {
|
|
258201
|
-
Type:
|
|
258202
|
-
builtInTypes:
|
|
258203
|
-
namedTypes:
|
|
258204
|
-
builders:
|
|
258205
|
-
defineMethod:
|
|
258206
|
-
getFieldNames:
|
|
258207
|
-
getFieldValue:
|
|
258208
|
-
eachField:
|
|
258209
|
-
someField:
|
|
258210
|
-
getSupertypeNames:
|
|
258211
|
-
getBuilderName:
|
|
258401
|
+
Type: types18.Type,
|
|
258402
|
+
builtInTypes: types18.builtInTypes,
|
|
258403
|
+
namedTypes: types18.namedTypes,
|
|
258404
|
+
builders: types18.builders,
|
|
258405
|
+
defineMethod: types18.defineMethod,
|
|
258406
|
+
getFieldNames: types18.getFieldNames,
|
|
258407
|
+
getFieldValue: types18.getFieldValue,
|
|
258408
|
+
eachField: types18.eachField,
|
|
258409
|
+
someField: types18.someField,
|
|
258410
|
+
getSupertypeNames: types18.getSupertypeNames,
|
|
258411
|
+
getBuilderName: types18.getBuilderName,
|
|
258212
258412
|
astNodesAreEquivalent: fork.use(equiv_1.default),
|
|
258213
|
-
finalize:
|
|
258413
|
+
finalize: types18.finalize,
|
|
258214
258414
|
Path: fork.use(path_1.default),
|
|
258215
258415
|
NodePath: fork.use(node_path_1.default),
|
|
258216
258416
|
PathVisitor,
|
|
@@ -258370,8 +258570,8 @@ var require_core34 = __commonJS5({
|
|
|
258370
258570
|
var types_1 = tslib_1.__importDefault(require_types4());
|
|
258371
258571
|
var shared_1 = tslib_1.__importStar(require_shared4());
|
|
258372
258572
|
function default_1(fork) {
|
|
258373
|
-
var
|
|
258374
|
-
var Type =
|
|
258573
|
+
var types18 = fork.use(types_1.default);
|
|
258574
|
+
var Type = types18.Type;
|
|
258375
258575
|
var def = Type.def;
|
|
258376
258576
|
var or = Type.or;
|
|
258377
258577
|
var shared2 = fork.use(shared_1.default);
|
|
@@ -258461,9 +258661,9 @@ var require_es64 = __commonJS5({
|
|
|
258461
258661
|
var shared_1 = tslib_1.__importStar(require_shared4());
|
|
258462
258662
|
function default_1(fork) {
|
|
258463
258663
|
fork.use(core_1.default);
|
|
258464
|
-
var
|
|
258465
|
-
var def =
|
|
258466
|
-
var or =
|
|
258664
|
+
var types18 = fork.use(types_1.default);
|
|
258665
|
+
var def = types18.Type.def;
|
|
258666
|
+
var or = types18.Type.or;
|
|
258467
258667
|
var defaults = fork.use(shared_1.default).defaults;
|
|
258468
258668
|
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"]);
|
|
258469
258669
|
def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field(
|
|
@@ -258549,8 +258749,8 @@ var require_es20174 = __commonJS5({
|
|
|
258549
258749
|
var shared_1 = tslib_1.__importStar(require_shared4());
|
|
258550
258750
|
function default_1(fork) {
|
|
258551
258751
|
fork.use(es2016_1.default);
|
|
258552
|
-
var
|
|
258553
|
-
var def =
|
|
258752
|
+
var types18 = fork.use(types_1.default);
|
|
258753
|
+
var def = types18.Type.def;
|
|
258554
258754
|
var defaults = fork.use(shared_1.default).defaults;
|
|
258555
258755
|
def("Function").field("async", Boolean, defaults["false"]);
|
|
258556
258756
|
def("AwaitExpression").bases("Expression").build("argument").field("argument", def("Expression"));
|
|
@@ -258571,9 +258771,9 @@ var require_es20184 = __commonJS5({
|
|
|
258571
258771
|
var shared_1 = tslib_1.__importStar(require_shared4());
|
|
258572
258772
|
function default_1(fork) {
|
|
258573
258773
|
fork.use(es2017_1.default);
|
|
258574
|
-
var
|
|
258575
|
-
var def =
|
|
258576
|
-
var or =
|
|
258774
|
+
var types18 = fork.use(types_1.default);
|
|
258775
|
+
var def = types18.Type.def;
|
|
258776
|
+
var or = types18.Type.or;
|
|
258577
258777
|
var defaults = fork.use(shared_1.default).defaults;
|
|
258578
258778
|
def("ForOfStatement").field("await", Boolean, defaults["false"]);
|
|
258579
258779
|
def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
|
|
@@ -258602,9 +258802,9 @@ var require_es20194 = __commonJS5({
|
|
|
258602
258802
|
var shared_1 = tslib_1.__importStar(require_shared4());
|
|
258603
258803
|
function default_1(fork) {
|
|
258604
258804
|
fork.use(es2018_1.default);
|
|
258605
|
-
var
|
|
258606
|
-
var def =
|
|
258607
|
-
var or =
|
|
258805
|
+
var types18 = fork.use(types_1.default);
|
|
258806
|
+
var def = types18.Type.def;
|
|
258807
|
+
var or = types18.Type.or;
|
|
258608
258808
|
var defaults = fork.use(shared_1.default).defaults;
|
|
258609
258809
|
def("CatchClause").field("param", or(def("Pattern"), null), defaults["null"]);
|
|
258610
258810
|
}
|
|
@@ -258626,9 +258826,9 @@ var require_es202024 = __commonJS5({
|
|
|
258626
258826
|
function default_1(fork) {
|
|
258627
258827
|
fork.use(es2020_1.default);
|
|
258628
258828
|
fork.use(es2019_1.default);
|
|
258629
|
-
var
|
|
258630
|
-
var def =
|
|
258631
|
-
var or =
|
|
258829
|
+
var types18 = fork.use(types_1.default);
|
|
258830
|
+
var def = types18.Type.def;
|
|
258831
|
+
var or = types18.Type.or;
|
|
258632
258832
|
var shared2 = fork.use(shared_1.default);
|
|
258633
258833
|
var defaults = shared2.defaults;
|
|
258634
258834
|
def("ImportExpression").bases("Expression").build("source").field("source", def("Expression"));
|
|
@@ -258674,8 +258874,8 @@ var require_es20224 = __commonJS5({
|
|
|
258674
258874
|
var shared_1 = require_shared4();
|
|
258675
258875
|
function default_1(fork) {
|
|
258676
258876
|
fork.use(es2021_1.default);
|
|
258677
|
-
var
|
|
258678
|
-
var def =
|
|
258877
|
+
var types18 = fork.use(types_1.default);
|
|
258878
|
+
var def = types18.Type.def;
|
|
258679
258879
|
def("StaticBlock").bases("Declaration").build("body").field("body", [def("Statement")]);
|
|
258680
258880
|
}
|
|
258681
258881
|
exports.default = default_1;
|
|
@@ -258694,9 +258894,9 @@ var require_es_proposals4 = __commonJS5({
|
|
|
258694
258894
|
var es2022_1 = tslib_1.__importDefault(require_es20224());
|
|
258695
258895
|
function default_1(fork) {
|
|
258696
258896
|
fork.use(es2022_1.default);
|
|
258697
|
-
var
|
|
258698
|
-
var Type =
|
|
258699
|
-
var def =
|
|
258897
|
+
var types18 = fork.use(types_1.default);
|
|
258898
|
+
var Type = types18.Type;
|
|
258899
|
+
var def = types18.Type.def;
|
|
258700
258900
|
var or = Type.or;
|
|
258701
258901
|
var shared2 = fork.use(shared_1.default);
|
|
258702
258902
|
var defaults = shared2.defaults;
|
|
@@ -258734,9 +258934,9 @@ var require_jsx24 = __commonJS5({
|
|
|
258734
258934
|
var shared_1 = tslib_1.__importStar(require_shared4());
|
|
258735
258935
|
function default_1(fork) {
|
|
258736
258936
|
fork.use(es_proposals_1.default);
|
|
258737
|
-
var
|
|
258738
|
-
var def =
|
|
258739
|
-
var or =
|
|
258937
|
+
var types18 = fork.use(types_1.default);
|
|
258938
|
+
var def = types18.Type.def;
|
|
258939
|
+
var or = types18.Type.or;
|
|
258740
258940
|
var defaults = fork.use(shared_1.default).defaults;
|
|
258741
258941
|
def("JSXAttribute").bases("Node").build("name", "value").field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or(
|
|
258742
258942
|
def("Literal"),
|
|
@@ -258792,9 +258992,9 @@ var require_type_annotations4 = __commonJS5({
|
|
|
258792
258992
|
var types_1 = tslib_1.__importDefault(require_types4());
|
|
258793
258993
|
var shared_1 = tslib_1.__importStar(require_shared4());
|
|
258794
258994
|
function default_1(fork) {
|
|
258795
|
-
var
|
|
258796
|
-
var def =
|
|
258797
|
-
var or =
|
|
258995
|
+
var types18 = fork.use(types_1.default);
|
|
258996
|
+
var def = types18.Type.def;
|
|
258997
|
+
var or = types18.Type.or;
|
|
258798
258998
|
var defaults = fork.use(shared_1.default).defaults;
|
|
258799
258999
|
var TypeAnnotation = or(def("TypeAnnotation"), def("TSTypeAnnotation"), null);
|
|
258800
259000
|
var TypeParamDecl = or(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null);
|
|
@@ -258827,9 +259027,9 @@ var require_flow24 = __commonJS5({
|
|
|
258827
259027
|
function default_1(fork) {
|
|
258828
259028
|
fork.use(es_proposals_1.default);
|
|
258829
259029
|
fork.use(type_annotations_1.default);
|
|
258830
|
-
var
|
|
258831
|
-
var def =
|
|
258832
|
-
var or =
|
|
259030
|
+
var types18 = fork.use(types_1.default);
|
|
259031
|
+
var def = types18.Type.def;
|
|
259032
|
+
var or = types18.Type.or;
|
|
258833
259033
|
var defaults = fork.use(shared_1.default).defaults;
|
|
258834
259034
|
def("Flow").bases("Node");
|
|
258835
259035
|
def("FlowType").bases("Flow");
|
|
@@ -258941,10 +259141,10 @@ var require_esprima6 = __commonJS5({
|
|
|
258941
259141
|
var shared_1 = tslib_1.__importStar(require_shared4());
|
|
258942
259142
|
function default_1(fork) {
|
|
258943
259143
|
fork.use(es_proposals_1.default);
|
|
258944
|
-
var
|
|
259144
|
+
var types18 = fork.use(types_1.default);
|
|
258945
259145
|
var defaults = fork.use(shared_1.default).defaults;
|
|
258946
|
-
var def =
|
|
258947
|
-
var or =
|
|
259146
|
+
var def = types18.Type.def;
|
|
259147
|
+
var or = types18.Type.or;
|
|
258948
259148
|
def("VariableDeclaration").field("declarations", [or(
|
|
258949
259149
|
def("VariableDeclarator"),
|
|
258950
259150
|
def("Identifier")
|
|
@@ -258987,11 +259187,11 @@ var require_babel_core4 = __commonJS5({
|
|
|
258987
259187
|
function default_1(fork) {
|
|
258988
259188
|
var _a, _b, _c, _d, _e;
|
|
258989
259189
|
fork.use(es_proposals_1.default);
|
|
258990
|
-
var
|
|
259190
|
+
var types18 = fork.use(types_1.default);
|
|
258991
259191
|
var defaults = fork.use(shared_1.default).defaults;
|
|
258992
|
-
var def =
|
|
258993
|
-
var or =
|
|
258994
|
-
var isUndefined =
|
|
259192
|
+
var def = types18.Type.def;
|
|
259193
|
+
var or = types18.Type.or;
|
|
259194
|
+
var isUndefined = types18.builtInTypes.undefined;
|
|
258995
259195
|
def("Noop").bases("Statement").build();
|
|
258996
259196
|
def("DoExpression").bases("Expression").build("body").field("body", [def("Statement")]);
|
|
258997
259197
|
def("BindExpression").bases("Expression").build("object", "callee").field("object", or(def("Expression"), null)).field("callee", def("Expression"));
|
|
@@ -259016,7 +259216,7 @@ var require_babel_core4 = __commonJS5({
|
|
|
259016
259216
|
raw: String
|
|
259017
259217
|
},
|
|
259018
259218
|
function getDefault() {
|
|
259019
|
-
var value =
|
|
259219
|
+
var value = types18.getFieldValue(this, "value");
|
|
259020
259220
|
return {
|
|
259021
259221
|
rawValue: value,
|
|
259022
259222
|
raw: toRaw ? toRaw(value) : String(value)
|
|
@@ -259117,8 +259317,8 @@ var require_babel4 = __commonJS5({
|
|
|
259117
259317
|
var flow_1 = tslib_1.__importDefault(require_flow24());
|
|
259118
259318
|
var shared_1 = require_shared4();
|
|
259119
259319
|
function default_1(fork) {
|
|
259120
|
-
var
|
|
259121
|
-
var def =
|
|
259320
|
+
var types18 = fork.use(types_1.default);
|
|
259321
|
+
var def = types18.Type.def;
|
|
259122
259322
|
fork.use(babel_core_1.default);
|
|
259123
259323
|
fork.use(flow_1.default);
|
|
259124
259324
|
def("V8IntrinsicIdentifier").bases("Expression").build("name").field("name", String);
|
|
@@ -259142,12 +259342,12 @@ var require_typescript24 = __commonJS5({
|
|
|
259142
259342
|
function default_1(fork) {
|
|
259143
259343
|
fork.use(babel_core_1.default);
|
|
259144
259344
|
fork.use(type_annotations_1.default);
|
|
259145
|
-
var
|
|
259146
|
-
var n2 =
|
|
259147
|
-
var def =
|
|
259148
|
-
var or =
|
|
259345
|
+
var types18 = fork.use(types_1.default);
|
|
259346
|
+
var n2 = types18.namedTypes;
|
|
259347
|
+
var def = types18.Type.def;
|
|
259348
|
+
var or = types18.Type.or;
|
|
259149
259349
|
var defaults = fork.use(shared_1.default).defaults;
|
|
259150
|
-
var StringLiteral =
|
|
259350
|
+
var StringLiteral = types18.Type.from(function(value, deep) {
|
|
259151
259351
|
if (n2.StringLiteral && n2.StringLiteral.check(value, deep)) {
|
|
259152
259352
|
return true;
|
|
259153
259353
|
}
|
|
@@ -261095,8 +261295,8 @@ var require_util24 = __commonJS5({
|
|
|
261095
261295
|
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;
|
|
261096
261296
|
var tslib_1 = require_tslib4();
|
|
261097
261297
|
var assert_1 = tslib_1.__importDefault(__require5("assert"));
|
|
261098
|
-
var
|
|
261099
|
-
var n2 =
|
|
261298
|
+
var types18 = tslib_1.__importStar(require_main5());
|
|
261299
|
+
var n2 = types18.namedTypes;
|
|
261100
261300
|
var source_map_1 = tslib_1.__importDefault(require_source_map4());
|
|
261101
261301
|
var SourceMapConsumer = source_map_1.default.SourceMapConsumer;
|
|
261102
261302
|
var SourceMapGenerator = source_map_1.default.SourceMapGenerator;
|
|
@@ -268402,10 +268602,10 @@ var require_comments4 = __commonJS5({
|
|
|
268402
268602
|
exports.printComments = exports.attach = void 0;
|
|
268403
268603
|
var tslib_1 = require_tslib4();
|
|
268404
268604
|
var assert_1 = tslib_1.__importDefault(__require5("assert"));
|
|
268405
|
-
var
|
|
268406
|
-
var n2 =
|
|
268407
|
-
var isArray2 =
|
|
268408
|
-
var isObject2 =
|
|
268605
|
+
var types18 = tslib_1.__importStar(require_main5());
|
|
268606
|
+
var n2 = types18.namedTypes;
|
|
268607
|
+
var isArray2 = types18.builtInTypes.array;
|
|
268608
|
+
var isObject2 = types18.builtInTypes.object;
|
|
268409
268609
|
var lines_1 = require_lines4();
|
|
268410
268610
|
var util_1 = require_util24();
|
|
268411
268611
|
var childNodesCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -268436,7 +268636,7 @@ var require_comments4 = __commonJS5({
|
|
|
268436
268636
|
if (isArray2.check(node)) {
|
|
268437
268637
|
names = Object.keys(node);
|
|
268438
268638
|
} else if (isObject2.check(node)) {
|
|
268439
|
-
names =
|
|
268639
|
+
names = types18.getFieldNames(node);
|
|
268440
268640
|
} else {
|
|
268441
268641
|
return resultArray;
|
|
268442
268642
|
}
|
|
@@ -268614,7 +268814,7 @@ var require_comments4 = __commonJS5({
|
|
|
268614
268814
|
function printComments(path32, print132) {
|
|
268615
268815
|
var value = path32.getValue();
|
|
268616
268816
|
var innerLines = print132(path32);
|
|
268617
|
-
var comments = n2.Node.check(value) &&
|
|
268817
|
+
var comments = n2.Node.check(value) && types18.getFieldValue(value, "comments");
|
|
268618
268818
|
if (!comments || comments.length === 0) {
|
|
268619
268819
|
return innerLines;
|
|
268620
268820
|
}
|
|
@@ -268622,8 +268822,8 @@ var require_comments4 = __commonJS5({
|
|
|
268622
268822
|
var trailingParts = [innerLines];
|
|
268623
268823
|
path32.each(function(commentPath) {
|
|
268624
268824
|
var comment = commentPath.getValue();
|
|
268625
|
-
var leading =
|
|
268626
|
-
var trailing =
|
|
268825
|
+
var leading = types18.getFieldValue(comment, "leading");
|
|
268826
|
+
var trailing = types18.getFieldValue(comment, "trailing");
|
|
268627
268827
|
if (leading || trailing && !(n2.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
268628
268828
|
leadingParts.push(printLeadingComment(commentPath, print132));
|
|
268629
268829
|
} else if (trailing) {
|
|
@@ -268643,10 +268843,10 @@ var require_parser4 = __commonJS5({
|
|
|
268643
268843
|
exports.parse = void 0;
|
|
268644
268844
|
var tslib_1 = require_tslib4();
|
|
268645
268845
|
var assert_1 = tslib_1.__importDefault(__require5("assert"));
|
|
268646
|
-
var
|
|
268647
|
-
var b2 =
|
|
268648
|
-
var isObject2 =
|
|
268649
|
-
var isArray2 =
|
|
268846
|
+
var types18 = tslib_1.__importStar(require_main5());
|
|
268847
|
+
var b2 = types18.builders;
|
|
268848
|
+
var isObject2 = types18.builtInTypes.object;
|
|
268849
|
+
var isArray2 = types18.builtInTypes.array;
|
|
268650
268850
|
var options_1 = require_options4();
|
|
268651
268851
|
var lines_1 = require_lines4();
|
|
268652
268852
|
var comments_1 = require_comments4();
|
|
@@ -268830,11 +269030,11 @@ var require_fast_path4 = __commonJS5({
|
|
|
268830
269030
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
268831
269031
|
var tslib_1 = require_tslib4();
|
|
268832
269032
|
var assert_1 = tslib_1.__importDefault(__require5("assert"));
|
|
268833
|
-
var
|
|
269033
|
+
var types18 = tslib_1.__importStar(require_main5());
|
|
268834
269034
|
var util = tslib_1.__importStar(require_util24());
|
|
268835
|
-
var n2 =
|
|
268836
|
-
var isArray2 =
|
|
268837
|
-
var isNumber =
|
|
269035
|
+
var n2 = types18.namedTypes;
|
|
269036
|
+
var isArray2 = types18.builtInTypes.array;
|
|
269037
|
+
var isNumber = types18.builtInTypes.number;
|
|
268838
269038
|
var PRECEDENCE = {};
|
|
268839
269039
|
[
|
|
268840
269040
|
["??"],
|
|
@@ -268863,7 +269063,7 @@ var require_fast_path4 = __commonJS5({
|
|
|
268863
269063
|
if (obj instanceof FastPath) {
|
|
268864
269064
|
return obj.copy();
|
|
268865
269065
|
}
|
|
268866
|
-
if (obj instanceof
|
|
269066
|
+
if (obj instanceof types18.NodePath) {
|
|
268867
269067
|
var copy = Object.create(FastPath.prototype);
|
|
268868
269068
|
var stack = [obj.value];
|
|
268869
269069
|
for (var pp2 = void 0; pp2 = obj.parentPath; obj = pp2)
|
|
@@ -269174,7 +269374,7 @@ var require_fast_path4 = __commonJS5({
|
|
|
269174
269374
|
return node.some(containsCallExpression);
|
|
269175
269375
|
}
|
|
269176
269376
|
if (n2.Node.check(node)) {
|
|
269177
|
-
return
|
|
269377
|
+
return types18.someField(node, function(_name, child) {
|
|
269178
269378
|
return containsCallExpression(child);
|
|
269179
269379
|
});
|
|
269180
269380
|
}
|
|
@@ -269262,16 +269462,16 @@ var require_patcher4 = __commonJS5({
|
|
|
269262
269462
|
var tslib_1 = require_tslib4();
|
|
269263
269463
|
var assert_1 = tslib_1.__importDefault(__require5("assert"));
|
|
269264
269464
|
var linesModule = tslib_1.__importStar(require_lines4());
|
|
269265
|
-
var
|
|
269266
|
-
var Printable =
|
|
269267
|
-
var Expression =
|
|
269268
|
-
var ReturnStatement =
|
|
269269
|
-
var SourceLocation3 =
|
|
269465
|
+
var types18 = tslib_1.__importStar(require_main5());
|
|
269466
|
+
var Printable = types18.namedTypes.Printable;
|
|
269467
|
+
var Expression = types18.namedTypes.Expression;
|
|
269468
|
+
var ReturnStatement = types18.namedTypes.ReturnStatement;
|
|
269469
|
+
var SourceLocation3 = types18.namedTypes.SourceLocation;
|
|
269270
269470
|
var util_1 = require_util24();
|
|
269271
269471
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path4());
|
|
269272
|
-
var isObject2 =
|
|
269273
|
-
var isArray2 =
|
|
269274
|
-
var isString =
|
|
269472
|
+
var isObject2 = types18.builtInTypes.object;
|
|
269473
|
+
var isArray2 = types18.builtInTypes.array;
|
|
269474
|
+
var isString = types18.builtInTypes.string;
|
|
269275
269475
|
var riskyAdjoiningCharExp = /[0-9a-z_$]/i;
|
|
269276
269476
|
var Patcher = function Patcher2(lines) {
|
|
269277
269477
|
assert_1.default.ok(this instanceof Patcher2);
|
|
@@ -269541,8 +269741,8 @@ var require_patcher4 = __commonJS5({
|
|
|
269541
269741
|
if (k2.charAt(0) === "_") {
|
|
269542
269742
|
continue;
|
|
269543
269743
|
}
|
|
269544
|
-
newPath.stack.push(k2,
|
|
269545
|
-
oldPath.stack.push(k2,
|
|
269744
|
+
newPath.stack.push(k2, types18.getFieldValue(newNode, k2));
|
|
269745
|
+
oldPath.stack.push(k2, types18.getFieldValue(oldNode, k2));
|
|
269546
269746
|
var canReprint = findAnyReprints(newPath, oldPath, reprints);
|
|
269547
269747
|
newPath.stack.length -= 2;
|
|
269548
269748
|
oldPath.stack.length -= 2;
|
|
@@ -269564,16 +269764,16 @@ var require_printer4 = __commonJS5({
|
|
|
269564
269764
|
exports.Printer = void 0;
|
|
269565
269765
|
var tslib_1 = require_tslib4();
|
|
269566
269766
|
var assert_1 = tslib_1.__importDefault(__require5("assert"));
|
|
269567
|
-
var
|
|
269767
|
+
var types18 = tslib_1.__importStar(require_main5());
|
|
269568
269768
|
var comments_1 = require_comments4();
|
|
269569
269769
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path4());
|
|
269570
269770
|
var lines_1 = require_lines4();
|
|
269571
269771
|
var options_1 = require_options4();
|
|
269572
269772
|
var patcher_1 = require_patcher4();
|
|
269573
269773
|
var util = tslib_1.__importStar(require_util24());
|
|
269574
|
-
var namedTypes =
|
|
269575
|
-
var isString =
|
|
269576
|
-
var isObject2 =
|
|
269774
|
+
var namedTypes = types18.namedTypes;
|
|
269775
|
+
var isString = types18.builtInTypes.string;
|
|
269776
|
+
var isObject2 = types18.builtInTypes.object;
|
|
269577
269777
|
var PrintResult = function PrintResult2(code, sourceMap) {
|
|
269578
269778
|
assert_1.default.ok(this instanceof PrintResult2);
|
|
269579
269779
|
isString.assert(code);
|
|
@@ -269735,7 +269935,7 @@ var require_printer4 = __commonJS5({
|
|
|
269735
269935
|
case "OptionalMemberExpression": {
|
|
269736
269936
|
parts.push(path32.call(print132, "object"));
|
|
269737
269937
|
var property = path32.call(print132, "property");
|
|
269738
|
-
var optional =
|
|
269938
|
+
var optional = types18.getFieldValue(n2, "optional");
|
|
269739
269939
|
if (n2.computed) {
|
|
269740
269940
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
269741
269941
|
} else {
|
|
@@ -270006,7 +270206,7 @@ var require_printer4 = __commonJS5({
|
|
|
270006
270206
|
if (n2.typeArguments) {
|
|
270007
270207
|
parts.push(path32.call(print132, "typeArguments"));
|
|
270008
270208
|
}
|
|
270009
|
-
if (
|
|
270209
|
+
if (types18.getFieldValue(n2, "optional")) {
|
|
270010
270210
|
parts.push("?.");
|
|
270011
270211
|
}
|
|
270012
270212
|
parts.push(printArgumentsList(path32, options, print132));
|
|
@@ -271685,8 +271885,8 @@ var require_printer4 = __commonJS5({
|
|
|
271685
271885
|
});
|
|
271686
271886
|
}
|
|
271687
271887
|
function getPossibleRaw(node) {
|
|
271688
|
-
var value =
|
|
271689
|
-
var extra =
|
|
271888
|
+
var value = types18.getFieldValue(node, "value");
|
|
271889
|
+
var extra = types18.getFieldValue(node, "extra");
|
|
271690
271890
|
if (extra && typeof extra.raw === "string" && value == extra.rawValue) {
|
|
271691
271891
|
return extra.raw;
|
|
271692
271892
|
}
|
|
@@ -271732,8 +271932,8 @@ var require_main24 = __commonJS5({
|
|
|
271732
271932
|
exports.run = exports.prettyPrint = exports.print = exports.visit = exports.types = exports.parse = void 0;
|
|
271733
271933
|
var tslib_1 = require_tslib4();
|
|
271734
271934
|
var fs_1 = tslib_1.__importDefault(__require5("fs"));
|
|
271735
|
-
var
|
|
271736
|
-
exports.types =
|
|
271935
|
+
var types18 = tslib_1.__importStar(require_main5());
|
|
271936
|
+
exports.types = types18;
|
|
271737
271937
|
var parser_1 = require_parser4();
|
|
271738
271938
|
Object.defineProperty(exports, "parse", { enumerable: true, get: function() {
|
|
271739
271939
|
return parser_1.parse;
|
|
@@ -272393,7 +272593,7 @@ var printDocASTReducer4 = {
|
|
|
272393
272593
|
leave: ({ name, interfaces, directives, fields }) => join5(["interface", name, wrap4("implements ", join5(interfaces, " & ")), join5(directives, " "), block4(fields)], " ")
|
|
272394
272594
|
},
|
|
272395
272595
|
UnionTypeDefinition: {
|
|
272396
|
-
leave: ({ name, directives, types:
|
|
272596
|
+
leave: ({ name, directives, types: types18 }) => join5(["union", name, join5(directives, " "), wrap4("= ", join5(types18, " | "))], " ")
|
|
272397
272597
|
},
|
|
272398
272598
|
EnumTypeDefinition: {
|
|
272399
272599
|
leave: ({ name, directives, values }) => join5(["enum", name, join5(directives, " "), block4(values)], " ")
|
|
@@ -272420,7 +272620,7 @@ var printDocASTReducer4 = {
|
|
|
272420
272620
|
leave: ({ name, interfaces, directives, fields }) => join5(["extend interface", name, wrap4("implements ", join5(interfaces, " & ")), join5(directives, " "), block4(fields)], " ")
|
|
272421
272621
|
},
|
|
272422
272622
|
UnionTypeExtension: {
|
|
272423
|
-
leave: ({ name, directives, types:
|
|
272623
|
+
leave: ({ name, directives, types: types18 }) => join5(["extend union", name, join5(directives, " "), wrap4("= ", join5(types18, " | "))], " ")
|
|
272424
272624
|
},
|
|
272425
272625
|
EnumTypeExtension: {
|
|
272426
272626
|
leave: ({ name, directives, values }) => join5(["extend enum", name, join5(directives, " "), block4(values)], " ")
|
|
@@ -273835,7 +274035,18 @@ var ListManager4 = class {
|
|
|
273835
274035
|
}
|
|
273836
274036
|
lists = /* @__PURE__ */ new Map();
|
|
273837
274037
|
listsByField = /* @__PURE__ */ new Map();
|
|
273838
|
-
get(listName, id2, allLists) {
|
|
274038
|
+
get(listName, id2, allLists, skipMatches) {
|
|
274039
|
+
const lists = this.getLists(listName, id2, allLists);
|
|
274040
|
+
if (!lists) {
|
|
274041
|
+
return null;
|
|
274042
|
+
}
|
|
274043
|
+
if (skipMatches) {
|
|
274044
|
+
return new ListCollection4(lists.lists.filter((list3) => !skipMatches.has(list3.fieldRef)));
|
|
274045
|
+
} else {
|
|
274046
|
+
return lists;
|
|
274047
|
+
}
|
|
274048
|
+
}
|
|
274049
|
+
getLists(listName, id2, allLists) {
|
|
273839
274050
|
const matches = this.lists.get(listName);
|
|
273840
274051
|
if (!matches || matches.size === 0) {
|
|
273841
274052
|
return null;
|
|
@@ -273957,6 +274168,9 @@ var List4 = class {
|
|
|
273957
274168
|
this.manager = manager;
|
|
273958
274169
|
this.abstract = abstract;
|
|
273959
274170
|
}
|
|
274171
|
+
get fieldRef() {
|
|
274172
|
+
return `${this.recordID}.${this.key}`;
|
|
274173
|
+
}
|
|
273960
274174
|
when(when) {
|
|
273961
274175
|
return this.manager.lists.get(this.name).get(this.recordID).when(when);
|
|
273962
274176
|
}
|
|
@@ -275101,8 +275315,8 @@ var Cache4 = class {
|
|
|
275101
275315
|
variables
|
|
275102
275316
|
);
|
|
275103
275317
|
}
|
|
275104
|
-
list(name, parentID, allLists) {
|
|
275105
|
-
const handler = this._internal_unstable.lists.get(name, parentID, allLists);
|
|
275318
|
+
list(name, parentID, allLists, skipMatches) {
|
|
275319
|
+
const handler = this._internal_unstable.lists.get(name, parentID, allLists, skipMatches);
|
|
275106
275320
|
if (!handler) {
|
|
275107
275321
|
throw new Error(
|
|
275108
275322
|
`Cannot find list with name: ${name}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -275517,6 +275731,7 @@ var CacheInternal4 = class {
|
|
|
275517
275731
|
});
|
|
275518
275732
|
}
|
|
275519
275733
|
}
|
|
275734
|
+
const processedOperations = /* @__PURE__ */ new Set();
|
|
275520
275735
|
for (const operation of operations || []) {
|
|
275521
275736
|
let parentID;
|
|
275522
275737
|
if (operation.parentID) {
|
|
@@ -275536,7 +275751,12 @@ var CacheInternal4 = class {
|
|
|
275536
275751
|
const targets = Array.isArray(value) ? value : [value];
|
|
275537
275752
|
for (const target of targets) {
|
|
275538
275753
|
if (operation.action === "insert" && target instanceof Object && fieldSelection && operation.list) {
|
|
275539
|
-
this.cache.list(
|
|
275754
|
+
this.cache.list(
|
|
275755
|
+
operation.list,
|
|
275756
|
+
parentID,
|
|
275757
|
+
operation.target === "all",
|
|
275758
|
+
processedOperations
|
|
275759
|
+
).when(operation.when).addToList(
|
|
275540
275760
|
fieldSelection,
|
|
275541
275761
|
target,
|
|
275542
275762
|
variables,
|
|
@@ -275544,7 +275764,12 @@ var CacheInternal4 = class {
|
|
|
275544
275764
|
layer
|
|
275545
275765
|
);
|
|
275546
275766
|
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
275547
|
-
this.cache.list(
|
|
275767
|
+
this.cache.list(
|
|
275768
|
+
operation.list,
|
|
275769
|
+
parentID,
|
|
275770
|
+
operation.target === "all",
|
|
275771
|
+
processedOperations
|
|
275772
|
+
).when(operation.when).toggleElement({
|
|
275548
275773
|
selection: fieldSelection,
|
|
275549
275774
|
data: target,
|
|
275550
275775
|
variables,
|
|
@@ -275552,7 +275777,12 @@ var CacheInternal4 = class {
|
|
|
275552
275777
|
layer
|
|
275553
275778
|
});
|
|
275554
275779
|
} else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
|
|
275555
|
-
this.cache.list(
|
|
275780
|
+
this.cache.list(
|
|
275781
|
+
operation.list,
|
|
275782
|
+
parentID,
|
|
275783
|
+
operation.target === "all",
|
|
275784
|
+
processedOperations
|
|
275785
|
+
).when(operation.when).remove(target, variables, layer);
|
|
275556
275786
|
} else if (operation.action === "delete" && operation.type && target) {
|
|
275557
275787
|
const targetID = this.id(operation.type, target);
|
|
275558
275788
|
if (!targetID) {
|
|
@@ -275564,6 +275794,16 @@ var CacheInternal4 = class {
|
|
|
275564
275794
|
this.cache.delete(targetID, layer);
|
|
275565
275795
|
}
|
|
275566
275796
|
}
|
|
275797
|
+
if (operation.list) {
|
|
275798
|
+
const matchingLists = this.cache.list(
|
|
275799
|
+
operation.list,
|
|
275800
|
+
parentID,
|
|
275801
|
+
operation.target === "all"
|
|
275802
|
+
);
|
|
275803
|
+
for (const list3 of matchingLists.lists) {
|
|
275804
|
+
processedOperations.add(list3.fieldRef);
|
|
275805
|
+
}
|
|
275806
|
+
}
|
|
275567
275807
|
}
|
|
275568
275808
|
}
|
|
275569
275809
|
return toNotify;
|
|
@@ -276029,6 +276269,46 @@ var { keys: keys3 } = Object;
|
|
|
276029
276269
|
var recast43 = __toESM5(require_main24(), 1);
|
|
276030
276270
|
var AST43 = recast43.types.builders;
|
|
276031
276271
|
var pageInfoSelection3 = [
|
|
276272
|
+
{
|
|
276273
|
+
kind: graphql133.Kind.FIELD,
|
|
276274
|
+
name: {
|
|
276275
|
+
kind: graphql133.Kind.NAME,
|
|
276276
|
+
value: "pageInfo"
|
|
276277
|
+
},
|
|
276278
|
+
selectionSet: {
|
|
276279
|
+
kind: graphql133.Kind.SELECTION_SET,
|
|
276280
|
+
selections: [
|
|
276281
|
+
{
|
|
276282
|
+
kind: graphql133.Kind.FIELD,
|
|
276283
|
+
name: {
|
|
276284
|
+
kind: graphql133.Kind.NAME,
|
|
276285
|
+
value: "hasPreviousPage"
|
|
276286
|
+
}
|
|
276287
|
+
},
|
|
276288
|
+
{
|
|
276289
|
+
kind: graphql133.Kind.FIELD,
|
|
276290
|
+
name: {
|
|
276291
|
+
kind: graphql133.Kind.NAME,
|
|
276292
|
+
value: "hasNextPage"
|
|
276293
|
+
}
|
|
276294
|
+
},
|
|
276295
|
+
{
|
|
276296
|
+
kind: graphql133.Kind.FIELD,
|
|
276297
|
+
name: {
|
|
276298
|
+
kind: graphql133.Kind.NAME,
|
|
276299
|
+
value: "startCursor"
|
|
276300
|
+
}
|
|
276301
|
+
},
|
|
276302
|
+
{
|
|
276303
|
+
kind: graphql133.Kind.FIELD,
|
|
276304
|
+
name: {
|
|
276305
|
+
kind: graphql133.Kind.NAME,
|
|
276306
|
+
value: "endCursor"
|
|
276307
|
+
}
|
|
276308
|
+
}
|
|
276309
|
+
]
|
|
276310
|
+
}
|
|
276311
|
+
},
|
|
276032
276312
|
{
|
|
276033
276313
|
kind: graphql133.Kind.FIELD,
|
|
276034
276314
|
name: {
|
|
@@ -276299,7 +276579,7 @@ var printDocASTReducer22 = {
|
|
|
276299
276579
|
], " ")
|
|
276300
276580
|
},
|
|
276301
276581
|
UnionTypeDefinition: {
|
|
276302
|
-
leave: ({ name, directives, types:
|
|
276582
|
+
leave: ({ name, directives, types: types18 }) => join32(["union", name, join32(directives, " "), wrap22("= ", join32(types18, " | "))], " ")
|
|
276303
276583
|
},
|
|
276304
276584
|
EnumTypeDefinition: {
|
|
276305
276585
|
leave: ({ name, directives, values }) => join32(["enum", name, join32(directives, " "), block22(values)], " ")
|
|
@@ -276338,7 +276618,7 @@ var printDocASTReducer22 = {
|
|
|
276338
276618
|
], " ")
|
|
276339
276619
|
},
|
|
276340
276620
|
UnionTypeExtension: {
|
|
276341
|
-
leave: ({ name, directives, types:
|
|
276621
|
+
leave: ({ name, directives, types: types18 }) => join32(["extend union", name, join32(directives, " "), wrap22("= ", join32(types18, " | "))], " ")
|
|
276342
276622
|
},
|
|
276343
276623
|
EnumTypeExtension: {
|
|
276344
276624
|
leave: ({ name, directives, values }) => join32(["extend enum", name, join32(directives, " "), block22(values)], " ")
|
|
@@ -276375,6 +276655,8 @@ For more information, please visit these links:
|
|
|
276375
276655
|
- https://graphql.org/learn/global-object-identification/
|
|
276376
276656
|
- ${siteURL3}/guides/caching-data#custom-ids
|
|
276377
276657
|
`;
|
|
276658
|
+
var recast142 = __toESM5(require_main24(), 1);
|
|
276659
|
+
var AST142 = recast142.types.builders;
|
|
276378
276660
|
function find_insert_index(script) {
|
|
276379
276661
|
let insert_index = script.body.findIndex((statement) => {
|
|
276380
276662
|
return statement.type !== "ImportDeclaration";
|
|
@@ -276393,7 +276675,7 @@ function find_exported_fn(body, name) {
|
|
|
276393
276675
|
if (exportDeclaration.declaration?.type === "FunctionDeclaration") {
|
|
276394
276676
|
const value = exportDeclaration.declaration;
|
|
276395
276677
|
if (value.id?.name === name) {
|
|
276396
|
-
return exportDeclaration.declaration;
|
|
276678
|
+
return { declaration: exportDeclaration.declaration, export: exportDeclaration };
|
|
276397
276679
|
}
|
|
276398
276680
|
} else if (exportDeclaration.declaration?.type === "VariableDeclaration") {
|
|
276399
276681
|
const value = exportDeclaration.declaration;
|
|
@@ -276412,7 +276694,10 @@ function find_exported_fn(body, name) {
|
|
|
276412
276694
|
init2 = init2.arguments[0];
|
|
276413
276695
|
}
|
|
276414
276696
|
if (init2.type === "FunctionExpression" || init2.type === "ArrowFunctionExpression") {
|
|
276415
|
-
return init2;
|
|
276697
|
+
return { declaration: init2, export: exportDeclaration };
|
|
276698
|
+
}
|
|
276699
|
+
if (init2.type === "Identifier" || init2.type === "CallExpression") {
|
|
276700
|
+
return { declaration: init2, export: exportDeclaration };
|
|
276416
276701
|
}
|
|
276417
276702
|
} else {
|
|
276418
276703
|
continue;
|
|
@@ -276424,10 +276709,10 @@ function find_exported_fn(body, name) {
|
|
|
276424
276709
|
if (!exported) {
|
|
276425
276710
|
return null;
|
|
276426
276711
|
}
|
|
276427
|
-
return exported.declaration;
|
|
276712
|
+
return { declaration: exported.declaration, export: exported };
|
|
276428
276713
|
}
|
|
276429
|
-
var
|
|
276430
|
-
var
|
|
276714
|
+
var recast152 = __toESM5(require_main24(), 1);
|
|
276715
|
+
var AST152 = recast152.types.builders;
|
|
276431
276716
|
function ensure_imports({
|
|
276432
276717
|
config: config2,
|
|
276433
276718
|
script,
|
|
@@ -276443,13 +276728,13 @@ function ensure_imports({
|
|
|
276443
276728
|
if (!has_import) {
|
|
276444
276729
|
script.body.unshift({
|
|
276445
276730
|
type: "ImportDeclaration",
|
|
276446
|
-
source:
|
|
276731
|
+
source: AST152.stringLiteral(sourceModule),
|
|
276447
276732
|
importKind
|
|
276448
276733
|
});
|
|
276449
276734
|
}
|
|
276450
276735
|
return { ids: [], added: has_import ? 0 : 1 };
|
|
276451
276736
|
}
|
|
276452
|
-
const idList = (Array.isArray(importID) ? importID : [importID]).map((id2) =>
|
|
276737
|
+
const idList = (Array.isArray(importID) ? importID : [importID]).map((id2) => AST152.identifier(id2));
|
|
276453
276738
|
const toImport = idList.filter(
|
|
276454
276739
|
(identifier) => !script.body.find(
|
|
276455
276740
|
(statement) => statement.type === "ImportDeclaration" && statement.specifiers?.find(
|
|
@@ -276460,16 +276745,16 @@ function ensure_imports({
|
|
|
276460
276745
|
if (toImport.length > 0) {
|
|
276461
276746
|
script.body.unshift({
|
|
276462
276747
|
type: "ImportDeclaration",
|
|
276463
|
-
source:
|
|
276748
|
+
source: AST152.stringLiteral(sourceModule),
|
|
276464
276749
|
specifiers: toImport.map(
|
|
276465
|
-
(identifier, i22) => !Array.isArray(importID) ?
|
|
276750
|
+
(identifier, i22) => !Array.isArray(importID) ? AST152.importDefaultSpecifier(identifier) : AST152.importSpecifier(identifier, as?.[i22] ? AST152.identifier(as[i22]) : identifier)
|
|
276466
276751
|
),
|
|
276467
276752
|
importKind
|
|
276468
276753
|
});
|
|
276469
276754
|
}
|
|
276470
276755
|
for (const [i22, target] of (as ?? []).entries()) {
|
|
276471
276756
|
if (target) {
|
|
276472
|
-
idList[i22] =
|
|
276757
|
+
idList[i22] = AST152.identifier(target);
|
|
276473
276758
|
}
|
|
276474
276759
|
}
|
|
276475
276760
|
return {
|
|
@@ -295066,24 +295351,28 @@ function add_load_return(page, properties) {
|
|
|
295066
295351
|
} else {
|
|
295067
295352
|
return_statement = AST20.returnStatement(AST20.objectExpression([]));
|
|
295068
295353
|
body.body.push(return_statement);
|
|
295069
|
-
return_statement_index = body.body.length - 1;
|
|
295070
295354
|
}
|
|
295071
|
-
|
|
295072
|
-
|
|
295073
|
-
|
|
295074
|
-
|
|
295075
|
-
|
|
295076
|
-
|
|
295077
|
-
|
|
295078
|
-
|
|
295079
|
-
|
|
295080
|
-
|
|
295081
|
-
|
|
295355
|
+
return walk(body, {
|
|
295356
|
+
enter(node) {
|
|
295357
|
+
if (node.type === "ReturnStatement") {
|
|
295358
|
+
const returnedValue = node.argument;
|
|
295359
|
+
this.replace(
|
|
295360
|
+
AST20.returnStatement(
|
|
295361
|
+
AST20.objectExpression([
|
|
295362
|
+
...properties(event_id),
|
|
295363
|
+
AST20.spreadElement(returnedValue ?? AST20.objectExpression([]))
|
|
295364
|
+
])
|
|
295365
|
+
)
|
|
295366
|
+
);
|
|
295367
|
+
}
|
|
295368
|
+
}
|
|
295369
|
+
});
|
|
295082
295370
|
});
|
|
295083
295371
|
}
|
|
295084
295372
|
function modify_load(page, cb) {
|
|
295085
|
-
let
|
|
295373
|
+
let exported = find_exported_fn(page.script.body, "load");
|
|
295086
295374
|
let event_id = AST20.identifier("event");
|
|
295375
|
+
let load_fn = exported?.declaration || null;
|
|
295087
295376
|
let body = AST20.blockStatement([]);
|
|
295088
295377
|
if (load_fn?.type === "ArrowFunctionExpression") {
|
|
295089
295378
|
if (load_fn.body.type === "BlockStatement") {
|
|
@@ -295092,7 +295381,7 @@ function modify_load(page, cb) {
|
|
|
295092
295381
|
body = AST20.blockStatement([AST20.returnStatement(load_fn.body)]);
|
|
295093
295382
|
load_fn.body = body;
|
|
295094
295383
|
}
|
|
295095
|
-
} else if (load_fn) {
|
|
295384
|
+
} else if (load_fn && "body" in load_fn) {
|
|
295096
295385
|
body = load_fn.body;
|
|
295097
295386
|
}
|
|
295098
295387
|
if (!load_fn) {
|
|
@@ -295108,6 +295397,30 @@ function modify_load(page, cb) {
|
|
|
295108
295397
|
AST20.exportNamedDeclaration(load_fn)
|
|
295109
295398
|
);
|
|
295110
295399
|
body = load_fn.body;
|
|
295400
|
+
} else if (load_fn.type === "CallExpression" || load_fn.type === "Identifier") {
|
|
295401
|
+
const exportStatement = exported?.export;
|
|
295402
|
+
if (!exportStatement) {
|
|
295403
|
+
return;
|
|
295404
|
+
}
|
|
295405
|
+
const intermediateID = AST20.identifier("houdini__intermediate__load__");
|
|
295406
|
+
page.script.body.push(
|
|
295407
|
+
AST20.variableDeclaration("const", [AST20.variableDeclarator(intermediateID, load_fn)])
|
|
295408
|
+
);
|
|
295409
|
+
const newLoad = AST20.arrowFunctionExpression(
|
|
295410
|
+
[AST20.identifier("event")],
|
|
295411
|
+
AST20.blockStatement([
|
|
295412
|
+
AST20.variableDeclaration("const", [
|
|
295413
|
+
AST20.variableDeclarator(
|
|
295414
|
+
AST20.identifier("result"),
|
|
295415
|
+
AST20.callExpression(intermediateID, [AST20.identifier("event")])
|
|
295416
|
+
)
|
|
295417
|
+
]),
|
|
295418
|
+
AST20.returnStatement(AST20.identifier("result"))
|
|
295419
|
+
])
|
|
295420
|
+
);
|
|
295421
|
+
exportStatement.declaration.declarations[0].init = newLoad;
|
|
295422
|
+
load_fn = newLoad;
|
|
295423
|
+
body = newLoad.body;
|
|
295111
295424
|
} else {
|
|
295112
295425
|
if (load_fn.params.length === 0) {
|
|
295113
295426
|
load_fn.params.push(event_id);
|
|
@@ -295125,7 +295438,7 @@ function modify_load(page, cb) {
|
|
|
295125
295438
|
);
|
|
295126
295439
|
}
|
|
295127
295440
|
}
|
|
295128
|
-
cb(body, event_id);
|
|
295441
|
+
load_fn.body = cb(body, event_id);
|
|
295129
295442
|
}
|
|
295130
295443
|
|
|
295131
295444
|
// src/plugin/transforms/kit/index.ts
|