@putout/bundle 3.21.1 → 3.22.0
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/bundle/putout.js +752 -494
- package/bundle/putout.min.js +1 -1
- package/package.json +2 -2
package/bundle/putout.js
CHANGED
|
@@ -8224,6 +8224,24 @@ var require_globals = __commonJS({
|
|
|
8224
8224
|
uniq: false,
|
|
8225
8225
|
which: false
|
|
8226
8226
|
},
|
|
8227
|
+
vitest: {
|
|
8228
|
+
afterAll: false,
|
|
8229
|
+
afterEach: false,
|
|
8230
|
+
assert: false,
|
|
8231
|
+
assertType: false,
|
|
8232
|
+
beforeAll: false,
|
|
8233
|
+
beforeEach: false,
|
|
8234
|
+
describe: false,
|
|
8235
|
+
expect: false,
|
|
8236
|
+
expectTypeOf: false,
|
|
8237
|
+
it: false,
|
|
8238
|
+
onTestFailed: false,
|
|
8239
|
+
onTestFinished: false,
|
|
8240
|
+
suite: false,
|
|
8241
|
+
test: false,
|
|
8242
|
+
vi: false,
|
|
8243
|
+
vitest: false
|
|
8244
|
+
},
|
|
8227
8245
|
webextensions: {
|
|
8228
8246
|
browser: false,
|
|
8229
8247
|
chrome: false,
|
|
@@ -8555,8 +8573,8 @@ var require_globals2 = __commonJS({
|
|
|
8555
8573
|
}
|
|
8556
8574
|
});
|
|
8557
8575
|
// lib/index.mjs
|
|
8558
|
-
var
|
|
8559
|
-
__export(
|
|
8576
|
+
var index_exports = {};
|
|
8577
|
+
__export(index_exports, {
|
|
8560
8578
|
codeFrameColumns: function() {
|
|
8561
8579
|
return codeFrameColumns$2;
|
|
8562
8580
|
},
|
|
@@ -8582,7 +8600,7 @@ __export(lib_exports2, {
|
|
|
8582
8600
|
return lib_exports;
|
|
8583
8601
|
}
|
|
8584
8602
|
});
|
|
8585
|
-
var bundle = __toCommonJS(
|
|
8603
|
+
var bundle = __toCommonJS(index_exports);
|
|
8586
8604
|
// node_modules/@babel/types/lib/index.js
|
|
8587
8605
|
var lib_exports = {};
|
|
8588
8606
|
__export(lib_exports, {
|
|
@@ -9315,6 +9333,9 @@ __export(lib_exports, {
|
|
|
9315
9333
|
TSENTITYNAME_TYPES: function() {
|
|
9316
9334
|
return TSENTITYNAME_TYPES;
|
|
9317
9335
|
},
|
|
9336
|
+
TSEnumBody: function() {
|
|
9337
|
+
return tsEnumBody;
|
|
9338
|
+
},
|
|
9318
9339
|
TSEnumDeclaration: function() {
|
|
9319
9340
|
return tsEnumDeclaration$1;
|
|
9320
9341
|
},
|
|
@@ -10266,6 +10287,9 @@ __export(lib_exports, {
|
|
|
10266
10287
|
assertTSEntityName: function() {
|
|
10267
10288
|
return assertTSEntityName;
|
|
10268
10289
|
},
|
|
10290
|
+
assertTSEnumBody: function() {
|
|
10291
|
+
return assertTSEnumBody;
|
|
10292
|
+
},
|
|
10269
10293
|
assertTSEnumDeclaration: function() {
|
|
10270
10294
|
return assertTSEnumDeclaration;
|
|
10271
10295
|
},
|
|
@@ -11523,6 +11547,9 @@ __export(lib_exports, {
|
|
|
11523
11547
|
isTSEntityName: function() {
|
|
11524
11548
|
return isTSEntityName;
|
|
11525
11549
|
},
|
|
11550
|
+
isTSEnumBody: function() {
|
|
11551
|
+
return isTSEnumBody;
|
|
11552
|
+
},
|
|
11526
11553
|
isTSEnumDeclaration: function() {
|
|
11527
11554
|
return isTSEnumDeclaration;
|
|
11528
11555
|
},
|
|
@@ -12117,6 +12144,9 @@ __export(lib_exports, {
|
|
|
12117
12144
|
tsDeclareMethod: function() {
|
|
12118
12145
|
return tsDeclareMethod$1;
|
|
12119
12146
|
},
|
|
12147
|
+
tsEnumBody: function() {
|
|
12148
|
+
return tsEnumBody;
|
|
12149
|
+
},
|
|
12120
12150
|
tsEnumDeclaration: function() {
|
|
12121
12151
|
return tsEnumDeclaration$1;
|
|
12122
12152
|
},
|
|
@@ -14866,6 +14896,11 @@ function isTSTypeAssertion(node, opts) {
|
|
|
14866
14896
|
if (node.type !== "TSTypeAssertion") return false;
|
|
14867
14897
|
return opts == null || shallowEqual(node, opts);
|
|
14868
14898
|
}
|
|
14899
|
+
function isTSEnumBody(node, opts) {
|
|
14900
|
+
if (!node) return false;
|
|
14901
|
+
if (node.type !== "TSEnumBody") return false;
|
|
14902
|
+
return opts == null || shallowEqual(node, opts);
|
|
14903
|
+
}
|
|
14869
14904
|
function isTSEnumDeclaration(node, opts) {
|
|
14870
14905
|
if (!node) return false;
|
|
14871
14906
|
if (node.type !== "TSEnumDeclaration") return false;
|
|
@@ -15964,6 +15999,7 @@ function isTypeScript(node, opts) {
|
|
|
15964
15999
|
case "TSAsExpression":
|
|
15965
16000
|
case "TSSatisfiesExpression":
|
|
15966
16001
|
case "TSTypeAssertion":
|
|
16002
|
+
case "TSEnumBody":
|
|
15967
16003
|
case "TSEnumDeclaration":
|
|
15968
16004
|
case "TSEnumMember":
|
|
15969
16005
|
case "TSModuleDeclaration":
|
|
@@ -16943,7 +16979,6 @@ defineType$4("CallExpression", {
|
|
|
16943
16979
|
visitor: [
|
|
16944
16980
|
"callee",
|
|
16945
16981
|
"arguments",
|
|
16946
|
-
"typeParameters",
|
|
16947
16982
|
"typeArguments"
|
|
16948
16983
|
],
|
|
16949
16984
|
builder: [
|
|
@@ -16957,17 +16992,12 @@ defineType$4("CallExpression", {
|
|
|
16957
16992
|
callee: {
|
|
16958
16993
|
validate: assertNodeType("Expression", "Super", "V8IntrinsicIdentifier")
|
|
16959
16994
|
},
|
|
16960
|
-
arguments: validateArrayOfType("Expression", "SpreadElement", "ArgumentPlaceholder")
|
|
16961
|
-
}, {}, {
|
|
16995
|
+
arguments: validateArrayOfType("Expression", "SpreadElement", "ArgumentPlaceholder"),
|
|
16962
16996
|
typeArguments: {
|
|
16963
|
-
validate: assertNodeType("TypeParameterInstantiation"),
|
|
16964
|
-
optional: true
|
|
16965
|
-
},
|
|
16966
|
-
typeParameters: {
|
|
16967
|
-
validate: assertNodeType("TSTypeParameterInstantiation"),
|
|
16997
|
+
validate: assertNodeType("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
|
|
16968
16998
|
optional: true
|
|
16969
16999
|
}
|
|
16970
|
-
})
|
|
17000
|
+
}, {}, {} )
|
|
16971
17001
|
});
|
|
16972
17002
|
defineType$4("CatchClause", {
|
|
16973
17003
|
visitor: [
|
|
@@ -17205,6 +17235,7 @@ defineType$4("FunctionDeclaration", {
|
|
|
17205
17235
|
"id",
|
|
17206
17236
|
"typeParameters",
|
|
17207
17237
|
"params",
|
|
17238
|
+
"predicate",
|
|
17208
17239
|
"returnType",
|
|
17209
17240
|
"body"
|
|
17210
17241
|
],
|
|
@@ -18062,6 +18093,7 @@ defineType$4("ArrowFunctionExpression", {
|
|
|
18062
18093
|
visitor: [
|
|
18063
18094
|
"typeParameters",
|
|
18064
18095
|
"params",
|
|
18096
|
+
"predicate",
|
|
18065
18097
|
"returnType",
|
|
18066
18098
|
"body"
|
|
18067
18099
|
],
|
|
@@ -18651,7 +18683,7 @@ defineType$4("Super", undefined);
|
|
|
18651
18683
|
defineType$4("TaggedTemplateExpression", {
|
|
18652
18684
|
visitor: [
|
|
18653
18685
|
"tag",
|
|
18654
|
-
"
|
|
18686
|
+
"typeArguments",
|
|
18655
18687
|
"quasi"
|
|
18656
18688
|
],
|
|
18657
18689
|
builder: [
|
|
@@ -18661,18 +18693,17 @@ defineType$4("TaggedTemplateExpression", {
|
|
|
18661
18693
|
aliases: [
|
|
18662
18694
|
"Expression"
|
|
18663
18695
|
],
|
|
18664
|
-
fields: {
|
|
18696
|
+
fields: _define_property({
|
|
18665
18697
|
tag: {
|
|
18666
18698
|
validate: assertNodeType("Expression")
|
|
18667
18699
|
},
|
|
18668
18700
|
quasi: {
|
|
18669
18701
|
validate: assertNodeType("TemplateLiteral")
|
|
18670
|
-
},
|
|
18671
|
-
typeParameters: {
|
|
18672
|
-
validate: assertNodeType("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
|
|
18673
|
-
optional: true
|
|
18674
18702
|
}
|
|
18675
|
-
}
|
|
18703
|
+
}, "typeArguments", {
|
|
18704
|
+
validate: assertNodeType("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
|
|
18705
|
+
optional: true
|
|
18706
|
+
})
|
|
18676
18707
|
});
|
|
18677
18708
|
defineType$4("TemplateElement", {
|
|
18678
18709
|
builder: [
|
|
@@ -18861,7 +18892,6 @@ defineType$4("OptionalCallExpression", {
|
|
|
18861
18892
|
visitor: [
|
|
18862
18893
|
"callee",
|
|
18863
18894
|
"arguments",
|
|
18864
|
-
"typeParameters",
|
|
18865
18895
|
"typeArguments"
|
|
18866
18896
|
],
|
|
18867
18897
|
builder: [
|
|
@@ -18872,7 +18902,7 @@ defineType$4("OptionalCallExpression", {
|
|
|
18872
18902
|
aliases: [
|
|
18873
18903
|
"Expression"
|
|
18874
18904
|
],
|
|
18875
|
-
fields: {
|
|
18905
|
+
fields: Object.assign({
|
|
18876
18906
|
callee: {
|
|
18877
18907
|
validate: assertNodeType("Expression")
|
|
18878
18908
|
},
|
|
@@ -18881,18 +18911,15 @@ defineType$4("OptionalCallExpression", {
|
|
|
18881
18911
|
validate: chain$4(assertValueType("boolean"), assertOptionalChainStart())
|
|
18882
18912
|
},
|
|
18883
18913
|
typeArguments: {
|
|
18884
|
-
validate: assertNodeType("TypeParameterInstantiation"),
|
|
18885
|
-
optional: true
|
|
18886
|
-
},
|
|
18887
|
-
typeParameters: {
|
|
18888
|
-
validate: assertNodeType("TSTypeParameterInstantiation"),
|
|
18914
|
+
validate: assertNodeType("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
|
|
18889
18915
|
optional: true
|
|
18890
18916
|
}
|
|
18891
|
-
}
|
|
18917
|
+
}, {})
|
|
18892
18918
|
});
|
|
18893
18919
|
defineType$4("ClassProperty", {
|
|
18894
18920
|
visitor: [
|
|
18895
18921
|
"decorators",
|
|
18922
|
+
"variance",
|
|
18896
18923
|
"key",
|
|
18897
18924
|
"typeAnnotation",
|
|
18898
18925
|
"value"
|
|
@@ -19002,6 +19029,7 @@ defineType$4("ClassAccessorProperty", {
|
|
|
19002
19029
|
defineType$4("ClassPrivateProperty", {
|
|
19003
19030
|
visitor: [
|
|
19004
19031
|
"decorators",
|
|
19032
|
+
"variance",
|
|
19005
19033
|
"key",
|
|
19006
19034
|
"typeAnnotation",
|
|
19007
19035
|
"value"
|
|
@@ -19202,9 +19230,13 @@ defineType$3("ClassImplements", {
|
|
|
19202
19230
|
});
|
|
19203
19231
|
defineInterfaceishType("DeclareClass");
|
|
19204
19232
|
defineType$3("DeclareFunction", {
|
|
19205
|
-
|
|
19233
|
+
builder: [
|
|
19206
19234
|
"id"
|
|
19207
19235
|
],
|
|
19236
|
+
visitor: [
|
|
19237
|
+
"id",
|
|
19238
|
+
"predicate"
|
|
19239
|
+
],
|
|
19208
19240
|
aliases: [
|
|
19209
19241
|
"FlowDeclaration",
|
|
19210
19242
|
"Statement",
|
|
@@ -19349,8 +19381,15 @@ defineType$3("ExistsTypeAnnotation", {
|
|
|
19349
19381
|
]
|
|
19350
19382
|
});
|
|
19351
19383
|
defineType$3("FunctionTypeAnnotation", {
|
|
19384
|
+
builder: [
|
|
19385
|
+
"typeParameters",
|
|
19386
|
+
"params",
|
|
19387
|
+
"rest",
|
|
19388
|
+
"returnType"
|
|
19389
|
+
],
|
|
19352
19390
|
visitor: [
|
|
19353
19391
|
"typeParameters",
|
|
19392
|
+
"this",
|
|
19354
19393
|
"params",
|
|
19355
19394
|
"rest",
|
|
19356
19395
|
"returnType"
|
|
@@ -19847,9 +19886,13 @@ defineType$3("EnumBooleanMember", {
|
|
|
19847
19886
|
aliases: [
|
|
19848
19887
|
"EnumMember"
|
|
19849
19888
|
],
|
|
19850
|
-
|
|
19889
|
+
builder: [
|
|
19851
19890
|
"id"
|
|
19852
19891
|
],
|
|
19892
|
+
visitor: [
|
|
19893
|
+
"id",
|
|
19894
|
+
"init"
|
|
19895
|
+
],
|
|
19853
19896
|
fields: {
|
|
19854
19897
|
id: validateType("Identifier"),
|
|
19855
19898
|
init: validateType("BooleanLiteral")
|
|
@@ -20050,12 +20093,13 @@ defineType$2("JSXOpeningElement", {
|
|
|
20050
20093
|
],
|
|
20051
20094
|
visitor: [
|
|
20052
20095
|
"name",
|
|
20096
|
+
"typeArguments",
|
|
20053
20097
|
"attributes"
|
|
20054
20098
|
],
|
|
20055
20099
|
aliases: [
|
|
20056
20100
|
"Immutable"
|
|
20057
20101
|
],
|
|
20058
|
-
fields: {
|
|
20102
|
+
fields: Object.assign({
|
|
20059
20103
|
name: {
|
|
20060
20104
|
validate: assertNodeType("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName")
|
|
20061
20105
|
},
|
|
@@ -20063,11 +20107,11 @@ defineType$2("JSXOpeningElement", {
|
|
|
20063
20107
|
default: false
|
|
20064
20108
|
},
|
|
20065
20109
|
attributes: validateArrayOfType("JSXAttribute", "JSXSpreadAttribute"),
|
|
20066
|
-
|
|
20110
|
+
typeArguments: {
|
|
20067
20111
|
validate: assertNodeType("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
|
|
20068
20112
|
optional: true
|
|
20069
20113
|
}
|
|
20070
|
-
}
|
|
20114
|
+
}, {})
|
|
20071
20115
|
});
|
|
20072
20116
|
defineType$2("JSXSpreadAttribute", {
|
|
20073
20117
|
visitor: [
|
|
@@ -20617,12 +20661,11 @@ defineType("TSTypeQuery", {
|
|
|
20617
20661
|
],
|
|
20618
20662
|
visitor: [
|
|
20619
20663
|
"exprName",
|
|
20620
|
-
"
|
|
20664
|
+
"typeArguments"
|
|
20621
20665
|
],
|
|
20622
|
-
fields: {
|
|
20623
|
-
exprName: validateType("TSEntityName", "TSImportType")
|
|
20624
|
-
|
|
20625
|
-
}
|
|
20666
|
+
fields: _define_property({
|
|
20667
|
+
exprName: validateType("TSEntityName", "TSImportType")
|
|
20668
|
+
}, "typeArguments", validateOptionalType("TSTypeParameterInstantiation"))
|
|
20626
20669
|
});
|
|
20627
20670
|
defineType("TSTypeLiteral", {
|
|
20628
20671
|
aliases: [
|
|
@@ -20836,22 +20879,33 @@ defineType("TSLiteralType", {
|
|
|
20836
20879
|
}
|
|
20837
20880
|
}
|
|
20838
20881
|
});
|
|
20839
|
-
var expressionWithTypeArguments = {
|
|
20840
|
-
aliases: [
|
|
20841
|
-
"TSType"
|
|
20842
|
-
],
|
|
20843
|
-
visitor: [
|
|
20844
|
-
"expression",
|
|
20845
|
-
"typeParameters"
|
|
20846
|
-
],
|
|
20847
|
-
fields: {
|
|
20848
|
-
expression: validateType("TSEntityName"),
|
|
20849
|
-
typeParameters: validateOptionalType("TSTypeParameterInstantiation")
|
|
20850
|
-
}
|
|
20851
|
-
};
|
|
20852
20882
|
{
|
|
20853
|
-
defineType("TSClassImplements",
|
|
20854
|
-
|
|
20883
|
+
defineType("TSClassImplements", {
|
|
20884
|
+
aliases: [
|
|
20885
|
+
"TSType"
|
|
20886
|
+
],
|
|
20887
|
+
visitor: [
|
|
20888
|
+
"expression",
|
|
20889
|
+
"typeArguments"
|
|
20890
|
+
],
|
|
20891
|
+
fields: {
|
|
20892
|
+
expression: validateType("TSEntityName"),
|
|
20893
|
+
typeArguments: validateOptionalType("TSTypeParameterInstantiation")
|
|
20894
|
+
}
|
|
20895
|
+
});
|
|
20896
|
+
defineType("TSInterfaceHeritage", {
|
|
20897
|
+
aliases: [
|
|
20898
|
+
"TSType"
|
|
20899
|
+
],
|
|
20900
|
+
visitor: [
|
|
20901
|
+
"expression",
|
|
20902
|
+
"typeArguments"
|
|
20903
|
+
],
|
|
20904
|
+
fields: {
|
|
20905
|
+
expression: validateType("TSEntityName"),
|
|
20906
|
+
typeArguments: validateOptionalType("TSTypeParameterInstantiation")
|
|
20907
|
+
}
|
|
20908
|
+
});
|
|
20855
20909
|
}defineType("TSInterfaceDeclaration", {
|
|
20856
20910
|
aliases: [
|
|
20857
20911
|
"Statement",
|
|
@@ -20902,12 +20956,11 @@ defineType("TSInstantiationExpression", {
|
|
|
20902
20956
|
],
|
|
20903
20957
|
visitor: [
|
|
20904
20958
|
"expression",
|
|
20905
|
-
"
|
|
20959
|
+
"typeArguments"
|
|
20906
20960
|
],
|
|
20907
|
-
fields: {
|
|
20908
|
-
expression: validateType("Expression")
|
|
20909
|
-
|
|
20910
|
-
}
|
|
20961
|
+
fields: _define_property({
|
|
20962
|
+
expression: validateType("Expression")
|
|
20963
|
+
}, "typeArguments", validateOptionalType("TSTypeParameterInstantiation"))
|
|
20911
20964
|
});
|
|
20912
20965
|
var TSTypeExpression = {
|
|
20913
20966
|
aliases: [
|
|
@@ -20941,24 +20994,32 @@ defineType("TSTypeAssertion", {
|
|
|
20941
20994
|
expression: validateType("Expression")
|
|
20942
20995
|
}
|
|
20943
20996
|
});
|
|
20944
|
-
defineType("
|
|
20945
|
-
aliases: [
|
|
20946
|
-
"Statement",
|
|
20947
|
-
"Declaration"
|
|
20948
|
-
],
|
|
20997
|
+
defineType("TSEnumBody", {
|
|
20949
20998
|
visitor: [
|
|
20950
|
-
"id",
|
|
20951
20999
|
"members"
|
|
20952
21000
|
],
|
|
20953
21001
|
fields: {
|
|
20954
|
-
|
|
20955
|
-
const: validateOptional(bool),
|
|
20956
|
-
id: validateType("Identifier"),
|
|
20957
|
-
members: validateArrayOfType("TSEnumMember"),
|
|
20958
|
-
initializer: validateOptionalType("Expression")
|
|
21002
|
+
members: validateArrayOfType("TSEnumMember")
|
|
20959
21003
|
}
|
|
20960
21004
|
});
|
|
20961
|
-
|
|
21005
|
+
{
|
|
21006
|
+
defineType("TSEnumDeclaration", {
|
|
21007
|
+
aliases: [
|
|
21008
|
+
"Statement",
|
|
21009
|
+
"Declaration"
|
|
21010
|
+
],
|
|
21011
|
+
visitor: [
|
|
21012
|
+
"id",
|
|
21013
|
+
"body"
|
|
21014
|
+
],
|
|
21015
|
+
fields: {
|
|
21016
|
+
declare: validateOptional(bool),
|
|
21017
|
+
const: validateOptional(bool),
|
|
21018
|
+
id: validateType("Identifier"),
|
|
21019
|
+
body: validateType("TSEnumBody")
|
|
21020
|
+
}
|
|
21021
|
+
});
|
|
21022
|
+
}defineType("TSEnumMember", {
|
|
20962
21023
|
visitor: [
|
|
20963
21024
|
"id",
|
|
20964
21025
|
"initializer"
|
|
@@ -21001,24 +21062,29 @@ defineType("TSModuleBlock", {
|
|
|
21001
21062
|
body: validateArrayOfType("Statement")
|
|
21002
21063
|
}
|
|
21003
21064
|
});
|
|
21065
|
+
var _obj2;
|
|
21004
21066
|
defineType("TSImportType", {
|
|
21005
21067
|
aliases: [
|
|
21006
21068
|
"TSType"
|
|
21007
21069
|
],
|
|
21070
|
+
builder: [
|
|
21071
|
+
"argument",
|
|
21072
|
+
"qualifier",
|
|
21073
|
+
"typeArguments"
|
|
21074
|
+
],
|
|
21008
21075
|
visitor: [
|
|
21009
21076
|
"argument",
|
|
21077
|
+
"options",
|
|
21010
21078
|
"qualifier",
|
|
21011
|
-
"
|
|
21079
|
+
"typeArguments"
|
|
21012
21080
|
],
|
|
21013
|
-
fields: {
|
|
21014
|
-
argument: validateType("
|
|
21015
|
-
qualifier: validateOptionalType("TSEntityName")
|
|
21016
|
-
|
|
21017
|
-
|
|
21018
|
-
|
|
21019
|
-
|
|
21020
|
-
}
|
|
21021
|
-
}
|
|
21081
|
+
fields: (_obj2 = {
|
|
21082
|
+
argument: validateType("TSLiteralType"),
|
|
21083
|
+
qualifier: validateOptionalType("TSEntityName")
|
|
21084
|
+
}, _define_property(_obj2, "typeArguments", validateOptionalType("TSTypeParameterInstantiation")), _define_property(_obj2, "options", {
|
|
21085
|
+
validate: assertNodeType("Expression"),
|
|
21086
|
+
optional: true
|
|
21087
|
+
}), _obj2)
|
|
21022
21088
|
});
|
|
21023
21089
|
defineType("TSImportEqualsDeclaration", {
|
|
21024
21090
|
aliases: [
|
|
@@ -21114,6 +21180,7 @@ defineType("TSTypeParameter", {
|
|
|
21114
21180
|
"name"
|
|
21115
21181
|
],
|
|
21116
21182
|
visitor: [
|
|
21183
|
+
"name",
|
|
21117
21184
|
"constraint",
|
|
21118
21185
|
"default"
|
|
21119
21186
|
],
|
|
@@ -23420,15 +23487,15 @@ function tsTypePredicate(parameterName) {
|
|
|
23420
23487
|
return node;
|
|
23421
23488
|
}
|
|
23422
23489
|
function tsTypeQuery$1(exprName) {
|
|
23423
|
-
var
|
|
23490
|
+
var typeArguments = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
23424
23491
|
var node = {
|
|
23425
23492
|
type: "TSTypeQuery",
|
|
23426
23493
|
exprName: exprName,
|
|
23427
|
-
|
|
23494
|
+
typeArguments: typeArguments
|
|
23428
23495
|
};
|
|
23429
23496
|
var defs = NODE_FIELDS.TSTypeQuery;
|
|
23430
23497
|
validate$4(defs.exprName, node, "exprName", exprName, 1);
|
|
23431
|
-
validate$4(defs.
|
|
23498
|
+
validate$4(defs.typeArguments, node, "typeArguments", typeArguments, 1);
|
|
23432
23499
|
return node;
|
|
23433
23500
|
}
|
|
23434
23501
|
function tsTypeLiteral$1(members) {
|
|
@@ -23588,27 +23655,27 @@ function tsLiteralType(literal) {
|
|
|
23588
23655
|
return node;
|
|
23589
23656
|
}
|
|
23590
23657
|
function tsClassImplements(expression2) {
|
|
23591
|
-
var
|
|
23658
|
+
var typeArguments = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
23592
23659
|
var node = {
|
|
23593
23660
|
type: "TSClassImplements",
|
|
23594
23661
|
expression: expression2,
|
|
23595
|
-
|
|
23662
|
+
typeArguments: typeArguments
|
|
23596
23663
|
};
|
|
23597
23664
|
var defs = NODE_FIELDS.TSClassImplements;
|
|
23598
23665
|
validate$4(defs.expression, node, "expression", expression2, 1);
|
|
23599
|
-
validate$4(defs.
|
|
23666
|
+
validate$4(defs.typeArguments, node, "typeArguments", typeArguments, 1);
|
|
23600
23667
|
return node;
|
|
23601
23668
|
}
|
|
23602
23669
|
function tsInterfaceHeritage(expression2) {
|
|
23603
|
-
var
|
|
23670
|
+
var typeArguments = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
23604
23671
|
var node = {
|
|
23605
23672
|
type: "TSInterfaceHeritage",
|
|
23606
23673
|
expression: expression2,
|
|
23607
|
-
|
|
23674
|
+
typeArguments: typeArguments
|
|
23608
23675
|
};
|
|
23609
23676
|
var defs = NODE_FIELDS.TSInterfaceHeritage;
|
|
23610
23677
|
validate$4(defs.expression, node, "expression", expression2, 1);
|
|
23611
|
-
validate$4(defs.
|
|
23678
|
+
validate$4(defs.typeArguments, node, "typeArguments", typeArguments, 1);
|
|
23612
23679
|
return node;
|
|
23613
23680
|
}
|
|
23614
23681
|
function tsInterfaceDeclaration$1(id) {
|
|
@@ -23651,15 +23718,15 @@ function tsTypeAliasDeclaration$1(id) {
|
|
|
23651
23718
|
return node;
|
|
23652
23719
|
}
|
|
23653
23720
|
function tsInstantiationExpression(expression2) {
|
|
23654
|
-
var
|
|
23721
|
+
var typeArguments = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
23655
23722
|
var node = {
|
|
23656
23723
|
type: "TSInstantiationExpression",
|
|
23657
23724
|
expression: expression2,
|
|
23658
|
-
|
|
23725
|
+
typeArguments: typeArguments
|
|
23659
23726
|
};
|
|
23660
23727
|
var defs = NODE_FIELDS.TSInstantiationExpression;
|
|
23661
23728
|
validate$4(defs.expression, node, "expression", expression2, 1);
|
|
23662
|
-
validate$4(defs.
|
|
23729
|
+
validate$4(defs.typeArguments, node, "typeArguments", typeArguments, 1);
|
|
23663
23730
|
return node;
|
|
23664
23731
|
}
|
|
23665
23732
|
function tsAsExpression$1(expression2, typeAnnotation2) {
|
|
@@ -23695,15 +23762,24 @@ function tsTypeAssertion(typeAnnotation2, expression2) {
|
|
|
23695
23762
|
validate$4(defs.expression, node, "expression", expression2, 1);
|
|
23696
23763
|
return node;
|
|
23697
23764
|
}
|
|
23698
|
-
function
|
|
23765
|
+
function tsEnumBody(members) {
|
|
23766
|
+
var node = {
|
|
23767
|
+
type: "TSEnumBody",
|
|
23768
|
+
members: members
|
|
23769
|
+
};
|
|
23770
|
+
var defs = NODE_FIELDS.TSEnumBody;
|
|
23771
|
+
validate$4(defs.members, node, "members", members, 1);
|
|
23772
|
+
return node;
|
|
23773
|
+
}
|
|
23774
|
+
function tsEnumDeclaration$1(id, body) {
|
|
23699
23775
|
var node = {
|
|
23700
23776
|
type: "TSEnumDeclaration",
|
|
23701
23777
|
id: id,
|
|
23702
|
-
|
|
23778
|
+
body: body
|
|
23703
23779
|
};
|
|
23704
23780
|
var defs = NODE_FIELDS.TSEnumDeclaration;
|
|
23705
23781
|
validate$4(defs.id, node, "id", id, 1);
|
|
23706
|
-
validate$4(defs.
|
|
23782
|
+
validate$4(defs.body, node, "body", body, 1);
|
|
23707
23783
|
return node;
|
|
23708
23784
|
}
|
|
23709
23785
|
function tsEnumMember$1(id) {
|
|
@@ -23740,17 +23816,17 @@ function tsModuleBlock(body) {
|
|
|
23740
23816
|
return node;
|
|
23741
23817
|
}
|
|
23742
23818
|
function tsImportType$1(argument) {
|
|
23743
|
-
var qualifier = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null,
|
|
23819
|
+
var qualifier = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null, typeArguments = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
23744
23820
|
var node = {
|
|
23745
23821
|
type: "TSImportType",
|
|
23746
23822
|
argument: argument,
|
|
23747
23823
|
qualifier: qualifier,
|
|
23748
|
-
|
|
23824
|
+
typeArguments: typeArguments
|
|
23749
23825
|
};
|
|
23750
23826
|
var defs = NODE_FIELDS.TSImportType;
|
|
23751
23827
|
validate$4(defs.argument, node, "argument", argument, 1);
|
|
23752
23828
|
validate$4(defs.qualifier, node, "qualifier", qualifier, 1);
|
|
23753
|
-
validate$4(defs.
|
|
23829
|
+
validate$4(defs.typeArguments, node, "typeArguments", typeArguments, 1);
|
|
23754
23830
|
return node;
|
|
23755
23831
|
}
|
|
23756
23832
|
function tsImportEqualsDeclaration(id, moduleReference) {
|
|
@@ -24623,6 +24699,9 @@ function assertTSSatisfiesExpression(node, opts) {
|
|
|
24623
24699
|
function assertTSTypeAssertion(node, opts) {
|
|
24624
24700
|
assert("TSTypeAssertion", node, opts);
|
|
24625
24701
|
}
|
|
24702
|
+
function assertTSEnumBody(node, opts) {
|
|
24703
|
+
assert("TSEnumBody", node, opts);
|
|
24704
|
+
}
|
|
24626
24705
|
function assertTSEnumDeclaration(node, opts) {
|
|
24627
24706
|
assert("TSEnumDeclaration", node, opts);
|
|
24628
24707
|
}
|
|
@@ -26762,6 +26841,71 @@ function ParseErrorEnum(argument, syntaxPlugin) {
|
|
|
26762
26841
|
return ParseErrorConstructors;
|
|
26763
26842
|
}
|
|
26764
26843
|
var Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(StandardErrors), ParseErrorEnum(StrictModeErrors), ParseErrorEnum(_templateObject())(PipelineOperatorErrors));
|
|
26844
|
+
function createDefaultOptions() {
|
|
26845
|
+
return {
|
|
26846
|
+
sourceType: "script",
|
|
26847
|
+
sourceFilename: undefined,
|
|
26848
|
+
startIndex: 0,
|
|
26849
|
+
startColumn: 0,
|
|
26850
|
+
startLine: 1,
|
|
26851
|
+
allowAwaitOutsideFunction: false,
|
|
26852
|
+
allowReturnOutsideFunction: false,
|
|
26853
|
+
allowNewTargetOutsideFunction: false,
|
|
26854
|
+
allowImportExportEverywhere: false,
|
|
26855
|
+
allowSuperOutsideMethod: false,
|
|
26856
|
+
allowUndeclaredExports: false,
|
|
26857
|
+
plugins: [],
|
|
26858
|
+
strictMode: null,
|
|
26859
|
+
ranges: false,
|
|
26860
|
+
tokens: false,
|
|
26861
|
+
createImportExpressions: true,
|
|
26862
|
+
createParenthesizedExpressions: false,
|
|
26863
|
+
errorRecovery: false,
|
|
26864
|
+
attachComment: true,
|
|
26865
|
+
annexB: true
|
|
26866
|
+
};
|
|
26867
|
+
}
|
|
26868
|
+
function getOptions(opts) {
|
|
26869
|
+
var options = createDefaultOptions();
|
|
26870
|
+
if (opts == null) {
|
|
26871
|
+
return options;
|
|
26872
|
+
}
|
|
26873
|
+
if (opts.annexB != null && opts.annexB !== false) {
|
|
26874
|
+
throw new Error("The `annexB` option can only be set to `false`.");
|
|
26875
|
+
}
|
|
26876
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
26877
|
+
try {
|
|
26878
|
+
for(var _iterator = Object.keys(options)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
26879
|
+
var key = _step.value;
|
|
26880
|
+
if (opts[key] != null) options[key] = opts[key];
|
|
26881
|
+
}
|
|
26882
|
+
} catch (err) {
|
|
26883
|
+
_didIteratorError = true;
|
|
26884
|
+
_iteratorError = err;
|
|
26885
|
+
} finally{
|
|
26886
|
+
try {
|
|
26887
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
26888
|
+
_iterator.return();
|
|
26889
|
+
}
|
|
26890
|
+
} finally{
|
|
26891
|
+
if (_didIteratorError) {
|
|
26892
|
+
throw _iteratorError;
|
|
26893
|
+
}
|
|
26894
|
+
}
|
|
26895
|
+
}
|
|
26896
|
+
if (options.startLine === 1) {
|
|
26897
|
+
if (opts.startIndex == null && options.startColumn > 0) {
|
|
26898
|
+
options.startIndex = options.startColumn;
|
|
26899
|
+
} else if (opts.startColumn == null && options.startIndex > 0) {
|
|
26900
|
+
options.startColumn = options.startIndex;
|
|
26901
|
+
}
|
|
26902
|
+
} else if (opts.startColumn == null || opts.startIndex == null) {
|
|
26903
|
+
{
|
|
26904
|
+
throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");
|
|
26905
|
+
}
|
|
26906
|
+
}
|
|
26907
|
+
return options;
|
|
26908
|
+
}
|
|
26765
26909
|
var defineProperty = Object.defineProperty;
|
|
26766
26910
|
var toUnenumerable = function(object, key) {
|
|
26767
26911
|
if (object) {
|
|
@@ -26788,7 +26932,7 @@ var estree = function(superClass) {
|
|
|
26788
26932
|
key: "parse",
|
|
26789
26933
|
value: function parse() {
|
|
26790
26934
|
var file2 = toESTreeLocation(_get(_get_prototype_of(ESTreeParserMixin.prototype), "parse", this).call(this));
|
|
26791
|
-
if (this.
|
|
26935
|
+
if (this.optionFlags & 128) {
|
|
26792
26936
|
file2.tokens = file2.tokens.map(toESTreeLocation);
|
|
26793
26937
|
}
|
|
26794
26938
|
return file2;
|
|
@@ -26921,21 +27065,6 @@ var estree = function(superClass) {
|
|
|
26921
27065
|
delete node.directives;
|
|
26922
27066
|
}
|
|
26923
27067
|
},
|
|
26924
|
-
{
|
|
26925
|
-
key: "pushClassMethod",
|
|
26926
|
-
value: function pushClassMethod(classBody2, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
|
|
26927
|
-
this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true);
|
|
26928
|
-
var typeParameters = method.typeParameters;
|
|
26929
|
-
if (typeParameters) {
|
|
26930
|
-
delete method.typeParameters;
|
|
26931
|
-
var fn = method.value;
|
|
26932
|
-
fn.typeParameters = typeParameters;
|
|
26933
|
-
fn.start = typeParameters.start;
|
|
26934
|
-
fn.loc.start = typeParameters.loc.start;
|
|
26935
|
-
}
|
|
26936
|
-
classBody2.body.push(method);
|
|
26937
|
-
}
|
|
26938
|
-
},
|
|
26939
27068
|
{
|
|
26940
27069
|
key: "parsePrivateName",
|
|
26941
27070
|
value: function parsePrivateName() {
|
|
@@ -26993,9 +27122,22 @@ var estree = function(superClass) {
|
|
|
26993
27122
|
funcNode.type = "FunctionExpression";
|
|
26994
27123
|
delete funcNode.kind;
|
|
26995
27124
|
node.value = funcNode;
|
|
27125
|
+
var typeParameters = node.typeParameters;
|
|
27126
|
+
if (typeParameters) {
|
|
27127
|
+
delete node.typeParameters;
|
|
27128
|
+
funcNode.typeParameters = typeParameters;
|
|
27129
|
+
funcNode.start = typeParameters.start;
|
|
27130
|
+
funcNode.loc.start = typeParameters.loc.start;
|
|
27131
|
+
}
|
|
26996
27132
|
if (type === "ClassPrivateMethod") {
|
|
26997
27133
|
node.computed = false;
|
|
26998
27134
|
}
|
|
27135
|
+
if (node.abstract && this.hasPlugin("typescript")) {
|
|
27136
|
+
if (!funcNode.body) {
|
|
27137
|
+
funcNode.type = "TSEmptyBodyFunctionExpression";
|
|
27138
|
+
}
|
|
27139
|
+
return this.finishNode(node, "TSAbstractMethodDefinition");
|
|
27140
|
+
}
|
|
26999
27141
|
return this.finishNode(node, "MethodDefinition");
|
|
27000
27142
|
}
|
|
27001
27143
|
},
|
|
@@ -27016,7 +27158,11 @@ var estree = function(superClass) {
|
|
|
27016
27158
|
var propertyNode = (_$_get = _get(_get_prototype_of(ESTreeParserMixin.prototype), "parseClassProperty", this)).call.apply(_$_get, [
|
|
27017
27159
|
this
|
|
27018
27160
|
].concat(_to_consumable_array(args)));
|
|
27019
|
-
propertyNode.
|
|
27161
|
+
if (propertyNode.abstract && this.hasPlugin("typescript")) {
|
|
27162
|
+
propertyNode.type = "TSAbstractPropertyDefinition";
|
|
27163
|
+
} else {
|
|
27164
|
+
propertyNode.type = "PropertyDefinition";
|
|
27165
|
+
}
|
|
27020
27166
|
return propertyNode;
|
|
27021
27167
|
}
|
|
27022
27168
|
},
|
|
@@ -27030,7 +27176,11 @@ var estree = function(superClass) {
|
|
|
27030
27176
|
var propertyNode = (_$_get = _get(_get_prototype_of(ESTreeParserMixin.prototype), "parseClassPrivateProperty", this)).call.apply(_$_get, [
|
|
27031
27177
|
this
|
|
27032
27178
|
].concat(_to_consumable_array(args)));
|
|
27033
|
-
propertyNode.
|
|
27179
|
+
if (propertyNode.abstract && this.hasPlugin("typescript")) {
|
|
27180
|
+
propertyNode.type = "TSAbstractPropertyDefinition";
|
|
27181
|
+
} else {
|
|
27182
|
+
propertyNode.type = "PropertyDefinition";
|
|
27183
|
+
}
|
|
27034
27184
|
propertyNode.computed = false;
|
|
27035
27185
|
return propertyNode;
|
|
27036
27186
|
}
|
|
@@ -29328,6 +29478,14 @@ var CommentsParser = /*#__PURE__*/ function(BaseParser) {
|
|
|
29328
29478
|
case "ImportDeclaration":
|
|
29329
29479
|
adjustInnerComments(node, node.specifiers, commentWS);
|
|
29330
29480
|
break;
|
|
29481
|
+
case "TSEnumDeclaration":
|
|
29482
|
+
{
|
|
29483
|
+
setInnerComments(node, comments);
|
|
29484
|
+
}
|
|
29485
|
+
break;
|
|
29486
|
+
case "TSEnumBody":
|
|
29487
|
+
adjustInnerComments(node, node.members, commentWS);
|
|
29488
|
+
break;
|
|
29331
29489
|
default:
|
|
29332
29490
|
{
|
|
29333
29491
|
setInnerComments(node, comments);
|
|
@@ -29991,7 +30149,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
29991
30149
|
__publicField(_this, "tokens", []);
|
|
29992
30150
|
__publicField(_this, "errorHandlers_readInt", {
|
|
29993
30151
|
invalidDigit: function(pos, lineStart, curLine, radix) {
|
|
29994
|
-
if (!_this.
|
|
30152
|
+
if (!(_this.optionFlags & 1024)) return false;
|
|
29995
30153
|
_this.raise(Errors.InvalidDigit, buildPosition(pos, lineStart, curLine), {
|
|
29996
30154
|
radix: radix
|
|
29997
30155
|
});
|
|
@@ -30039,7 +30197,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
30039
30197
|
key: "next",
|
|
30040
30198
|
value: function next() {
|
|
30041
30199
|
this.checkKeywordEscapes();
|
|
30042
|
-
if (this.
|
|
30200
|
+
if (this.optionFlags & 128) {
|
|
30043
30201
|
this.pushToken(new Token(this.state));
|
|
30044
30202
|
}
|
|
30045
30203
|
this.state.lastTokEndLoc = this.state.endLoc;
|
|
@@ -30206,7 +30364,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
30206
30364
|
end: this.sourceToOffsetPos(end + commentEnd.length),
|
|
30207
30365
|
loc: new SourceLocation(startLoc, this.state.curPosition())
|
|
30208
30366
|
};
|
|
30209
|
-
if (this.
|
|
30367
|
+
if (this.optionFlags & 128) this.pushToken(comment);
|
|
30210
30368
|
return comment;
|
|
30211
30369
|
}
|
|
30212
30370
|
},
|
|
@@ -30232,7 +30390,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
30232
30390
|
end: this.sourceToOffsetPos(end),
|
|
30233
30391
|
loc: new SourceLocation(startLoc, this.state.curPosition())
|
|
30234
30392
|
};
|
|
30235
|
-
if (this.
|
|
30393
|
+
if (this.optionFlags & 128) this.pushToken(comment);
|
|
30236
30394
|
return comment;
|
|
30237
30395
|
}
|
|
30238
30396
|
},
|
|
@@ -30240,7 +30398,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
30240
30398
|
key: "skipSpace",
|
|
30241
30399
|
value: function skipSpace() {
|
|
30242
30400
|
var spaceStart = this.state.pos;
|
|
30243
|
-
var comments = [];
|
|
30401
|
+
var comments = this.optionFlags & 2048 ? [] : null;
|
|
30244
30402
|
loop: while(this.state.pos < this.length){
|
|
30245
30403
|
var ch = this.input.charCodeAt(this.state.pos);
|
|
30246
30404
|
switch(ch){
|
|
@@ -30267,7 +30425,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
30267
30425
|
var comment = this.skipBlockComment("*/");
|
|
30268
30426
|
if (comment !== undefined) {
|
|
30269
30427
|
this.addComment(comment);
|
|
30270
|
-
|
|
30428
|
+
comments === null || comments === undefined ? undefined : comments.push(comment);
|
|
30271
30429
|
}
|
|
30272
30430
|
break;
|
|
30273
30431
|
}
|
|
@@ -30276,7 +30434,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
30276
30434
|
var comment1 = this.skipLineComment(2);
|
|
30277
30435
|
if (comment1 !== undefined) {
|
|
30278
30436
|
this.addComment(comment1);
|
|
30279
|
-
|
|
30437
|
+
comments === null || comments === undefined ? undefined : comments.push(comment1);
|
|
30280
30438
|
}
|
|
30281
30439
|
break;
|
|
30282
30440
|
}
|
|
@@ -30287,24 +30445,24 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
30287
30445
|
default:
|
|
30288
30446
|
if (isWhitespace(ch)) {
|
|
30289
30447
|
++this.state.pos;
|
|
30290
|
-
} else if (ch === 45 && !this.inModule && this.
|
|
30448
|
+
} else if (ch === 45 && !this.inModule && this.optionFlags & 4096) {
|
|
30291
30449
|
var pos = this.state.pos;
|
|
30292
30450
|
if (this.input.charCodeAt(pos + 1) === 45 && this.input.charCodeAt(pos + 2) === 62 && (spaceStart === 0 || this.state.lineStart > spaceStart)) {
|
|
30293
30451
|
var comment2 = this.skipLineComment(3);
|
|
30294
30452
|
if (comment2 !== undefined) {
|
|
30295
30453
|
this.addComment(comment2);
|
|
30296
|
-
|
|
30454
|
+
comments === null || comments === undefined ? undefined : comments.push(comment2);
|
|
30297
30455
|
}
|
|
30298
30456
|
} else {
|
|
30299
30457
|
break loop;
|
|
30300
30458
|
}
|
|
30301
|
-
} else if (ch === 60 && !this.inModule && this.
|
|
30459
|
+
} else if (ch === 60 && !this.inModule && this.optionFlags & 4096) {
|
|
30302
30460
|
var pos1 = this.state.pos;
|
|
30303
30461
|
if (this.input.charCodeAt(pos1 + 1) === 33 && this.input.charCodeAt(pos1 + 2) === 45 && this.input.charCodeAt(pos1 + 3) === 45) {
|
|
30304
30462
|
var comment3 = this.skipLineComment(4);
|
|
30305
30463
|
if (comment3 !== undefined) {
|
|
30306
30464
|
this.addComment(comment3);
|
|
30307
|
-
|
|
30465
|
+
comments === null || comments === undefined ? undefined : comments.push(comment3);
|
|
30308
30466
|
}
|
|
30309
30467
|
} else {
|
|
30310
30468
|
break loop;
|
|
@@ -30314,7 +30472,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
30314
30472
|
}
|
|
30315
30473
|
}
|
|
30316
30474
|
}
|
|
30317
|
-
if (comments.length > 0) {
|
|
30475
|
+
if ((comments === null || comments === undefined ? undefined : comments.length) > 0) {
|
|
30318
30476
|
var end = this.state.pos;
|
|
30319
30477
|
var commentWhitespace = {
|
|
30320
30478
|
start: this.sourceToOffsetPos(spaceStart),
|
|
@@ -31039,7 +31197,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
31039
31197
|
var details = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
31040
31198
|
var loc = _instanceof(at, Position) ? at : at.loc.start;
|
|
31041
31199
|
var error = toParseError(loc, details);
|
|
31042
|
-
if (!this.
|
|
31200
|
+
if (!(this.optionFlags & 1024)) throw error;
|
|
31043
31201
|
if (!this.isLookahead) this.state.errors.push(error);
|
|
31044
31202
|
return error;
|
|
31045
31203
|
}
|
|
@@ -31747,7 +31905,7 @@ var Node$1 = function Node(parser, pos, loc) {
|
|
|
31747
31905
|
this.start = pos;
|
|
31748
31906
|
this.end = 0;
|
|
31749
31907
|
this.loc = new SourceLocation(loc);
|
|
31750
|
-
if (parser === null || parser === undefined ? undefined : parser.
|
|
31908
|
+
if ((parser === null || parser === undefined ? undefined : parser.optionFlags) & 64) this.range = [
|
|
31751
31909
|
pos,
|
|
31752
31910
|
0
|
|
31753
31911
|
];
|
|
@@ -31829,8 +31987,10 @@ var NodeUtils = /*#__PURE__*/ function(UtilParser) {
|
|
|
31829
31987
|
node.type = type;
|
|
31830
31988
|
node.end = endLoc.index;
|
|
31831
31989
|
node.loc.end = endLoc;
|
|
31832
|
-
if (this.
|
|
31833
|
-
if (this.
|
|
31990
|
+
if (this.optionFlags & 64) node.range[1] = endLoc.index;
|
|
31991
|
+
if (this.optionFlags & 2048) {
|
|
31992
|
+
this.processComment(node);
|
|
31993
|
+
}
|
|
31834
31994
|
return node;
|
|
31835
31995
|
}
|
|
31836
31996
|
},
|
|
@@ -31839,7 +31999,7 @@ var NodeUtils = /*#__PURE__*/ function(UtilParser) {
|
|
|
31839
31999
|
value: function resetStartLocation(node, startLoc) {
|
|
31840
32000
|
node.start = startLoc.index;
|
|
31841
32001
|
node.loc.start = startLoc;
|
|
31842
|
-
if (this.
|
|
32002
|
+
if (this.optionFlags & 64) node.range[0] = startLoc.index;
|
|
31843
32003
|
}
|
|
31844
32004
|
},
|
|
31845
32005
|
{
|
|
@@ -31848,7 +32008,7 @@ var NodeUtils = /*#__PURE__*/ function(UtilParser) {
|
|
|
31848
32008
|
var endLoc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.state.lastTokEndLoc;
|
|
31849
32009
|
node.end = endLoc.index;
|
|
31850
32010
|
node.loc.end = endLoc;
|
|
31851
|
-
if (this.
|
|
32011
|
+
if (this.optionFlags & 64) node.range[1] = endLoc.index;
|
|
31852
32012
|
}
|
|
31853
32013
|
},
|
|
31854
32014
|
{
|
|
@@ -32477,31 +32637,63 @@ var flow$1 = function(superClass) {
|
|
|
32477
32637
|
return this.finishNode(node, "TypeParameterDeclaration");
|
|
32478
32638
|
}
|
|
32479
32639
|
},
|
|
32640
|
+
{
|
|
32641
|
+
key: "flowInTopLevelContext",
|
|
32642
|
+
value: function flowInTopLevelContext(cb) {
|
|
32643
|
+
if (this.curContext() !== types$T.brace) {
|
|
32644
|
+
var oldContext = this.state.context;
|
|
32645
|
+
this.state.context = [
|
|
32646
|
+
oldContext[0]
|
|
32647
|
+
];
|
|
32648
|
+
try {
|
|
32649
|
+
return cb();
|
|
32650
|
+
} finally{
|
|
32651
|
+
this.state.context = oldContext;
|
|
32652
|
+
}
|
|
32653
|
+
} else {
|
|
32654
|
+
return cb();
|
|
32655
|
+
}
|
|
32656
|
+
}
|
|
32657
|
+
},
|
|
32658
|
+
{
|
|
32659
|
+
key: "flowParseTypeParameterInstantiationInExpression",
|
|
32660
|
+
value: function flowParseTypeParameterInstantiationInExpression() {
|
|
32661
|
+
if (this.reScan_lt() !== 47) return;
|
|
32662
|
+
return this.flowParseTypeParameterInstantiation();
|
|
32663
|
+
}
|
|
32664
|
+
},
|
|
32480
32665
|
{
|
|
32481
32666
|
key: "flowParseTypeParameterInstantiation",
|
|
32482
32667
|
value: function flowParseTypeParameterInstantiation() {
|
|
32668
|
+
var _this = this;
|
|
32483
32669
|
var node = this.startNode();
|
|
32484
32670
|
var oldInType = this.state.inType;
|
|
32485
|
-
node.params = [];
|
|
32486
32671
|
this.state.inType = true;
|
|
32487
|
-
|
|
32488
|
-
|
|
32489
|
-
|
|
32490
|
-
|
|
32491
|
-
|
|
32492
|
-
|
|
32493
|
-
|
|
32672
|
+
node.params = [];
|
|
32673
|
+
this.flowInTopLevelContext(function() {
|
|
32674
|
+
_this.expect(47);
|
|
32675
|
+
var oldNoAnonFunctionType = _this.state.noAnonFunctionType;
|
|
32676
|
+
_this.state.noAnonFunctionType = false;
|
|
32677
|
+
while(!_this.match(48)){
|
|
32678
|
+
node.params.push(_this.flowParseType());
|
|
32679
|
+
if (!_this.match(48)) {
|
|
32680
|
+
_this.expect(12);
|
|
32681
|
+
}
|
|
32494
32682
|
}
|
|
32683
|
+
_this.state.noAnonFunctionType = oldNoAnonFunctionType;
|
|
32684
|
+
});
|
|
32685
|
+
this.state.inType = oldInType;
|
|
32686
|
+
if (!this.state.inType && this.curContext() === types$T.brace) {
|
|
32687
|
+
this.reScan_lt_gt();
|
|
32495
32688
|
}
|
|
32496
|
-
this.state.noAnonFunctionType = oldNoAnonFunctionType;
|
|
32497
32689
|
this.expect(48);
|
|
32498
|
-
this.state.inType = oldInType;
|
|
32499
32690
|
return this.finishNode(node, "TypeParameterInstantiation");
|
|
32500
32691
|
}
|
|
32501
32692
|
},
|
|
32502
32693
|
{
|
|
32503
32694
|
key: "flowParseTypeParameterInstantiationCallOrNew",
|
|
32504
32695
|
value: function flowParseTypeParameterInstantiationCallOrNew() {
|
|
32696
|
+
if (this.reScan_lt() !== 47) return;
|
|
32505
32697
|
var node = this.startNode();
|
|
32506
32698
|
var oldInType = this.state.inType;
|
|
32507
32699
|
node.params = [];
|
|
@@ -33764,9 +33956,9 @@ var flow$1 = function(superClass) {
|
|
|
33764
33956
|
key: "parseClassSuper",
|
|
33765
33957
|
value: function parseClassSuper(node) {
|
|
33766
33958
|
_get(_get_prototype_of(FlowParserMixin.prototype), "parseClassSuper", this).call(this, node);
|
|
33767
|
-
if (node.superClass && this.match(47)) {
|
|
33959
|
+
if (node.superClass && (this.match(47) || this.match(51))) {
|
|
33768
33960
|
{
|
|
33769
|
-
node.superTypeArguments = this.
|
|
33961
|
+
node.superTypeArguments = this.flowParseTypeParameterInstantiationInExpression();
|
|
33770
33962
|
}
|
|
33771
33963
|
}
|
|
33772
33964
|
if (this.isContextual(113)) {
|
|
@@ -34175,12 +34367,12 @@ var flow$1 = function(superClass) {
|
|
|
34175
34367
|
this.next();
|
|
34176
34368
|
var node = this.startNodeAt(startLoc);
|
|
34177
34369
|
node.callee = base;
|
|
34178
|
-
node.typeArguments = this.
|
|
34370
|
+
node.typeArguments = this.flowParseTypeParameterInstantiationInExpression();
|
|
34179
34371
|
this.expect(10);
|
|
34180
34372
|
node.arguments = this.parseCallExpressionArguments(11);
|
|
34181
34373
|
node.optional = true;
|
|
34182
34374
|
return this.finishCallExpression(node, true);
|
|
34183
|
-
} else if (!noCalls && this.shouldParseTypes() && this.match(47)) {
|
|
34375
|
+
} else if (!noCalls && this.shouldParseTypes() && (this.match(47) || this.match(51))) {
|
|
34184
34376
|
var node1 = this.startNodeAt(startLoc);
|
|
34185
34377
|
node1.callee = base;
|
|
34186
34378
|
var result = this.tryParse(function() {
|
|
@@ -34730,6 +34922,17 @@ var flow$1 = function(superClass) {
|
|
|
34730
34922
|
return this.finishNode(node, "EnumDeclaration");
|
|
34731
34923
|
}
|
|
34732
34924
|
},
|
|
34925
|
+
{
|
|
34926
|
+
key: "jsxParseOpeningElementAfterName",
|
|
34927
|
+
value: function jsxParseOpeningElementAfterName(node) {
|
|
34928
|
+
if (this.shouldParseTypes()) {
|
|
34929
|
+
if (this.match(47) || this.match(51)) {
|
|
34930
|
+
node.typeArguments = this.flowParseTypeParameterInstantiationInExpression();
|
|
34931
|
+
}
|
|
34932
|
+
}
|
|
34933
|
+
return _get(_get_prototype_of(FlowParserMixin.prototype), "jsxParseOpeningElementAfterName", this).call(this, node);
|
|
34934
|
+
}
|
|
34935
|
+
},
|
|
34733
34936
|
{
|
|
34734
34937
|
key: "isLookaheadToken_lt",
|
|
34735
34938
|
value: function isLookaheadToken_lt() {
|
|
@@ -34741,6 +34944,31 @@ var flow$1 = function(superClass) {
|
|
|
34741
34944
|
return false;
|
|
34742
34945
|
}
|
|
34743
34946
|
},
|
|
34947
|
+
{
|
|
34948
|
+
key: "reScan_lt_gt",
|
|
34949
|
+
value: function reScan_lt_gt() {
|
|
34950
|
+
var type = this.state.type;
|
|
34951
|
+
if (type === 47) {
|
|
34952
|
+
this.state.pos -= 1;
|
|
34953
|
+
this.readToken_lt();
|
|
34954
|
+
} else if (type === 48) {
|
|
34955
|
+
this.state.pos -= 1;
|
|
34956
|
+
this.readToken_gt();
|
|
34957
|
+
}
|
|
34958
|
+
}
|
|
34959
|
+
},
|
|
34960
|
+
{
|
|
34961
|
+
key: "reScan_lt",
|
|
34962
|
+
value: function reScan_lt() {
|
|
34963
|
+
var type = this.state.type;
|
|
34964
|
+
if (type === 51) {
|
|
34965
|
+
this.state.pos -= 2;
|
|
34966
|
+
this.finishOp(47, 1);
|
|
34967
|
+
return 47;
|
|
34968
|
+
}
|
|
34969
|
+
return type;
|
|
34970
|
+
}
|
|
34971
|
+
},
|
|
34744
34972
|
{
|
|
34745
34973
|
key: "maybeUnwrapTypeCastExpression",
|
|
34746
34974
|
value: function maybeUnwrapTypeCastExpression(node) {
|
|
@@ -36574,8 +36802,14 @@ var typescript$3 = function(superClass) {
|
|
|
36574
36802
|
this.expect(10);
|
|
36575
36803
|
if (!this.match(134)) {
|
|
36576
36804
|
this.raise(TSErrors.UnsupportedImportTypeArgument, this.state.startLoc);
|
|
36805
|
+
{
|
|
36806
|
+
node.argument = this.tsParseNonConditionalType();
|
|
36807
|
+
}
|
|
36808
|
+
} else {
|
|
36809
|
+
{
|
|
36810
|
+
node.argument = this.tsParseLiteralTypeNode();
|
|
36811
|
+
}
|
|
36577
36812
|
}
|
|
36578
|
-
node.argument = _get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseExprAtom", this).call(this);
|
|
36579
36813
|
if (this.eat(12) && !this.match(11)) {
|
|
36580
36814
|
node.options = _get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseMaybeAssignAllowIn", this).call(this);
|
|
36581
36815
|
this.eat(12);
|
|
@@ -36587,7 +36821,9 @@ var typescript$3 = function(superClass) {
|
|
|
36587
36821
|
node.qualifier = this.tsParseEntityName();
|
|
36588
36822
|
}
|
|
36589
36823
|
if (this.match(47)) {
|
|
36590
|
-
|
|
36824
|
+
{
|
|
36825
|
+
node.typeArguments = this.tsParseTypeArguments();
|
|
36826
|
+
}
|
|
36591
36827
|
}
|
|
36592
36828
|
return this.finishNode(node, "TSImportType");
|
|
36593
36829
|
}
|
|
@@ -36649,7 +36885,9 @@ var typescript$3 = function(superClass) {
|
|
|
36649
36885
|
node.exprName = this.tsParseEntityName();
|
|
36650
36886
|
}
|
|
36651
36887
|
if (!this.hasPrecedingLineBreak() && this.match(47)) {
|
|
36652
|
-
|
|
36888
|
+
{
|
|
36889
|
+
node.typeArguments = this.tsParseTypeArguments();
|
|
36890
|
+
}
|
|
36653
36891
|
}
|
|
36654
36892
|
return this.finishNode(node, "TSTypeQuery");
|
|
36655
36893
|
}
|
|
@@ -37149,7 +37387,7 @@ var typescript$3 = function(superClass) {
|
|
|
37149
37387
|
return this.tsParseTupleType();
|
|
37150
37388
|
case 10:
|
|
37151
37389
|
{
|
|
37152
|
-
if (!this.
|
|
37390
|
+
if (!(this.optionFlags & 512)) {
|
|
37153
37391
|
var startLoc = this.state.startLoc;
|
|
37154
37392
|
this.next();
|
|
37155
37393
|
var type = this.tsParseType();
|
|
@@ -37531,10 +37769,12 @@ var typescript$3 = function(superClass) {
|
|
|
37531
37769
|
var delimitedList = this.tsParseDelimitedList("HeritageClauseElement", function() {
|
|
37532
37770
|
var node = _this.startNode();
|
|
37533
37771
|
node.expression = _this.tsParseEntityName();
|
|
37534
|
-
|
|
37535
|
-
|
|
37772
|
+
{
|
|
37773
|
+
if (_this.match(47)) {
|
|
37774
|
+
node.typeArguments = _this.tsParseTypeArguments();
|
|
37775
|
+
}
|
|
37776
|
+
return _this.finishNode(node, token === "extends" ? "TSInterfaceHeritage" : "TSClassImplements");
|
|
37536
37777
|
}
|
|
37537
|
-
return _this.finishNode(node, token === "extends" ? "TSInterfaceHeritage" : "TSClassImplements");
|
|
37538
37778
|
});
|
|
37539
37779
|
if (!delimitedList.length) {
|
|
37540
37780
|
this.raise(TSErrors.EmptyHeritageClauseType, originalStartLoc, {
|
|
@@ -37589,16 +37829,20 @@ var typescript$3 = function(superClass) {
|
|
|
37589
37829
|
}
|
|
37590
37830
|
},
|
|
37591
37831
|
{
|
|
37592
|
-
key: "
|
|
37593
|
-
value: function
|
|
37594
|
-
|
|
37595
|
-
|
|
37596
|
-
|
|
37597
|
-
|
|
37598
|
-
|
|
37832
|
+
key: "tsInTopLevelContext",
|
|
37833
|
+
value: function tsInTopLevelContext(cb) {
|
|
37834
|
+
if (this.curContext() !== types$T.brace) {
|
|
37835
|
+
var oldContext = this.state.context;
|
|
37836
|
+
this.state.context = [
|
|
37837
|
+
oldContext[0]
|
|
37838
|
+
];
|
|
37839
|
+
try {
|
|
37840
|
+
return cb();
|
|
37841
|
+
} finally{
|
|
37842
|
+
this.state.context = oldContext;
|
|
37843
|
+
}
|
|
37844
|
+
} else {
|
|
37599
37845
|
return cb();
|
|
37600
|
-
} finally{
|
|
37601
|
-
this.state.context = oldContext;
|
|
37602
37846
|
}
|
|
37603
37847
|
}
|
|
37604
37848
|
},
|
|
@@ -37686,10 +37930,20 @@ var typescript$3 = function(superClass) {
|
|
|
37686
37930
|
this.expectContextual(126);
|
|
37687
37931
|
node.id = this.parseIdentifier();
|
|
37688
37932
|
this.checkIdentifier(node.id, node.const ? 8971 : 8459);
|
|
37933
|
+
{
|
|
37934
|
+
node.body = this.tsParseEnumBody();
|
|
37935
|
+
}
|
|
37936
|
+
return this.finishNode(node, "TSEnumDeclaration");
|
|
37937
|
+
}
|
|
37938
|
+
},
|
|
37939
|
+
{
|
|
37940
|
+
key: "tsParseEnumBody",
|
|
37941
|
+
value: function tsParseEnumBody() {
|
|
37942
|
+
var node = this.startNode();
|
|
37689
37943
|
this.expect(5);
|
|
37690
37944
|
node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this));
|
|
37691
37945
|
this.expect(8);
|
|
37692
|
-
return this.finishNode(node, "
|
|
37946
|
+
return this.finishNode(node, "TSEnumBody");
|
|
37693
37947
|
}
|
|
37694
37948
|
},
|
|
37695
37949
|
{
|
|
@@ -37984,7 +38238,7 @@ var typescript$3 = function(superClass) {
|
|
|
37984
38238
|
var _this = this;
|
|
37985
38239
|
var node = this.startNode();
|
|
37986
38240
|
node.params = this.tsInType(function() {
|
|
37987
|
-
return _this.
|
|
38241
|
+
return _this.tsInTopLevelContext(function() {
|
|
37988
38242
|
_this.expect(47);
|
|
37989
38243
|
return _this.tsParseDelimitedList("TypeParametersOrArguments", _this.tsParseType.bind(_this));
|
|
37990
38244
|
});
|
|
@@ -38192,7 +38446,9 @@ var typescript$3 = function(superClass) {
|
|
|
38192
38446
|
}
|
|
38193
38447
|
if (tokenIsTemplate(_this.state.type)) {
|
|
38194
38448
|
var result2 = _get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseTaggedTemplateExpression", _this).call(_this, base, startLoc, state);
|
|
38195
|
-
|
|
38449
|
+
{
|
|
38450
|
+
result2.typeArguments = typeArguments;
|
|
38451
|
+
}
|
|
38196
38452
|
return result2;
|
|
38197
38453
|
}
|
|
38198
38454
|
if (!noCalls && _this.eat(10)) {
|
|
@@ -38200,7 +38456,9 @@ var typescript$3 = function(superClass) {
|
|
|
38200
38456
|
node2.callee = base;
|
|
38201
38457
|
node2.arguments = _this.parseCallExpressionArguments(11);
|
|
38202
38458
|
_this.tsCheckForInvalidTypeCasts(node2.arguments);
|
|
38203
|
-
|
|
38459
|
+
{
|
|
38460
|
+
node2.typeArguments = typeArguments;
|
|
38461
|
+
}
|
|
38204
38462
|
if (state.optionalChainMember) {
|
|
38205
38463
|
node2.optional = isOptionalCall;
|
|
38206
38464
|
}
|
|
@@ -38212,7 +38470,9 @@ var typescript$3 = function(superClass) {
|
|
|
38212
38470
|
}
|
|
38213
38471
|
var node = _this.startNodeAt(startLoc);
|
|
38214
38472
|
node.expression = base;
|
|
38215
|
-
|
|
38473
|
+
{
|
|
38474
|
+
node.typeArguments = typeArguments;
|
|
38475
|
+
}
|
|
38216
38476
|
return _this.finishNode(node, "TSInstantiationExpression");
|
|
38217
38477
|
});
|
|
38218
38478
|
if (missingParenErrorLoc) {
|
|
@@ -38235,7 +38495,9 @@ var typescript$3 = function(superClass) {
|
|
|
38235
38495
|
_get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseNewCallee", this).call(this, node);
|
|
38236
38496
|
var callee = node.callee;
|
|
38237
38497
|
if (callee.type === "TSInstantiationExpression" && !((_callee_extra = callee.extra) === null || _callee_extra === undefined ? undefined : _callee_extra.parenthesized)) {
|
|
38238
|
-
|
|
38498
|
+
{
|
|
38499
|
+
node.typeArguments = callee.typeArguments;
|
|
38500
|
+
}
|
|
38239
38501
|
node.callee = callee.expression;
|
|
38240
38502
|
}
|
|
38241
38503
|
}
|
|
@@ -39021,17 +39283,19 @@ var typescript$3 = function(superClass) {
|
|
|
39021
39283
|
},
|
|
39022
39284
|
{
|
|
39023
39285
|
key: "parseMaybeDecoratorArguments",
|
|
39024
|
-
value: function parseMaybeDecoratorArguments(expr) {
|
|
39286
|
+
value: function parseMaybeDecoratorArguments(expr, startLoc) {
|
|
39025
39287
|
if (this.match(47) || this.match(51)) {
|
|
39026
39288
|
var typeArguments = this.tsParseTypeArgumentsInExpression();
|
|
39027
39289
|
if (this.match(10)) {
|
|
39028
|
-
var call2 = _get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseMaybeDecoratorArguments", this).call(this, expr);
|
|
39029
|
-
|
|
39290
|
+
var call2 = _get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseMaybeDecoratorArguments", this).call(this, expr, startLoc);
|
|
39291
|
+
{
|
|
39292
|
+
call2.typeArguments = typeArguments;
|
|
39293
|
+
}
|
|
39030
39294
|
return call2;
|
|
39031
39295
|
}
|
|
39032
39296
|
this.unexpected(null, 10);
|
|
39033
39297
|
}
|
|
39034
|
-
return _get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseMaybeDecoratorArguments", this).call(this, expr);
|
|
39298
|
+
return _get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseMaybeDecoratorArguments", this).call(this, expr, startLoc);
|
|
39035
39299
|
}
|
|
39036
39300
|
},
|
|
39037
39301
|
{
|
|
@@ -39159,7 +39423,11 @@ var typescript$3 = function(superClass) {
|
|
|
39159
39423
|
var typeArguments = this.tsTryParseAndCatch(function() {
|
|
39160
39424
|
return _this.tsParseTypeArgumentsInExpression();
|
|
39161
39425
|
});
|
|
39162
|
-
if (typeArguments)
|
|
39426
|
+
if (typeArguments) {
|
|
39427
|
+
{
|
|
39428
|
+
node.typeArguments = typeArguments;
|
|
39429
|
+
}
|
|
39430
|
+
}
|
|
39163
39431
|
}
|
|
39164
39432
|
return _get(_get_prototype_of(TypeScriptParserMixin.prototype), "jsxParseOpeningElementAfterName", this).call(this, node);
|
|
39165
39433
|
}
|
|
@@ -39234,8 +39502,9 @@ var typescript$3 = function(superClass) {
|
|
|
39234
39502
|
value: function parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope) {
|
|
39235
39503
|
var method = _get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseMethod", this).call(this, node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);
|
|
39236
39504
|
if (method.abstract) {
|
|
39237
|
-
var
|
|
39238
|
-
|
|
39505
|
+
var hasEstreePlugin = this.hasPlugin("estree");
|
|
39506
|
+
var methodFn = hasEstreePlugin ? method.value : method;
|
|
39507
|
+
if (methodFn.body) {
|
|
39239
39508
|
var key = method.key;
|
|
39240
39509
|
this.raise(TSErrors.AbstractMethodHasImplementation, method, {
|
|
39241
39510
|
methodName: key.type === "Identifier" && !method.computed ? key.name : "[".concat(this.input.slice(this.offsetToSourcePos(key.start), this.offsetToSourcePos(key.end)), "]")
|
|
@@ -39846,71 +40115,6 @@ var mixinPlugins = {
|
|
|
39846
40115
|
placeholders: placeholders
|
|
39847
40116
|
};
|
|
39848
40117
|
var mixinPluginNames = Object.keys(mixinPlugins);
|
|
39849
|
-
function createDefaultOptions() {
|
|
39850
|
-
return {
|
|
39851
|
-
sourceType: "script",
|
|
39852
|
-
sourceFilename: undefined,
|
|
39853
|
-
startIndex: 0,
|
|
39854
|
-
startColumn: 0,
|
|
39855
|
-
startLine: 1,
|
|
39856
|
-
allowAwaitOutsideFunction: false,
|
|
39857
|
-
allowReturnOutsideFunction: false,
|
|
39858
|
-
allowNewTargetOutsideFunction: false,
|
|
39859
|
-
allowImportExportEverywhere: false,
|
|
39860
|
-
allowSuperOutsideMethod: false,
|
|
39861
|
-
allowUndeclaredExports: false,
|
|
39862
|
-
plugins: [],
|
|
39863
|
-
strictMode: null,
|
|
39864
|
-
ranges: false,
|
|
39865
|
-
tokens: false,
|
|
39866
|
-
createImportExpressions: true,
|
|
39867
|
-
createParenthesizedExpressions: false,
|
|
39868
|
-
errorRecovery: false,
|
|
39869
|
-
attachComment: true,
|
|
39870
|
-
annexB: true
|
|
39871
|
-
};
|
|
39872
|
-
}
|
|
39873
|
-
function getOptions(opts) {
|
|
39874
|
-
var options = createDefaultOptions();
|
|
39875
|
-
if (opts == null) {
|
|
39876
|
-
return options;
|
|
39877
|
-
}
|
|
39878
|
-
if (opts.annexB != null && opts.annexB !== false) {
|
|
39879
|
-
throw new Error("The `annexB` option can only be set to `false`.");
|
|
39880
|
-
}
|
|
39881
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
39882
|
-
try {
|
|
39883
|
-
for(var _iterator = Object.keys(options)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
39884
|
-
var key = _step.value;
|
|
39885
|
-
if (opts[key] != null) options[key] = opts[key];
|
|
39886
|
-
}
|
|
39887
|
-
} catch (err) {
|
|
39888
|
-
_didIteratorError = true;
|
|
39889
|
-
_iteratorError = err;
|
|
39890
|
-
} finally{
|
|
39891
|
-
try {
|
|
39892
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
39893
|
-
_iterator.return();
|
|
39894
|
-
}
|
|
39895
|
-
} finally{
|
|
39896
|
-
if (_didIteratorError) {
|
|
39897
|
-
throw _iteratorError;
|
|
39898
|
-
}
|
|
39899
|
-
}
|
|
39900
|
-
}
|
|
39901
|
-
if (options.startLine === 1) {
|
|
39902
|
-
if (opts.startIndex == null && options.startColumn > 0) {
|
|
39903
|
-
options.startIndex = options.startColumn;
|
|
39904
|
-
} else if (opts.startColumn == null && options.startIndex > 0) {
|
|
39905
|
-
options.startColumn = options.startIndex;
|
|
39906
|
-
}
|
|
39907
|
-
} else if (opts.startColumn == null || opts.startIndex == null) {
|
|
39908
|
-
{
|
|
39909
|
-
throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");
|
|
39910
|
-
}
|
|
39911
|
-
}
|
|
39912
|
-
return options;
|
|
39913
|
-
}
|
|
39914
40118
|
var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
39915
40119
|
_inherits$1(ExpressionParser, LValParser);
|
|
39916
40120
|
function ExpressionParser() {
|
|
@@ -39962,7 +40166,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
39962
40166
|
this.finalizeRemainingComments();
|
|
39963
40167
|
expr.comments = this.comments;
|
|
39964
40168
|
expr.errors = this.state.errors;
|
|
39965
|
-
if (this.
|
|
40169
|
+
if (this.optionFlags & 128) {
|
|
39966
40170
|
expr.tokens = this.tokens;
|
|
39967
40171
|
}
|
|
39968
40172
|
return expr;
|
|
@@ -40584,7 +40788,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
40584
40788
|
return this.parseImportMetaProperty(node);
|
|
40585
40789
|
}
|
|
40586
40790
|
if (this.match(10)) {
|
|
40587
|
-
if (this.
|
|
40791
|
+
if (this.optionFlags & 256) {
|
|
40588
40792
|
return this.parseImportCall(node);
|
|
40589
40793
|
} else {
|
|
40590
40794
|
return this.finishNode(node, "Import");
|
|
@@ -40853,9 +41057,9 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
40853
41057
|
value: function parseSuper() {
|
|
40854
41058
|
var node = this.startNode();
|
|
40855
41059
|
this.next();
|
|
40856
|
-
if (this.match(10) && !this.scope.allowDirectSuper && !this.
|
|
41060
|
+
if (this.match(10) && !this.scope.allowDirectSuper && !(this.optionFlags & 16)) {
|
|
40857
41061
|
this.raise(Errors.SuperNotAllowed, node);
|
|
40858
|
-
} else if (!this.scope.allowSuper && !this.
|
|
41062
|
+
} else if (!this.scope.allowSuper && !(this.optionFlags & 16)) {
|
|
40859
41063
|
this.raise(Errors.UnexpectedSuper, node);
|
|
40860
41064
|
}
|
|
40861
41065
|
if (!this.match(10) && !this.match(0) && !this.match(16)) {
|
|
@@ -40921,7 +41125,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
40921
41125
|
} else if (this.isContextual(105) || this.isContextual(97)) {
|
|
40922
41126
|
var isSource = this.isContextual(105);
|
|
40923
41127
|
this.expectPlugin(isSource ? "sourcePhaseImports" : "deferredImportEvaluation");
|
|
40924
|
-
if (!this.
|
|
41128
|
+
if (!(this.optionFlags & 256)) {
|
|
40925
41129
|
throw this.raise(Errors.DynamicImportPhaseRequiresImportExpressions, this.state.startLoc, {
|
|
40926
41130
|
phase: this.state.value
|
|
40927
41131
|
});
|
|
@@ -41074,7 +41278,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
41074
41278
|
{
|
|
41075
41279
|
key: "wrapParenthesis",
|
|
41076
41280
|
value: function wrapParenthesis(startLoc, expression2) {
|
|
41077
|
-
if (!this.
|
|
41281
|
+
if (!(this.optionFlags & 512)) {
|
|
41078
41282
|
this.addExtra(expression2, "parenthesized", true);
|
|
41079
41283
|
this.addExtra(expression2, "parenStart", startLoc.index);
|
|
41080
41284
|
this.takeSurroundingComments(expression2, startLoc.index, this.state.lastTokEndLoc.index);
|
|
@@ -41114,7 +41318,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
41114
41318
|
var meta = this.createIdentifier(this.startNodeAtNode(node), "new");
|
|
41115
41319
|
this.next();
|
|
41116
41320
|
var metaProp = this.parseMetaProperty(node, meta, "target");
|
|
41117
|
-
if (!this.scope.inNonArrowFunction && !this.scope.inClass && !this.
|
|
41321
|
+
if (!this.scope.inNonArrowFunction && !this.scope.inClass && !(this.optionFlags & 4)) {
|
|
41118
41322
|
this.raise(Errors.UnexpectedNewTarget, metaProp);
|
|
41119
41323
|
}
|
|
41120
41324
|
return metaProp;
|
|
@@ -41730,7 +41934,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
41730
41934
|
{
|
|
41731
41935
|
key: "recordAwaitIfAllowed",
|
|
41732
41936
|
value: function recordAwaitIfAllowed() {
|
|
41733
|
-
var isAwaitAllowed = this.prodParam.hasAwait || this.
|
|
41937
|
+
var isAwaitAllowed = this.prodParam.hasAwait || this.optionFlags & 1 && !this.scope.inFunction;
|
|
41734
41938
|
if (isAwaitAllowed && !this.scope.inFunction) {
|
|
41735
41939
|
this.state.hasTopLevelAwait = true;
|
|
41736
41940
|
}
|
|
@@ -41745,7 +41949,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
41745
41949
|
if (this.eat(55)) {
|
|
41746
41950
|
this.raise(Errors.ObsoleteAwaitStar, node);
|
|
41747
41951
|
}
|
|
41748
|
-
if (!this.scope.inFunction && !this.
|
|
41952
|
+
if (!this.scope.inFunction && !(this.optionFlags & 1)) {
|
|
41749
41953
|
if (this.isAmbiguousAwait()) {
|
|
41750
41954
|
this.ambiguousScriptDifferentAst = true;
|
|
41751
41955
|
} else {
|
|
@@ -42041,7 +42245,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
42041
42245
|
value: function parseTopLevel(file2, program3) {
|
|
42042
42246
|
file2.program = this.parseProgram(program3);
|
|
42043
42247
|
file2.comments = this.comments;
|
|
42044
|
-
if (this.
|
|
42248
|
+
if (this.optionFlags & 128) {
|
|
42045
42249
|
file2.tokens = babel7CompatTokens(this.tokens, this.input, this.startIndex);
|
|
42046
42250
|
}
|
|
42047
42251
|
return this.finishNode(file2, "File");
|
|
@@ -42055,7 +42259,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
42055
42259
|
program3.interpreter = this.parseInterpreterDirective();
|
|
42056
42260
|
this.parseBlockBody(program3, true, true, end);
|
|
42057
42261
|
if (this.inModule) {
|
|
42058
|
-
if (!this.
|
|
42262
|
+
if (!(this.optionFlags & 32) && this.scope.undefinedExports.size > 0) {
|
|
42059
42263
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
42060
42264
|
try {
|
|
42061
42265
|
for(var _iterator = Array.from(this.scope.undefinedExports)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
@@ -42341,7 +42545,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
42341
42545
|
}
|
|
42342
42546
|
case 82:
|
|
42343
42547
|
{
|
|
42344
|
-
if (!this.
|
|
42548
|
+
if (!(this.optionFlags & 8) && !topLevel) {
|
|
42345
42549
|
this.raise(Errors.UnexpectedImportExport, this.state.startLoc);
|
|
42346
42550
|
}
|
|
42347
42551
|
this.next();
|
|
@@ -42383,7 +42587,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
42383
42587
|
{
|
|
42384
42588
|
key: "assertModuleNodeAllowed",
|
|
42385
42589
|
value: function assertModuleNodeAllowed(node) {
|
|
42386
|
-
if (!this.
|
|
42590
|
+
if (!(this.optionFlags & 8) && !this.inModule) {
|
|
42387
42591
|
this.raise(Errors.ImportOutsideModule, node);
|
|
42388
42592
|
}
|
|
42389
42593
|
}
|
|
@@ -42399,12 +42603,13 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
42399
42603
|
key: "maybeTakeDecorators",
|
|
42400
42604
|
value: function maybeTakeDecorators(maybeDecorators, classNode, exportNode) {
|
|
42401
42605
|
if (maybeDecorators) {
|
|
42402
|
-
|
|
42403
|
-
|
|
42606
|
+
var _classNode_decorators;
|
|
42607
|
+
if ((_classNode_decorators = classNode.decorators) === null || _classNode_decorators === undefined ? undefined : _classNode_decorators.length) {
|
|
42608
|
+
var _classNode_decorators1;
|
|
42404
42609
|
if (typeof this.getPluginOption("decorators", "decoratorsBeforeExport") !== "boolean") {
|
|
42405
42610
|
this.raise(Errors.DecoratorsBeforeAfterExport, classNode.decorators[0]);
|
|
42406
42611
|
}
|
|
42407
|
-
(
|
|
42612
|
+
(_classNode_decorators1 = classNode.decorators).unshift.apply(_classNode_decorators1, _to_consumable_array(maybeDecorators));
|
|
42408
42613
|
} else {
|
|
42409
42614
|
classNode.decorators = maybeDecorators;
|
|
42410
42615
|
}
|
|
@@ -42459,7 +42664,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
42459
42664
|
this.expect(11);
|
|
42460
42665
|
expr = this.wrapParenthesis(startLoc2, expr);
|
|
42461
42666
|
var paramsStartLoc = this.state.startLoc;
|
|
42462
|
-
node.expression = this.parseMaybeDecoratorArguments(expr);
|
|
42667
|
+
node.expression = this.parseMaybeDecoratorArguments(expr, startLoc2);
|
|
42463
42668
|
if (this.getPluginOption("decorators", "allowCallParenthesized") === false && node.expression !== expr) {
|
|
42464
42669
|
this.raise(Errors.DecoratorArgumentsOutsideParentheses, paramsStartLoc);
|
|
42465
42670
|
}
|
|
@@ -42477,7 +42682,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
42477
42682
|
node2.computed = false;
|
|
42478
42683
|
expr = this.finishNode(node2, "MemberExpression");
|
|
42479
42684
|
}
|
|
42480
|
-
node.expression = this.parseMaybeDecoratorArguments(expr);
|
|
42685
|
+
node.expression = this.parseMaybeDecoratorArguments(expr, startLoc);
|
|
42481
42686
|
}
|
|
42482
42687
|
} else {
|
|
42483
42688
|
node.expression = this.parseExprSubscripts();
|
|
@@ -42487,9 +42692,9 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
42487
42692
|
},
|
|
42488
42693
|
{
|
|
42489
42694
|
key: "parseMaybeDecoratorArguments",
|
|
42490
|
-
value: function parseMaybeDecoratorArguments(expr) {
|
|
42695
|
+
value: function parseMaybeDecoratorArguments(expr, startLoc) {
|
|
42491
42696
|
if (this.eat(10)) {
|
|
42492
|
-
var node = this.
|
|
42697
|
+
var node = this.startNodeAt(startLoc);
|
|
42493
42698
|
node.callee = expr;
|
|
42494
42699
|
node.arguments = this.parseCallExpressionArguments(11);
|
|
42495
42700
|
this.toReferencedList(node.arguments);
|
|
@@ -42666,7 +42871,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
42666
42871
|
{
|
|
42667
42872
|
key: "parseReturnStatement",
|
|
42668
42873
|
value: function parseReturnStatement(node) {
|
|
42669
|
-
if (!this.prodParam.hasReturn && !this.
|
|
42874
|
+
if (!this.prodParam.hasReturn && !(this.optionFlags & 2)) {
|
|
42670
42875
|
this.raise(Errors.IllegalReturn, this.state.startLoc);
|
|
42671
42876
|
}
|
|
42672
42877
|
this.next();
|
|
@@ -44294,6 +44499,47 @@ var Parser$1 = /*#__PURE__*/ function(StatementParser) {
|
|
|
44294
44499
|
_this.plugins = pluginsMap;
|
|
44295
44500
|
_this.filename = options.sourceFilename;
|
|
44296
44501
|
_this.startIndex = options.startIndex;
|
|
44502
|
+
var optionFlags = 0;
|
|
44503
|
+
if (options.allowAwaitOutsideFunction) {
|
|
44504
|
+
optionFlags |= 1;
|
|
44505
|
+
}
|
|
44506
|
+
if (options.allowReturnOutsideFunction) {
|
|
44507
|
+
optionFlags |= 2;
|
|
44508
|
+
}
|
|
44509
|
+
if (options.allowImportExportEverywhere) {
|
|
44510
|
+
optionFlags |= 8;
|
|
44511
|
+
}
|
|
44512
|
+
if (options.allowSuperOutsideMethod) {
|
|
44513
|
+
optionFlags |= 16;
|
|
44514
|
+
}
|
|
44515
|
+
if (options.allowUndeclaredExports) {
|
|
44516
|
+
optionFlags |= 32;
|
|
44517
|
+
}
|
|
44518
|
+
if (options.allowNewTargetOutsideFunction) {
|
|
44519
|
+
optionFlags |= 4;
|
|
44520
|
+
}
|
|
44521
|
+
if (options.ranges) {
|
|
44522
|
+
optionFlags |= 64;
|
|
44523
|
+
}
|
|
44524
|
+
if (options.tokens) {
|
|
44525
|
+
optionFlags |= 128;
|
|
44526
|
+
}
|
|
44527
|
+
if (options.createImportExpressions) {
|
|
44528
|
+
optionFlags |= 256;
|
|
44529
|
+
}
|
|
44530
|
+
if (options.createParenthesizedExpressions) {
|
|
44531
|
+
optionFlags |= 512;
|
|
44532
|
+
}
|
|
44533
|
+
if (options.errorRecovery) {
|
|
44534
|
+
optionFlags |= 1024;
|
|
44535
|
+
}
|
|
44536
|
+
if (options.attachComment) {
|
|
44537
|
+
optionFlags |= 2048;
|
|
44538
|
+
}
|
|
44539
|
+
if (options.annexB) {
|
|
44540
|
+
optionFlags |= 4096;
|
|
44541
|
+
}
|
|
44542
|
+
_this.optionFlags = optionFlags;
|
|
44297
44543
|
return _this;
|
|
44298
44544
|
}
|
|
44299
44545
|
_create_class(Parser, [
|
|
@@ -46927,7 +47173,7 @@ function TSInferType$1(node, parent) {
|
|
|
46927
47173
|
}
|
|
46928
47174
|
function TSInstantiationExpression$1(node, parent) {
|
|
46929
47175
|
var parentType = parent.type;
|
|
46930
|
-
return (parentType === "CallExpression" || parentType === "OptionalCallExpression" || parentType === "NewExpression" || parentType === "TSInstantiationExpression") && !!parent.
|
|
47176
|
+
return (parentType === "CallExpression" || parentType === "OptionalCallExpression" || parentType === "NewExpression" || parentType === "TSInstantiationExpression") && !!parent.typeArguments;
|
|
46931
47177
|
}
|
|
46932
47178
|
function BinaryExpression$1(node, parent, tokenContext, inForStatementInit) {
|
|
46933
47179
|
return node.operator === "in" && inForStatementInit;
|
|
@@ -47538,7 +47784,9 @@ function childrenIterator(node) {
|
|
|
47538
47784
|
}
|
|
47539
47785
|
function TaggedTemplateExpression$1(node) {
|
|
47540
47786
|
this.print(node.tag);
|
|
47541
|
-
|
|
47787
|
+
{
|
|
47788
|
+
this.print(node.typeArguments);
|
|
47789
|
+
}
|
|
47542
47790
|
this.print(node.quasi);
|
|
47543
47791
|
}
|
|
47544
47792
|
function TemplateElement$1() {
|
|
@@ -47614,7 +47862,6 @@ function NewExpression$1(node, parent) {
|
|
|
47614
47862
|
return;
|
|
47615
47863
|
}
|
|
47616
47864
|
this.print(node.typeArguments);
|
|
47617
|
-
this.print(node.typeParameters);
|
|
47618
47865
|
if (node.optional) {
|
|
47619
47866
|
this.token("?.");
|
|
47620
47867
|
}
|
|
@@ -47673,7 +47920,6 @@ function OptionalMemberExpression(node) {
|
|
|
47673
47920
|
}
|
|
47674
47921
|
function OptionalCallExpression$1(node) {
|
|
47675
47922
|
this.print(node.callee);
|
|
47676
|
-
this.print(node.typeParameters);
|
|
47677
47923
|
if (node.optional) {
|
|
47678
47924
|
this.token("?.");
|
|
47679
47925
|
}
|
|
@@ -47687,7 +47933,6 @@ function OptionalCallExpression$1(node) {
|
|
|
47687
47933
|
function CallExpression$2(node) {
|
|
47688
47934
|
this.print(node.callee);
|
|
47689
47935
|
this.print(node.typeArguments);
|
|
47690
|
-
this.print(node.typeParameters);
|
|
47691
47936
|
this.tokenChar(40);
|
|
47692
47937
|
var exit = this.enterDelimited();
|
|
47693
47938
|
this.printList(node.arguments, this.shouldPrintTrailingComma(")"));
|
|
@@ -48830,14 +49075,6 @@ function BigIntLiteral(node) {
|
|
|
48830
49075
|
}
|
|
48831
49076
|
this.word(node.value + "n");
|
|
48832
49077
|
}
|
|
48833
|
-
function DecimalLiteral(node) {
|
|
48834
|
-
var raw = this.getPossibleRaw(node);
|
|
48835
|
-
if (!this.format.minified && raw !== undefined) {
|
|
48836
|
-
this.word(raw);
|
|
48837
|
-
return;
|
|
48838
|
-
}
|
|
48839
|
-
this.word(node.value + "m");
|
|
48840
|
-
}
|
|
48841
49078
|
var validTopicTokenSet = /* @__PURE__ */ new Set([
|
|
48842
49079
|
"^^",
|
|
48843
49080
|
"@@",
|
|
@@ -49593,7 +49830,9 @@ function spaceSeparator() {
|
|
|
49593
49830
|
function JSXOpeningElement$1(node) {
|
|
49594
49831
|
this.tokenChar(60);
|
|
49595
49832
|
this.print(node.name);
|
|
49596
|
-
|
|
49833
|
+
{
|
|
49834
|
+
this.print(node.typeArguments);
|
|
49835
|
+
}
|
|
49597
49836
|
if (node.attributes.length > 0) {
|
|
49598
49837
|
this.space();
|
|
49599
49838
|
this.printJoin(node.attributes, undefined, undefined, spaceSeparator);
|
|
@@ -49871,8 +50110,9 @@ function TSTypeQuery$1(node) {
|
|
|
49871
50110
|
this.word("typeof");
|
|
49872
50111
|
this.space();
|
|
49873
50112
|
this.print(node.exprName);
|
|
49874
|
-
|
|
49875
|
-
|
|
50113
|
+
var typeArguments = node.typeArguments;
|
|
50114
|
+
if (typeArguments) {
|
|
50115
|
+
this.print(typeArguments);
|
|
49876
50116
|
}
|
|
49877
50117
|
}
|
|
49878
50118
|
function TSTypeLiteral$1(node) {
|
|
@@ -50010,7 +50250,7 @@ function TSLiteralType(node) {
|
|
|
50010
50250
|
}
|
|
50011
50251
|
function TSClassImplements(node) {
|
|
50012
50252
|
this.print(node.expression);
|
|
50013
|
-
this.print(node.
|
|
50253
|
+
this.print(node.typeArguments);
|
|
50014
50254
|
}
|
|
50015
50255
|
function TSInterfaceDeclaration$1(node) {
|
|
50016
50256
|
var declare = node.declare, id = node.id, typeParameters = node.typeParameters, extendz = node.extends, body = node.body;
|
|
@@ -50071,11 +50311,12 @@ function TSTypeAssertion(node) {
|
|
|
50071
50311
|
}
|
|
50072
50312
|
function TSInstantiationExpression(node) {
|
|
50073
50313
|
this.print(node.expression);
|
|
50074
|
-
|
|
50314
|
+
{
|
|
50315
|
+
this.print(node.typeArguments);
|
|
50316
|
+
}
|
|
50075
50317
|
}
|
|
50076
50318
|
function TSEnumDeclaration$1(node) {
|
|
50077
|
-
var
|
|
50078
|
-
var declare = node.declare, isConst = node.const, id = node.id, members = node.members;
|
|
50319
|
+
var declare = node.declare, isConst = node.const, id = node.id;
|
|
50079
50320
|
if (declare) {
|
|
50080
50321
|
this.word("declare");
|
|
50081
50322
|
this.space();
|
|
@@ -50088,9 +50329,15 @@ function TSEnumDeclaration$1(node) {
|
|
|
50088
50329
|
this.space();
|
|
50089
50330
|
this.print(id);
|
|
50090
50331
|
this.space();
|
|
50332
|
+
{
|
|
50333
|
+
this.print(node.body);
|
|
50334
|
+
}
|
|
50335
|
+
}
|
|
50336
|
+
function TSEnumBody(node) {
|
|
50337
|
+
var _this = this;
|
|
50091
50338
|
printBraced(this, node, function() {
|
|
50092
50339
|
var _this_shouldPrintTrailingComma;
|
|
50093
|
-
return _this.printList(members, (_this_shouldPrintTrailingComma = _this.shouldPrintTrailingComma("}")) !== null && _this_shouldPrintTrailingComma !== undefined ? _this_shouldPrintTrailingComma :
|
|
50340
|
+
return _this.printList(node.members, (_this_shouldPrintTrailingComma = _this.shouldPrintTrailingComma("}")) !== null && _this_shouldPrintTrailingComma !== undefined ? _this_shouldPrintTrailingComma : false, true, true);
|
|
50094
50341
|
});
|
|
50095
50342
|
}
|
|
50096
50343
|
function TSEnumMember$1(node) {
|
|
@@ -50130,17 +50377,22 @@ function TSModuleBlock$1(node) {
|
|
|
50130
50377
|
});
|
|
50131
50378
|
}
|
|
50132
50379
|
function TSImportType$1(node) {
|
|
50133
|
-
var argument = node.argument, qualifier = node.qualifier,
|
|
50380
|
+
var argument = node.argument, qualifier = node.qualifier, options = node.options;
|
|
50134
50381
|
this.word("import");
|
|
50135
50382
|
this.tokenChar(40);
|
|
50136
50383
|
this.print(argument);
|
|
50384
|
+
if (options) {
|
|
50385
|
+
this.tokenChar(44);
|
|
50386
|
+
this.print(options);
|
|
50387
|
+
}
|
|
50137
50388
|
this.tokenChar(41);
|
|
50138
50389
|
if (qualifier) {
|
|
50139
50390
|
this.tokenChar(46);
|
|
50140
50391
|
this.print(qualifier);
|
|
50141
50392
|
}
|
|
50142
|
-
|
|
50143
|
-
|
|
50393
|
+
var typeArguments = node.typeArguments;
|
|
50394
|
+
if (typeArguments) {
|
|
50395
|
+
this.print(typeArguments);
|
|
50144
50396
|
}
|
|
50145
50397
|
}
|
|
50146
50398
|
function TSImportEqualsDeclaration(node) {
|
|
@@ -50303,7 +50555,6 @@ var generatorFunctions = /* @__PURE__ */ Object.freeze({
|
|
|
50303
50555
|
ConditionalExpression: ConditionalExpression$2,
|
|
50304
50556
|
ContinueStatement: ContinueStatement$1,
|
|
50305
50557
|
DebuggerStatement: DebuggerStatement$1,
|
|
50306
|
-
DecimalLiteral: DecimalLiteral,
|
|
50307
50558
|
DeclareClass: DeclareClass,
|
|
50308
50559
|
DeclareExportAllDeclaration: DeclareExportAllDeclaration,
|
|
50309
50560
|
DeclareExportDeclaration: DeclareExportDeclaration,
|
|
@@ -50440,10 +50691,10 @@ var generatorFunctions = /* @__PURE__ */ Object.freeze({
|
|
|
50440
50691
|
TSConstructorType: TSConstructorType$1,
|
|
50441
50692
|
TSDeclareFunction: TSDeclareFunction$1,
|
|
50442
50693
|
TSDeclareMethod: TSDeclareMethod$1,
|
|
50694
|
+
TSEnumBody: TSEnumBody,
|
|
50443
50695
|
TSEnumDeclaration: TSEnumDeclaration$1,
|
|
50444
50696
|
TSEnumMember: TSEnumMember$1,
|
|
50445
50697
|
TSExportAssignment: TSExportAssignment$1,
|
|
50446
|
-
TSExpressionWithTypeArguments: TSClassImplements,
|
|
50447
50698
|
TSExternalModuleReference: TSExternalModuleReference,
|
|
50448
50699
|
TSFunctionType: TSFunctionType$1,
|
|
50449
50700
|
TSImportEqualsDeclaration: TSImportEqualsDeclaration,
|
|
@@ -50541,7 +50792,7 @@ var generatorFunctions = /* @__PURE__ */ Object.freeze({
|
|
|
50541
50792
|
tsPrintPropertyOrMethodName: tsPrintPropertyOrMethodName,
|
|
50542
50793
|
tsPrintSignatureDeclarationBase: tsPrintSignatureDeclarationBase
|
|
50543
50794
|
});
|
|
50544
|
-
var isExpression2 = lib_exports.isExpression, isFunction3 = lib_exports.isFunction, isStatement3 = lib_exports.isStatement, isClassBody2 = lib_exports.isClassBody, isTSInterfaceBody2 = lib_exports.isTSInterfaceBody,
|
|
50795
|
+
var isExpression2 = lib_exports.isExpression, isFunction3 = lib_exports.isFunction, isStatement3 = lib_exports.isStatement, isClassBody2 = lib_exports.isClassBody, isTSInterfaceBody2 = lib_exports.isTSInterfaceBody, isTSEnumMember2 = lib_exports.isTSEnumMember;
|
|
50545
50796
|
var SCIENTIFIC_NOTATION = /e/i;
|
|
50546
50797
|
var ZERO_DECIMAL_INTEGER = /\.0+$/;
|
|
50547
50798
|
var HAS_NEWLINE = /[\n\r\u2028\u2029]/;
|
|
@@ -51426,7 +51677,7 @@ var Printer = /*#__PURE__*/ function() {
|
|
|
51426
51677
|
}
|
|
51427
51678
|
if (len === 1) {
|
|
51428
51679
|
var singleLine = comment.loc ? comment.loc.start.line === comment.loc.end.line : !HAS_NEWLINE.test(comment.value);
|
|
51429
|
-
var shouldSkipNewline = singleLine && !isStatement3(node) && !isClassBody2(parent) && !isTSInterfaceBody2(parent) && !
|
|
51680
|
+
var shouldSkipNewline = singleLine && !isStatement3(node) && !isClassBody2(parent) && !isTSInterfaceBody2(parent) && !isTSEnumMember2(node);
|
|
51430
51681
|
if (type === 0) {
|
|
51431
51682
|
this._printComment(comment, shouldSkipNewline && node.type !== "ObjectExpression" || singleLine && isFunction3(parent, {
|
|
51432
51683
|
body: node
|
|
@@ -51947,7 +52198,7 @@ function verify$1(visitor) {
|
|
|
51947
52198
|
}
|
|
51948
52199
|
if (shouldIgnoreKey(nodeType)) continue;
|
|
51949
52200
|
if (!TYPES2.includes(nodeType)) {
|
|
51950
|
-
throw new Error("You gave us a visitor for the node type ".concat(nodeType, " but it's not a valid type in @babel/traverse ", "8.0.0-alpha.
|
|
52201
|
+
throw new Error("You gave us a visitor for the node type ".concat(nodeType, " but it's not a valid type in @babel/traverse ", "8.0.0-alpha.15"));
|
|
51951
52202
|
}
|
|
51952
52203
|
var visitors2 = visitor[nodeType];
|
|
51953
52204
|
if ((typeof visitors2 === "undefined" ? "undefined" : _type_of(visitors2)) === "object") {
|
|
@@ -78506,11 +78757,17 @@ const isPrev$1 = (path) => {
|
|
|
78506
78757
|
const isNextParent$5 = (path) => isNext$r(path.parentPath);
|
|
78507
78758
|
const isLast$e = (path) => isParentProgram$1(path) && !isNext$r(path);
|
|
78508
78759
|
|
|
78509
|
-
is$3.isNextObject = (a) => a
|
|
78510
|
-
|
|
78760
|
+
is$3.isNextObject = (a) => a
|
|
78761
|
+
.getNextSibling()
|
|
78762
|
+
.isObjectExpression();
|
|
78763
|
+
is$3.isPrevObject = (a) => a
|
|
78764
|
+
.getPrevSibling()
|
|
78765
|
+
.isObjectExpression();
|
|
78511
78766
|
|
|
78512
78767
|
is$3.isFirst = (path) => path.node === path.parentPath.node.body?.[0];
|
|
78513
|
-
is$3.isPrevBody = (path) => path
|
|
78768
|
+
is$3.isPrevBody = (path) => path
|
|
78769
|
+
.getPrevSibling()
|
|
78770
|
+
.isBlockStatement();
|
|
78514
78771
|
is$3.isNext = isNext$r;
|
|
78515
78772
|
is$3.isPrev = isPrev$1;
|
|
78516
78773
|
is$3.isNextParent = isNextParent$5;
|
|
@@ -78606,15 +78863,15 @@ is$3.satisfy = (conditions) => (path) => {
|
|
|
78606
78863
|
return false;
|
|
78607
78864
|
};
|
|
78608
78865
|
|
|
78609
|
-
const parseNode$
|
|
78866
|
+
const parseNode$3 = (path) => path.node || path;
|
|
78610
78867
|
|
|
78611
78868
|
is$3.hasCoupleTrailingComments = (path) => {
|
|
78612
|
-
const node = parseNode$
|
|
78869
|
+
const node = parseNode$3(path);
|
|
78613
78870
|
return node?.trailingComments?.length > 1;
|
|
78614
78871
|
};
|
|
78615
78872
|
|
|
78616
78873
|
is$3.hasTrailingComment = (path) => {
|
|
78617
|
-
const node = parseNode$
|
|
78874
|
+
const node = parseNode$3(path);
|
|
78618
78875
|
return node.trailingComments?.length;
|
|
78619
78876
|
};
|
|
78620
78877
|
|
|
@@ -78844,9 +79101,7 @@ const isFnParam = (path) => {
|
|
|
78844
79101
|
if (!parentPath.isFunction())
|
|
78845
79102
|
return false;
|
|
78846
79103
|
|
|
78847
|
-
return parentPath
|
|
78848
|
-
.get('params')
|
|
78849
|
-
.includes(path);
|
|
79104
|
+
return parentPath.get('params').includes(path);
|
|
78850
79105
|
};
|
|
78851
79106
|
|
|
78852
79107
|
function isSameLine(path, loc) {
|
|
@@ -78996,9 +79251,7 @@ comment.parseComments = parseComments$7;
|
|
|
78996
79251
|
|
|
78997
79252
|
const {parseComments: parseComments$6} = comment;
|
|
78998
79253
|
|
|
78999
|
-
|
|
79000
|
-
return path.get('params');
|
|
79001
|
-
}
|
|
79254
|
+
const parseParams = (path) => path.get('params');
|
|
79002
79255
|
|
|
79003
79256
|
params.printParams = (path, printer, semantics, customization = {}) => {
|
|
79004
79257
|
const {extra, typeParameters} = path.node;
|
|
@@ -79442,7 +79695,7 @@ unaryExpressions$1.UnaryExpression = unaryExpression;
|
|
|
79442
79695
|
unaryExpressions$1.UpdateExpression = unaryExpression;
|
|
79443
79696
|
|
|
79444
79697
|
unaryExpressions$1.AwaitExpression = maybeParens$b((path, {print}) => {
|
|
79445
|
-
printUnary(
|
|
79698
|
+
printUnary('await', {
|
|
79446
79699
|
print,
|
|
79447
79700
|
});
|
|
79448
79701
|
});
|
|
@@ -79459,7 +79712,7 @@ unaryExpressions$1.YieldExpression = maybeParens$b((path, {print, maybe}) => {
|
|
|
79459
79712
|
unaryExpressions$1.ThrowStatement = (path, {print, indent, maybe}) => {
|
|
79460
79713
|
indent();
|
|
79461
79714
|
|
|
79462
|
-
printUnary(
|
|
79715
|
+
printUnary('throw', {
|
|
79463
79716
|
print,
|
|
79464
79717
|
});
|
|
79465
79718
|
|
|
@@ -79468,7 +79721,7 @@ unaryExpressions$1.ThrowStatement = (path, {print, indent, maybe}) => {
|
|
|
79468
79721
|
maybe.print.breakline(isNext$m(path));
|
|
79469
79722
|
};
|
|
79470
79723
|
|
|
79471
|
-
function printUnary(
|
|
79724
|
+
function printUnary(name, {print}) {
|
|
79472
79725
|
print(`${name} `);
|
|
79473
79726
|
print('__argument');
|
|
79474
79727
|
}
|
|
@@ -79633,16 +79886,14 @@ const isIfUp = (path) => {
|
|
|
79633
79886
|
if (!ifPath)
|
|
79634
79887
|
return is;
|
|
79635
79888
|
|
|
79636
|
-
ifPath
|
|
79637
|
-
|
|
79638
|
-
|
|
79639
|
-
|
|
79640
|
-
|
|
79641
|
-
|
|
79642
|
-
|
|
79643
|
-
|
|
79644
|
-
},
|
|
79645
|
-
});
|
|
79889
|
+
ifPath.get('test').traverse({
|
|
79890
|
+
MemberExpression(currentPath) {
|
|
79891
|
+
if (path === currentPath) {
|
|
79892
|
+
is = true;
|
|
79893
|
+
path.stop();
|
|
79894
|
+
}
|
|
79895
|
+
},
|
|
79896
|
+
});
|
|
79646
79897
|
|
|
79647
79898
|
return is;
|
|
79648
79899
|
};
|
|
@@ -79728,9 +79979,7 @@ const classVisitor = maybeDecorators$2((path, printer, semantics) => {
|
|
|
79728
79979
|
|
|
79729
79980
|
if (node.implements) {
|
|
79730
79981
|
print(' implements ');
|
|
79731
|
-
path
|
|
79732
|
-
.get('implements')
|
|
79733
|
-
.forEach(print);
|
|
79982
|
+
path.get('implements').forEach(print);
|
|
79734
79983
|
}
|
|
79735
79984
|
|
|
79736
79985
|
print.space();
|
|
@@ -79801,7 +80050,7 @@ const CallExpression$1 = maybeParens$9((path, {indent, print, maybe, traverse})
|
|
|
79801
80050
|
const isParentCall = tooLong$1(args) && path.parentPath.isCallExpression();
|
|
79802
80051
|
|
|
79803
80052
|
const callee = path.get('callee');
|
|
79804
|
-
const typeParameters = path.get('
|
|
80053
|
+
const typeParameters = path.get('typeArguments');
|
|
79805
80054
|
|
|
79806
80055
|
traverse(callee);
|
|
79807
80056
|
|
|
@@ -79897,7 +80146,7 @@ newExpression.NewExpression = {
|
|
|
79897
80146
|
const {print, maybe} = printer;
|
|
79898
80147
|
print('new ');
|
|
79899
80148
|
print('__callee');
|
|
79900
|
-
print('
|
|
80149
|
+
print('__typeArguments');
|
|
79901
80150
|
|
|
79902
80151
|
const args = path.get('arguments');
|
|
79903
80152
|
maybePrintOpenBrace(path, printer, semantics);
|
|
@@ -80075,9 +80324,7 @@ const notLastArgInsideCall = (path) => {
|
|
|
80075
80324
|
if (isCoupleLines$8(path))
|
|
80076
80325
|
return false;
|
|
80077
80326
|
|
|
80078
|
-
return path !== parentPath
|
|
80079
|
-
.get('arguments')
|
|
80080
|
-
.at(-1);
|
|
80327
|
+
return path !== parentPath.get('arguments').at(-1);
|
|
80081
80328
|
};
|
|
80082
80329
|
|
|
80083
80330
|
const ONE_LINE$2 = true;
|
|
@@ -80940,11 +81187,15 @@ const {entries: entries$a} = Object;
|
|
|
80940
81187
|
const isOneDeclaration = ({node}) => node.declarations.length === 1;
|
|
80941
81188
|
|
|
80942
81189
|
remove$2.remove = (path) => {
|
|
80943
|
-
const
|
|
81190
|
+
const {scope} = path;
|
|
80944
81191
|
const prev = getPrevSibling(path);
|
|
80945
81192
|
|
|
80946
|
-
if (
|
|
80947
|
-
programBlock
|
|
81193
|
+
if (scope) {
|
|
81194
|
+
const programBlock = scope.getProgramParent().block;
|
|
81195
|
+
|
|
81196
|
+
if (scope.block === programBlock && !prev.node)
|
|
81197
|
+
programBlock.comments = getComments(path);
|
|
81198
|
+
}
|
|
80948
81199
|
|
|
80949
81200
|
if (!path.parentPath.isArrayPattern()) {
|
|
80950
81201
|
path.remove();
|
|
@@ -81346,7 +81597,16 @@ var replaceWith$6 = {};
|
|
|
81346
81597
|
const {maybeBody} = maybeBody$2;
|
|
81347
81598
|
const {assign: assign$b} = Object;
|
|
81348
81599
|
|
|
81600
|
+
const parseNode$2 = (a) => {
|
|
81601
|
+
if (a.node)
|
|
81602
|
+
return a.node;
|
|
81603
|
+
|
|
81604
|
+
return a;
|
|
81605
|
+
};
|
|
81606
|
+
|
|
81349
81607
|
replaceWith$6.replaceWith = (path, node) => {
|
|
81608
|
+
node = parseNode$2(node);
|
|
81609
|
+
|
|
81350
81610
|
if (path?.parentPath?.isExpressionStatement() && !path.parentPath.isProgram())
|
|
81351
81611
|
path = path.parentPath;
|
|
81352
81612
|
|
|
@@ -81734,13 +81994,9 @@ function isNumbers(elements) {
|
|
|
81734
81994
|
return false;
|
|
81735
81995
|
}
|
|
81736
81996
|
|
|
81737
|
-
|
|
81738
|
-
return !parentPath.isCallExpression();
|
|
81739
|
-
}
|
|
81997
|
+
const isLastArg = ({parentPath}) => !parentPath.isCallExpression();
|
|
81740
81998
|
|
|
81741
|
-
|
|
81742
|
-
return path.find(isObjectProperty);
|
|
81743
|
-
}
|
|
81999
|
+
const isParentProperty = (path) => path.find(isObjectProperty);
|
|
81744
82000
|
|
|
81745
82001
|
newline.isIncreaseIndent = isIncreaseIndent$1;
|
|
81746
82002
|
function isIncreaseIndent$1(path) {
|
|
@@ -81913,9 +82169,7 @@ const isSpreadBeforeObject = (a) => {
|
|
|
81913
82169
|
if (prev.getPrevSibling().isObjectExpression())
|
|
81914
82170
|
return false;
|
|
81915
82171
|
|
|
81916
|
-
return prev
|
|
81917
|
-
.get('argument')
|
|
81918
|
-
.isCallExpression();
|
|
82172
|
+
return prev.get('argument').isCallExpression();
|
|
81919
82173
|
};
|
|
81920
82174
|
|
|
81921
82175
|
const isNextSimple = (a) => {
|
|
@@ -83010,9 +83264,7 @@ const isNextAssign = (path) => {
|
|
|
83010
83264
|
if (parentPath.isBlockStatement() && parentPath.node.body.length < 3)
|
|
83011
83265
|
return false;
|
|
83012
83266
|
|
|
83013
|
-
return nextPath
|
|
83014
|
-
.get('expression')
|
|
83015
|
-
.isAssignmentExpression();
|
|
83267
|
+
return nextPath.get('expression').isAssignmentExpression();
|
|
83016
83268
|
};
|
|
83017
83269
|
|
|
83018
83270
|
var ifStatement = {};
|
|
@@ -84201,9 +84453,7 @@ program.Program = (path, printer, semantics) => {
|
|
|
84201
84453
|
maybe.write.newline(body.length);
|
|
84202
84454
|
}
|
|
84203
84455
|
|
|
84204
|
-
path
|
|
84205
|
-
.get('body')
|
|
84206
|
-
.forEach(traverse);
|
|
84456
|
+
path.get('body').forEach(traverse);
|
|
84207
84457
|
|
|
84208
84458
|
if (directives.length && !body.length)
|
|
84209
84459
|
return;
|
|
@@ -84507,8 +84757,14 @@ const {
|
|
|
84507
84757
|
|
|
84508
84758
|
const {markAfter: markAfter$2} = mark;
|
|
84509
84759
|
const {maybeDeclare: maybeDeclare$3} = maybeDeclare$6;
|
|
84510
|
-
|
|
84511
|
-
const
|
|
84760
|
+
|
|
84761
|
+
const isNextType = (a) => a
|
|
84762
|
+
.getNextSibling()
|
|
84763
|
+
.isTSTypeAliasDeclaration();
|
|
84764
|
+
|
|
84765
|
+
const isNextExport = (a) => a
|
|
84766
|
+
.getNextSibling()
|
|
84767
|
+
.isExportDeclaration();
|
|
84512
84768
|
|
|
84513
84769
|
tsTypeAliasDeclaration.TSTypeAliasDeclaration = {
|
|
84514
84770
|
beforeIf: (path) => !path.parentPath.isExportDeclaration(),
|
|
@@ -84804,9 +85060,7 @@ tsInterfaceDeclaration.TSInterfaceDeclaration = {
|
|
|
84804
85060
|
|
|
84805
85061
|
if (node.extends) {
|
|
84806
85062
|
print(' extends ');
|
|
84807
|
-
path
|
|
84808
|
-
.get('extends')
|
|
84809
|
-
.map(print);
|
|
85063
|
+
path.get('extends').map(print);
|
|
84810
85064
|
}
|
|
84811
85065
|
|
|
84812
85066
|
print('__typeParameters');
|
|
@@ -85001,7 +85255,7 @@ tsEnumDeclaration.TSEnumDeclaration = {
|
|
|
85001
85255
|
indent.inc();
|
|
85002
85256
|
print.newline();
|
|
85003
85257
|
|
|
85004
|
-
for (const member of path.get('members')) {
|
|
85258
|
+
for (const member of path.get('body.members')) {
|
|
85005
85259
|
traverse(member);
|
|
85006
85260
|
print(',');
|
|
85007
85261
|
print.newline();
|
|
@@ -85442,7 +85696,7 @@ var typescript$1 = {
|
|
|
85442
85696
|
},
|
|
85443
85697
|
TSInstantiationExpression(path, {print}) {
|
|
85444
85698
|
print('__expression');
|
|
85445
|
-
print('
|
|
85699
|
+
print('__typeArguments');
|
|
85446
85700
|
},
|
|
85447
85701
|
TSAnyKeyword(path, {write}) {
|
|
85448
85702
|
write('any');
|
|
@@ -85471,7 +85725,7 @@ var typescript$1 = {
|
|
|
85471
85725
|
},
|
|
85472
85726
|
TSClassImplements(path, {print}) {
|
|
85473
85727
|
print('__expression');
|
|
85474
|
-
print('
|
|
85728
|
+
print('__typeArguments');
|
|
85475
85729
|
},
|
|
85476
85730
|
TSInterfaceHeritage(path, {print}) {
|
|
85477
85731
|
print('__expression');
|
|
@@ -85535,22 +85789,16 @@ jsxElement.JSXElement = {
|
|
|
85535
85789
|
write.newline();
|
|
85536
85790
|
}
|
|
85537
85791
|
},
|
|
85538
|
-
print(path, {print, traverse,
|
|
85539
|
-
const
|
|
85540
|
-
|
|
85541
|
-
|
|
85542
|
-
if (insideFn && insideCall)
|
|
85543
|
-
indent.inc();
|
|
85792
|
+
print(path, {print, traverse, maybe}) {
|
|
85793
|
+
const needIndent = isNeedIndent(path);
|
|
85794
|
+
maybe.indent.inc(needIndent);
|
|
85544
85795
|
|
|
85545
85796
|
print('__openingElement');
|
|
85546
|
-
path
|
|
85547
|
-
.get('children')
|
|
85548
|
-
.map(traverse);
|
|
85797
|
+
path.get('children').map(traverse);
|
|
85549
85798
|
|
|
85550
85799
|
print('__closingElement');
|
|
85551
85800
|
|
|
85552
|
-
|
|
85553
|
-
indent.dec();
|
|
85801
|
+
maybe.indent.dec(needIndent);
|
|
85554
85802
|
},
|
|
85555
85803
|
after(path, {write, indent, maybe}) {
|
|
85556
85804
|
const {leadingComments} = path.node;
|
|
@@ -85581,6 +85829,19 @@ function condition$1(path) {
|
|
|
85581
85829
|
return path.parentPath.isVariableDeclarator();
|
|
85582
85830
|
}
|
|
85583
85831
|
|
|
85832
|
+
function isNeedIndent(path) {
|
|
85833
|
+
const attributesCount = path.node.openingElement.attributes.length;
|
|
85834
|
+
|
|
85835
|
+
if (attributesCount > 3)
|
|
85836
|
+
return false;
|
|
85837
|
+
|
|
85838
|
+
const insideFn = path.parentPath.isArrowFunctionExpression();
|
|
85839
|
+
const insideJSX = path.parentPath.isJSXElement();
|
|
85840
|
+
const insideCall = path.parentPath.parentPath.isCallExpression();
|
|
85841
|
+
|
|
85842
|
+
return insideJSX || insideFn && insideCall;
|
|
85843
|
+
}
|
|
85844
|
+
|
|
85584
85845
|
var jsxAttribute = {};
|
|
85585
85846
|
|
|
85586
85847
|
const {isCoupleLines: isCoupleLines$2} = is$3;
|
|
@@ -85664,9 +85925,7 @@ jsxFragment.JSXFragment = {
|
|
|
85664
85925
|
},
|
|
85665
85926
|
print(path, {print, traverse}) {
|
|
85666
85927
|
print('__openingFragment');
|
|
85667
|
-
path
|
|
85668
|
-
.get('children')
|
|
85669
|
-
.map(traverse);
|
|
85928
|
+
path.get('children').map(traverse);
|
|
85670
85929
|
print('__closingFragment');
|
|
85671
85930
|
},
|
|
85672
85931
|
after(path, {write, indent}) {
|
|
@@ -85959,35 +86218,31 @@ overrides.parseOverrides = (overrides = {}) => {
|
|
|
85959
86218
|
};
|
|
85960
86219
|
};
|
|
85961
86220
|
|
|
85962
|
-
|
|
85963
|
-
|
|
85964
|
-
|
|
85965
|
-
|
|
85966
|
-
|
|
85967
|
-
|
|
85968
|
-
|
|
85969
|
-
|
|
85970
|
-
|
|
85971
|
-
};
|
|
85972
|
-
}
|
|
86221
|
+
const initFormat = (format) => ({
|
|
86222
|
+
indent: ' ',
|
|
86223
|
+
newline: '\n',
|
|
86224
|
+
space: ' ',
|
|
86225
|
+
splitter: '\n',
|
|
86226
|
+
quote: `'`,
|
|
86227
|
+
endOfFile: '\n',
|
|
86228
|
+
...format,
|
|
86229
|
+
});
|
|
85973
86230
|
|
|
85974
|
-
|
|
85975
|
-
|
|
85976
|
-
|
|
85977
|
-
|
|
85978
|
-
|
|
85979
|
-
|
|
85980
|
-
|
|
85981
|
-
|
|
85982
|
-
|
|
85983
|
-
|
|
85984
|
-
|
|
85985
|
-
|
|
85986
|
-
|
|
85987
|
-
|
|
85988
|
-
|
|
85989
|
-
};
|
|
85990
|
-
}
|
|
86231
|
+
const initSemantics = (semantics = {}) => ({
|
|
86232
|
+
comments: true,
|
|
86233
|
+
maxPropertiesInOneLine: 2,
|
|
86234
|
+
maxPropertiesLengthInOneLine: 15,
|
|
86235
|
+
maxSpecifiersInOneLine: 2,
|
|
86236
|
+
maxElementsInOneLine: 5,
|
|
86237
|
+
maxLogicalsInOneLine: 3,
|
|
86238
|
+
maxVariablesInOneLine: 4,
|
|
86239
|
+
maxTypesInOneLine: 3,
|
|
86240
|
+
trailingComma: true,
|
|
86241
|
+
encodeSingleQuote: true,
|
|
86242
|
+
encodeDoubleQuote: false,
|
|
86243
|
+
...semantics,
|
|
86244
|
+
roundBraces: parseRoundBraces(semantics),
|
|
86245
|
+
});
|
|
85991
86246
|
|
|
85992
86247
|
const fullstore$2 = fullstore$3;
|
|
85993
86248
|
|
|
@@ -86467,7 +86722,9 @@ const {isArray: isArray$d} = Array;
|
|
|
86467
86722
|
|
|
86468
86723
|
const maybeArray$7 = (a) => isArray$d(a) ? a : [a, {}];
|
|
86469
86724
|
|
|
86470
|
-
const btoa$1 = (a) => Buffer
|
|
86725
|
+
const btoa$1 = (a) => Buffer
|
|
86726
|
+
.from(a, 'binary')
|
|
86727
|
+
.toString('base64');
|
|
86471
86728
|
|
|
86472
86729
|
const addSourceMap = (sourceMapName, {code, map}) => !sourceMapName ? code : `${code}\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,${btoa$1(stringify$7(map))}\n`;
|
|
86473
86730
|
const fixStrictMode = (a) => a.replace(`\n\n\n'use strict'`, `\n\n'use strict'`);
|
|
@@ -86758,16 +87015,14 @@ ts.convertTSAbstractMethodDefinition = (path) => {
|
|
|
86758
87015
|
path.replaceWith(newNode);
|
|
86759
87016
|
};
|
|
86760
87017
|
|
|
86761
|
-
|
|
86762
|
-
|
|
86763
|
-
|
|
86764
|
-
|
|
86765
|
-
|
|
86766
|
-
|
|
86767
|
-
|
|
86768
|
-
|
|
86769
|
-
};
|
|
86770
|
-
}
|
|
87018
|
+
const createPrivateName = (node) => ({
|
|
87019
|
+
type: 'PrivateName',
|
|
87020
|
+
id: {
|
|
87021
|
+
...node,
|
|
87022
|
+
type: 'Identifier',
|
|
87023
|
+
},
|
|
87024
|
+
loc: node.loc,
|
|
87025
|
+
});
|
|
86771
87026
|
|
|
86772
87027
|
var comments = {};
|
|
86773
87028
|
|
|
@@ -86803,9 +87058,7 @@ comments.convertProgramComments = (comments) => {
|
|
|
86803
87058
|
return comments;
|
|
86804
87059
|
};
|
|
86805
87060
|
|
|
86806
|
-
|
|
86807
|
-
return `Comment${type}`;
|
|
86808
|
-
}
|
|
87061
|
+
const getCommentType = ({type}) => `Comment${type}`;
|
|
86809
87062
|
|
|
86810
87063
|
function getCommentGroup({trailing, leading}) {
|
|
86811
87064
|
if (trailing)
|
|
@@ -114173,22 +114426,20 @@ var parse$5 = (source, options) => {
|
|
|
114173
114426
|
});
|
|
114174
114427
|
};
|
|
114175
114428
|
|
|
114176
|
-
|
|
114177
|
-
|
|
114178
|
-
|
|
114179
|
-
|
|
114180
|
-
|
|
114181
|
-
|
|
114182
|
-
|
|
114183
|
-
|
|
114184
|
-
|
|
114185
|
-
|
|
114186
|
-
|
|
114187
|
-
|
|
114188
|
-
|
|
114189
|
-
|
|
114190
|
-
};
|
|
114191
|
-
}
|
|
114429
|
+
const getParser = ({parser = 'babel', isTS, isFlow, isJSX, printer}) => ({
|
|
114430
|
+
parse(source) {
|
|
114431
|
+
const ast = toBabel(customParser(source, parser, {
|
|
114432
|
+
isTS,
|
|
114433
|
+
isFlow,
|
|
114434
|
+
isJSX,
|
|
114435
|
+
}));
|
|
114436
|
+
|
|
114437
|
+
if (printer === 'recast')
|
|
114438
|
+
moveOutDirectives(ast);
|
|
114439
|
+
|
|
114440
|
+
return ast;
|
|
114441
|
+
},
|
|
114442
|
+
});
|
|
114192
114443
|
|
|
114193
114444
|
parse$5.default;
|
|
114194
114445
|
|
|
@@ -116361,17 +116612,15 @@ var superFind$1 = function superFind({rule, find, ast, options, template}) {
|
|
|
116361
116612
|
];
|
|
116362
116613
|
};
|
|
116363
116614
|
|
|
116364
|
-
|
|
116365
|
-
|
|
116366
|
-
|
|
116367
|
-
|
|
116368
|
-
|
|
116369
|
-
|
|
116370
|
-
|
|
116371
|
-
|
|
116372
|
-
|
|
116373
|
-
};
|
|
116374
|
-
}
|
|
116615
|
+
const traverse$8 = ({rule, options, template}) => (ast, visitor) => {
|
|
116616
|
+
const templateVisitors = merge$1(template({
|
|
116617
|
+
rule,
|
|
116618
|
+
visitor,
|
|
116619
|
+
options,
|
|
116620
|
+
}));
|
|
116621
|
+
|
|
116622
|
+
return babelTraverse$1(ast, templateVisitors);
|
|
116623
|
+
};
|
|
116375
116624
|
|
|
116376
116625
|
const log$5 = browserExports('putout:runner:include');
|
|
116377
116626
|
const maybeArray$4 = maybeArray_1;
|
|
@@ -116886,6 +117135,7 @@ is$2.parseTemplate = (tmpl, {program} = {}) => {
|
|
|
116886
117135
|
};
|
|
116887
117136
|
|
|
116888
117137
|
is$2.isInsideTypeReference = (path) => path.isIdentifier() && path.parentPath?.isTSTypeReference();
|
|
117138
|
+
is$2.isInsideTypeParameter = (path) => path.isIdentifier() && path.parentPath?.isTSTypeParameter();
|
|
116889
117139
|
|
|
116890
117140
|
const jessy = jessy$1;
|
|
116891
117141
|
const nessy = nessy$1;
|
|
@@ -116903,6 +117153,7 @@ const {
|
|
|
116903
117153
|
isImportsStr,
|
|
116904
117154
|
isExportsStr,
|
|
116905
117155
|
isInsideTypeReference,
|
|
117156
|
+
isInsideTypeParameter,
|
|
116906
117157
|
isBodyStr,
|
|
116907
117158
|
} = is$2;
|
|
116908
117159
|
|
|
@@ -116958,6 +117209,9 @@ function findVarsWays$2(node) {
|
|
|
116958
117209
|
if (isInsideTypeReference(path))
|
|
116959
117210
|
return;
|
|
116960
117211
|
|
|
117212
|
+
if (isInsideTypeParameter(path))
|
|
117213
|
+
return;
|
|
117214
|
+
|
|
116961
117215
|
const {node} = path;
|
|
116962
117216
|
|
|
116963
117217
|
if (isJSXAttribute(path.parentPath) && path.parentPath.node.name === node)
|
|
@@ -117332,7 +117586,11 @@ function compareTemplateElements(node, template) {
|
|
|
117332
117586
|
}
|
|
117333
117587
|
|
|
117334
117588
|
function linkNodes(node, template, {add, templateStore}) {
|
|
117335
|
-
const is = node
|
|
117589
|
+
const is = node
|
|
117590
|
+
&& (isLinkedNode$1(template)
|
|
117591
|
+
|| isLinkedArgs(template)
|
|
117592
|
+
|| isLinkedId$1(node, template)
|
|
117593
|
+
|| isLinkedBool(node, template));
|
|
117336
117594
|
|
|
117337
117595
|
if (is)
|
|
117338
117596
|
return link({
|
|
@@ -117634,8 +117892,10 @@ function findKey(path, parent) {
|
|
|
117634
117892
|
}
|
|
117635
117893
|
|
|
117636
117894
|
const wraptile = wraptile$1;
|
|
117637
|
-
|
|
117895
|
+
|
|
117638
117896
|
const {types: types$9} = bundle;
|
|
117897
|
+
const findPath = findPath$1;
|
|
117898
|
+
|
|
117639
117899
|
const {isProgram: isProgram$2} = types$9;
|
|
117640
117900
|
const name = '__putout_runner_replace';
|
|
117641
117901
|
const hasWatermark = (watermark) => (path) => path.node?.[name]?.has(watermark);
|
|
@@ -117956,6 +118216,8 @@ const {template: template$4} = parser$6;
|
|
|
117956
118216
|
const {isESM, insertAfter} = operate;
|
|
117957
118217
|
const {compare: compare$2} = compare$5;
|
|
117958
118218
|
|
|
118219
|
+
const {types: types$7} = bundle;
|
|
118220
|
+
|
|
117959
118221
|
const {
|
|
117960
118222
|
addDeclarationForESLint,
|
|
117961
118223
|
checkDeclarationForESLint,
|
|
@@ -117963,7 +118225,6 @@ const {
|
|
|
117963
118225
|
setModuleType,
|
|
117964
118226
|
} = record;
|
|
117965
118227
|
|
|
117966
|
-
const {types: types$7} = bundle;
|
|
117967
118228
|
const {
|
|
117968
118229
|
isImportDeclaration,
|
|
117969
118230
|
isVariableDeclaration,
|
|
@@ -117972,11 +118233,17 @@ const {
|
|
|
117972
118233
|
const {keys} = Object;
|
|
117973
118234
|
const isString$3 = (a) => typeof a === 'string';
|
|
117974
118235
|
|
|
117975
|
-
const getLastVarPath = (bodyPath) => bodyPath
|
|
118236
|
+
const getLastVarPath = (bodyPath) => bodyPath
|
|
118237
|
+
.filter(isVariableDeclaration)
|
|
118238
|
+
.pop();
|
|
118239
|
+
|
|
117976
118240
|
const isLast = (insertionPath, bodyPath) => bodyPath.at(-1) === insertionPath;
|
|
117977
118241
|
const isLocalImport = (path) => path.node.source.value.includes('.');
|
|
117978
118242
|
|
|
117979
|
-
const cutName = (a) => a
|
|
118243
|
+
const cutName = (a) => a
|
|
118244
|
+
.split('.')
|
|
118245
|
+
.shift();
|
|
118246
|
+
|
|
117980
118247
|
const parseType = (path) => isESM(path) ? 'esm' : 'commonjs';
|
|
117981
118248
|
|
|
117982
118249
|
const TS_EXCLUDE = [
|
|
@@ -118284,6 +118551,9 @@ const getRegExp = (wildcard) => {
|
|
|
118284
118551
|
};
|
|
118285
118552
|
|
|
118286
118553
|
filesystem.getParentDirectory = (filePath) => {
|
|
118554
|
+
if (!filePath.parentPath)
|
|
118555
|
+
return null;
|
|
118556
|
+
|
|
118287
118557
|
const {parentPath} = filePath.parentPath.parentPath;
|
|
118288
118558
|
|
|
118289
118559
|
if (isProgram$1(parentPath))
|
|
@@ -118486,9 +118756,7 @@ filesystem.createFile = (dirPath, name, content) => {
|
|
|
118486
118756
|
|
|
118487
118757
|
dirPathFiles.node.value.elements.push(ObjectExpression$1(properties));
|
|
118488
118758
|
|
|
118489
|
-
const filePath = dirPathFiles
|
|
118490
|
-
.get('value.elements')
|
|
118491
|
-
.at(-1);
|
|
118759
|
+
const filePath = dirPathFiles.get('value.elements').at(-1);
|
|
118492
118760
|
|
|
118493
118761
|
if (isString$2(content))
|
|
118494
118762
|
writeFileContent$1(filePath, content);
|
|
@@ -118496,9 +118764,7 @@ filesystem.createFile = (dirPath, name, content) => {
|
|
|
118496
118764
|
return filePath;
|
|
118497
118765
|
};
|
|
118498
118766
|
|
|
118499
|
-
|
|
118500
|
-
return getProperty$2(dirPath, 'files');
|
|
118501
|
-
}
|
|
118767
|
+
const getFiles$1 = (dirPath) => getProperty$2(dirPath, 'files');
|
|
118502
118768
|
|
|
118503
118769
|
filesystem.createDirectory = (dirPath, name) => {
|
|
118504
118770
|
const dirPathFiles = getFiles$1(dirPath);
|
|
@@ -118517,9 +118783,7 @@ filesystem.createDirectory = (dirPath, name) => {
|
|
|
118517
118783
|
|
|
118518
118784
|
maybeFS.createDirectory(filename);
|
|
118519
118785
|
|
|
118520
|
-
return dirPathFiles
|
|
118521
|
-
.get('value.elements')
|
|
118522
|
-
.at(-1);
|
|
118786
|
+
return dirPathFiles.get('value.elements').at(-1);
|
|
118523
118787
|
};
|
|
118524
118788
|
|
|
118525
118789
|
filesystem.readFileContent = (filePath) => {
|
|
@@ -118574,8 +118838,9 @@ filesystem.start = maybeFS.start;
|
|
|
118574
118838
|
|
|
118575
118839
|
var convertSimpleFilesystemToFilesystem = {};
|
|
118576
118840
|
|
|
118577
|
-
const {types: types$5} = bundle;
|
|
118578
118841
|
const {basename, dirname} = require$$0$2;
|
|
118842
|
+
const {types: types$5} = bundle;
|
|
118843
|
+
|
|
118579
118844
|
const {
|
|
118580
118845
|
createDirectory,
|
|
118581
118846
|
getFileType: getFileType$1,
|
|
@@ -119028,27 +119293,25 @@ template$3.exports = ({rule, visitor, options}) => {
|
|
|
119028
119293
|
|
|
119029
119294
|
template$3.exports._log = log;
|
|
119030
119295
|
|
|
119031
|
-
|
|
119032
|
-
|
|
119033
|
-
|
|
119034
|
-
|
|
119035
|
-
|
|
119036
|
-
|
|
119037
|
-
|
|
119038
|
-
|
|
119039
|
-
|
|
119040
|
-
|
|
119041
|
-
|
|
119042
|
-
|
|
119043
|
-
|
|
119044
|
-
|
|
119045
|
-
|
|
119046
|
-
|
|
119047
|
-
|
|
119048
|
-
|
|
119049
|
-
|
|
119050
|
-
};
|
|
119051
|
-
}
|
|
119296
|
+
const wrapWithCheck = ({rule, nodesInclude, nodesExclude, fn}) => (path) => {
|
|
119297
|
+
log(rule, path);
|
|
119298
|
+
|
|
119299
|
+
if (nodesExclude.length && compareAny$1(path, nodesExclude))
|
|
119300
|
+
return;
|
|
119301
|
+
|
|
119302
|
+
if (nodesInclude.length && !compareAll(path, nodesInclude))
|
|
119303
|
+
return;
|
|
119304
|
+
|
|
119305
|
+
if (!isFn(fn))
|
|
119306
|
+
throw Error(`☝️ Looks like provided visitor is not a function: ${stringify(fn)}. More on using Traverser: https://git.io/JqcMn`);
|
|
119307
|
+
|
|
119308
|
+
const [e] = tryCatch$1(fn, path);
|
|
119309
|
+
|
|
119310
|
+
if (e) {
|
|
119311
|
+
e.rule = rule;
|
|
119312
|
+
throw e;
|
|
119313
|
+
}
|
|
119314
|
+
};
|
|
119052
119315
|
|
|
119053
119316
|
var templateExports = template$3.exports;
|
|
119054
119317
|
|
|
@@ -119641,25 +119904,23 @@ lib.runPlugins = ({ast, shebang, fix, fixCount, plugins, progress = createProgre
|
|
|
119641
119904
|
|
|
119642
119905
|
lib.getPosition = getPosition;
|
|
119643
119906
|
|
|
119644
|
-
|
|
119645
|
-
|
|
119646
|
-
|
|
119647
|
-
|
|
119648
|
-
|
|
119649
|
-
|
|
119650
|
-
|
|
119651
|
-
|
|
119652
|
-
|
|
119653
|
-
|
|
119654
|
-
|
|
119655
|
-
|
|
119656
|
-
|
|
119657
|
-
|
|
119658
|
-
|
|
119659
|
-
|
|
119660
|
-
|
|
119661
|
-
];
|
|
119662
|
-
}
|
|
119907
|
+
const run = ({ast, fix, shebang, pluginsFind, pluginsTraverse, template, merge}) => [
|
|
119908
|
+
...runWithoutMerge({
|
|
119909
|
+
ast,
|
|
119910
|
+
fix,
|
|
119911
|
+
shebang,
|
|
119912
|
+
template,
|
|
119913
|
+
pluginsFind,
|
|
119914
|
+
}),
|
|
119915
|
+
...runWithMerge({
|
|
119916
|
+
ast,
|
|
119917
|
+
fix,
|
|
119918
|
+
shebang,
|
|
119919
|
+
template,
|
|
119920
|
+
pluginsTraverse,
|
|
119921
|
+
merge,
|
|
119922
|
+
}),
|
|
119923
|
+
];
|
|
119663
119924
|
|
|
119664
119925
|
function runWithMerge({ast, fix, shebang, template, pluginsTraverse, merge}) {
|
|
119665
119926
|
const {entries, visitor} = merge(pluginsTraverse, {
|
|
@@ -128190,11 +128451,11 @@ matchFiles.matchFiles = (options) => {
|
|
|
128190
128451
|
};
|
|
128191
128452
|
};
|
|
128192
128453
|
|
|
128193
|
-
function fix$1(inputFile, {dirPath,
|
|
128454
|
+
function fix$1(inputFile, {dirPath, matchInputFilename, outputFilename, matchedJS, matchedAST, options}) {
|
|
128194
128455
|
transform$1(matchedAST, matchedJS, options);
|
|
128195
128456
|
|
|
128196
128457
|
const matchedJSON = magicPrint(outputFilename, matchedAST);
|
|
128197
|
-
const outputFile = getOutputFile(
|
|
128458
|
+
const outputFile = getOutputFile({
|
|
128198
128459
|
dirPath,
|
|
128199
128460
|
matchInputFilename,
|
|
128200
128461
|
outputFilename,
|
|
@@ -128227,7 +128488,6 @@ const createScan = ({files, exclude}) => (mainPath, {push, progress, options}) =
|
|
|
128227
128488
|
continue;
|
|
128228
128489
|
|
|
128229
128490
|
allFiles.push({
|
|
128230
|
-
mainPath,
|
|
128231
128491
|
dirPath,
|
|
128232
128492
|
matchInputFilename,
|
|
128233
128493
|
rawOptions,
|
|
@@ -128248,7 +128508,6 @@ const createScan = ({files, exclude}) => (mainPath, {push, progress, options}) =
|
|
|
128248
128508
|
inputFilename,
|
|
128249
128509
|
outputFilename,
|
|
128250
128510
|
rawOptions,
|
|
128251
|
-
mainPath,
|
|
128252
128511
|
} = current;
|
|
128253
128512
|
|
|
128254
128513
|
progress({
|
|
@@ -128269,7 +128528,6 @@ const createScan = ({files, exclude}) => (mainPath, {push, progress, options}) =
|
|
|
128269
128528
|
|
|
128270
128529
|
push(inputFile, {
|
|
128271
128530
|
dirPath,
|
|
128272
|
-
mainPath,
|
|
128273
128531
|
matchInputFilename,
|
|
128274
128532
|
|
|
128275
128533
|
outputFilename,
|
|
@@ -128318,7 +128576,7 @@ function check$1(files) {
|
|
|
128318
128576
|
}
|
|
128319
128577
|
}
|
|
128320
128578
|
|
|
128321
|
-
function getOutputFile(
|
|
128579
|
+
function getOutputFile({dirPath, matchInputFilename, outputFilename, inputFile}) {
|
|
128322
128580
|
if (matchInputFilename === outputFilename)
|
|
128323
128581
|
return inputFile;
|
|
128324
128582
|
|