@putout/babel 1.5.5 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/index.d.ts +6 -1232
- package/bundle/index.js +588 -617
- package/package.json +8 -8
package/bundle/index.js
CHANGED
|
@@ -1019,7 +1019,7 @@ var require_browser = __commonJS({
|
|
|
1019
1019
|
exports.load = load;
|
|
1020
1020
|
exports.useColors = useColors;
|
|
1021
1021
|
exports.storage = localstorage();
|
|
1022
|
-
exports.destroy = (() => {
|
|
1022
|
+
exports.destroy = /* @__PURE__ */ (() => {
|
|
1023
1023
|
let warned = false;
|
|
1024
1024
|
return () => {
|
|
1025
1025
|
if (!warned) {
|
|
@@ -2584,6 +2584,30 @@ var require_globals = __commonJS({
|
|
|
2584
2584
|
XPathEvaluator: false,
|
|
2585
2585
|
XPathExpression: false,
|
|
2586
2586
|
XPathResult: false,
|
|
2587
|
+
XRAnchor: false,
|
|
2588
|
+
XRBoundedReferenceSpace: false,
|
|
2589
|
+
XRCPUDepthInformation: false,
|
|
2590
|
+
XRDepthInformation: false,
|
|
2591
|
+
XRFrame: false,
|
|
2592
|
+
XRInputSource: false,
|
|
2593
|
+
XRInputSourceArray: false,
|
|
2594
|
+
XRInputSourceEvent: false,
|
|
2595
|
+
XRInputSourcesChangeEvent: false,
|
|
2596
|
+
XRPose: false,
|
|
2597
|
+
XRReferenceSpace: false,
|
|
2598
|
+
XRReferenceSpaceEvent: false,
|
|
2599
|
+
XRRenderState: false,
|
|
2600
|
+
XRRigidTransform: false,
|
|
2601
|
+
XRSession: false,
|
|
2602
|
+
XRSessionEvent: false,
|
|
2603
|
+
XRSpace: false,
|
|
2604
|
+
XRSystem: false,
|
|
2605
|
+
XRView: false,
|
|
2606
|
+
XRViewerPose: false,
|
|
2607
|
+
XRViewport: false,
|
|
2608
|
+
XRWebGLBinding: false,
|
|
2609
|
+
XRWebGLDepthInformation: false,
|
|
2610
|
+
XRWebGLLayer: false,
|
|
2587
2611
|
XSLTProcessor: false
|
|
2588
2612
|
},
|
|
2589
2613
|
worker: {
|
|
@@ -4728,7 +4752,6 @@ __export(lib_exports, {
|
|
|
4728
4752
|
toExpression: () => toExpression,
|
|
4729
4753
|
toIdentifier: () => toIdentifier,
|
|
4730
4754
|
toKeyAlias: () => toKeyAlias,
|
|
4731
|
-
toSequenceExpression: () => toSequenceExpression,
|
|
4732
4755
|
toStatement: () => toStatement,
|
|
4733
4756
|
topicReference: () => topicReference,
|
|
4734
4757
|
traverse: () => traverse,
|
|
@@ -9908,7 +9931,7 @@ var classMethodOrPropertyCommon = () => ({
|
|
|
9908
9931
|
},
|
|
9909
9932
|
key: {
|
|
9910
9933
|
validate: chain(function() {
|
|
9911
|
-
const normal = assertNodeType("Identifier", "StringLiteral", "NumericLiteral");
|
|
9934
|
+
const normal = assertNodeType("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral");
|
|
9912
9935
|
const computed = assertNodeType("Expression");
|
|
9913
9936
|
return function(node, key, val) {
|
|
9914
9937
|
const validator = node.computed ? computed : normal;
|
|
@@ -11178,11 +11201,10 @@ var namedTypeElementCommon = () => ({
|
|
|
11178
11201
|
});
|
|
11179
11202
|
defineType("TSPropertySignature", {
|
|
11180
11203
|
aliases: ["TSTypeElement"],
|
|
11181
|
-
visitor: ["key", "typeAnnotation"
|
|
11204
|
+
visitor: ["key", "typeAnnotation"],
|
|
11182
11205
|
fields: Object.assign({}, namedTypeElementCommon(), {
|
|
11183
11206
|
readonly: validateOptional(bool),
|
|
11184
11207
|
typeAnnotation: validateOptionalType("TSTypeAnnotation"),
|
|
11185
|
-
initializer: validateOptionalType("Expression"),
|
|
11186
11208
|
kind: {
|
|
11187
11209
|
validate: assertOneOf("get", "set")
|
|
11188
11210
|
}
|
|
@@ -12963,12 +12985,11 @@ function tsConstructSignatureDeclaration(typeParameters = null, parameters, type
|
|
|
12963
12985
|
typeAnnotation: typeAnnotation2
|
|
12964
12986
|
});
|
|
12965
12987
|
}
|
|
12966
|
-
function tsPropertySignature(key, typeAnnotation2 = null
|
|
12988
|
+
function tsPropertySignature(key, typeAnnotation2 = null) {
|
|
12967
12989
|
return validateNode({
|
|
12968
12990
|
type: "TSPropertySignature",
|
|
12969
12991
|
key,
|
|
12970
12992
|
typeAnnotation: typeAnnotation2,
|
|
12971
|
-
initializer,
|
|
12972
12993
|
kind: null
|
|
12973
12994
|
});
|
|
12974
12995
|
}
|
|
@@ -14833,158 +14854,6 @@ toKeyAlias.increment = function() {
|
|
|
14833
14854
|
return toKeyAlias.uid++;
|
|
14834
14855
|
}
|
|
14835
14856
|
};
|
|
14836
|
-
function getBindingIdentifiers(node, duplicates, outerOnly) {
|
|
14837
|
-
const search = [].concat(node);
|
|
14838
|
-
const ids = /* @__PURE__ */ Object.create(null);
|
|
14839
|
-
while (search.length) {
|
|
14840
|
-
const id = search.shift();
|
|
14841
|
-
if (!id)
|
|
14842
|
-
continue;
|
|
14843
|
-
const keys = getBindingIdentifiers.keys[id.type];
|
|
14844
|
-
if (isIdentifier(id)) {
|
|
14845
|
-
if (duplicates) {
|
|
14846
|
-
const _ids = ids[id.name] = ids[id.name] || [];
|
|
14847
|
-
_ids.push(id);
|
|
14848
|
-
} else {
|
|
14849
|
-
ids[id.name] = id;
|
|
14850
|
-
}
|
|
14851
|
-
continue;
|
|
14852
|
-
}
|
|
14853
|
-
if (isExportDeclaration(id) && !isExportAllDeclaration(id)) {
|
|
14854
|
-
if (isDeclaration(id.declaration)) {
|
|
14855
|
-
search.push(id.declaration);
|
|
14856
|
-
}
|
|
14857
|
-
continue;
|
|
14858
|
-
}
|
|
14859
|
-
if (outerOnly) {
|
|
14860
|
-
if (isFunctionDeclaration(id)) {
|
|
14861
|
-
search.push(id.id);
|
|
14862
|
-
continue;
|
|
14863
|
-
}
|
|
14864
|
-
if (isFunctionExpression(id)) {
|
|
14865
|
-
continue;
|
|
14866
|
-
}
|
|
14867
|
-
}
|
|
14868
|
-
if (keys) {
|
|
14869
|
-
for (let i = 0; i < keys.length; i++) {
|
|
14870
|
-
const key = keys[i];
|
|
14871
|
-
const nodes2 = id[key];
|
|
14872
|
-
if (nodes2) {
|
|
14873
|
-
Array.isArray(nodes2) ? search.push(...nodes2) : search.push(nodes2);
|
|
14874
|
-
}
|
|
14875
|
-
}
|
|
14876
|
-
}
|
|
14877
|
-
}
|
|
14878
|
-
return ids;
|
|
14879
|
-
}
|
|
14880
|
-
getBindingIdentifiers.keys = {
|
|
14881
|
-
DeclareClass: ["id"],
|
|
14882
|
-
DeclareFunction: ["id"],
|
|
14883
|
-
DeclareModule: ["id"],
|
|
14884
|
-
DeclareVariable: ["id"],
|
|
14885
|
-
DeclareInterface: ["id"],
|
|
14886
|
-
DeclareTypeAlias: ["id"],
|
|
14887
|
-
DeclareOpaqueType: ["id"],
|
|
14888
|
-
InterfaceDeclaration: ["id"],
|
|
14889
|
-
TypeAlias: ["id"],
|
|
14890
|
-
OpaqueType: ["id"],
|
|
14891
|
-
CatchClause: ["param"],
|
|
14892
|
-
LabeledStatement: ["label"],
|
|
14893
|
-
UnaryExpression: ["argument"],
|
|
14894
|
-
AssignmentExpression: ["left"],
|
|
14895
|
-
ImportSpecifier: ["local"],
|
|
14896
|
-
ImportNamespaceSpecifier: ["local"],
|
|
14897
|
-
ImportDefaultSpecifier: ["local"],
|
|
14898
|
-
ImportDeclaration: ["specifiers"],
|
|
14899
|
-
ExportSpecifier: ["exported"],
|
|
14900
|
-
ExportNamespaceSpecifier: ["exported"],
|
|
14901
|
-
ExportDefaultSpecifier: ["exported"],
|
|
14902
|
-
FunctionDeclaration: ["id", "params"],
|
|
14903
|
-
FunctionExpression: ["id", "params"],
|
|
14904
|
-
ArrowFunctionExpression: ["params"],
|
|
14905
|
-
ObjectMethod: ["params"],
|
|
14906
|
-
ClassMethod: ["params"],
|
|
14907
|
-
ClassPrivateMethod: ["params"],
|
|
14908
|
-
ForInStatement: ["left"],
|
|
14909
|
-
ForOfStatement: ["left"],
|
|
14910
|
-
ClassDeclaration: ["id"],
|
|
14911
|
-
ClassExpression: ["id"],
|
|
14912
|
-
RestElement: ["argument"],
|
|
14913
|
-
UpdateExpression: ["argument"],
|
|
14914
|
-
ObjectProperty: ["value"],
|
|
14915
|
-
AssignmentPattern: ["left"],
|
|
14916
|
-
ArrayPattern: ["elements"],
|
|
14917
|
-
ObjectPattern: ["properties"],
|
|
14918
|
-
VariableDeclaration: ["declarations"],
|
|
14919
|
-
VariableDeclarator: ["id"]
|
|
14920
|
-
};
|
|
14921
|
-
function gatherSequenceExpressions(nodes2, scope2, declars) {
|
|
14922
|
-
const exprs = [];
|
|
14923
|
-
let ensureLastUndefined = true;
|
|
14924
|
-
for (const node of nodes2) {
|
|
14925
|
-
if (!isEmptyStatement(node)) {
|
|
14926
|
-
ensureLastUndefined = false;
|
|
14927
|
-
}
|
|
14928
|
-
if (isExpression(node)) {
|
|
14929
|
-
exprs.push(node);
|
|
14930
|
-
} else if (isExpressionStatement(node)) {
|
|
14931
|
-
exprs.push(node.expression);
|
|
14932
|
-
} else if (isVariableDeclaration(node)) {
|
|
14933
|
-
if (node.kind !== "var")
|
|
14934
|
-
return;
|
|
14935
|
-
for (const declar of node.declarations) {
|
|
14936
|
-
const bindings = getBindingIdentifiers(declar);
|
|
14937
|
-
for (const key of Object.keys(bindings)) {
|
|
14938
|
-
declars.push({
|
|
14939
|
-
kind: node.kind,
|
|
14940
|
-
id: cloneNode(bindings[key])
|
|
14941
|
-
});
|
|
14942
|
-
}
|
|
14943
|
-
if (declar.init) {
|
|
14944
|
-
exprs.push(assignmentExpression("=", declar.id, declar.init));
|
|
14945
|
-
}
|
|
14946
|
-
}
|
|
14947
|
-
ensureLastUndefined = true;
|
|
14948
|
-
} else if (isIfStatement(node)) {
|
|
14949
|
-
const consequent = node.consequent ? gatherSequenceExpressions([node.consequent], scope2, declars) : scope2.buildUndefinedNode();
|
|
14950
|
-
const alternate = node.alternate ? gatherSequenceExpressions([node.alternate], scope2, declars) : scope2.buildUndefinedNode();
|
|
14951
|
-
if (!consequent || !alternate)
|
|
14952
|
-
return;
|
|
14953
|
-
exprs.push(conditionalExpression(node.test, consequent, alternate));
|
|
14954
|
-
} else if (isBlockStatement(node)) {
|
|
14955
|
-
const body = gatherSequenceExpressions(node.body, scope2, declars);
|
|
14956
|
-
if (!body)
|
|
14957
|
-
return;
|
|
14958
|
-
exprs.push(body);
|
|
14959
|
-
} else if (isEmptyStatement(node)) {
|
|
14960
|
-
if (nodes2.indexOf(node) === 0) {
|
|
14961
|
-
ensureLastUndefined = true;
|
|
14962
|
-
}
|
|
14963
|
-
} else {
|
|
14964
|
-
return;
|
|
14965
|
-
}
|
|
14966
|
-
}
|
|
14967
|
-
if (ensureLastUndefined) {
|
|
14968
|
-
exprs.push(scope2.buildUndefinedNode());
|
|
14969
|
-
}
|
|
14970
|
-
if (exprs.length === 1) {
|
|
14971
|
-
return exprs[0];
|
|
14972
|
-
} else {
|
|
14973
|
-
return sequenceExpression(exprs);
|
|
14974
|
-
}
|
|
14975
|
-
}
|
|
14976
|
-
function toSequenceExpression(nodes2, scope2) {
|
|
14977
|
-
if (!(nodes2 == null ? void 0 : nodes2.length))
|
|
14978
|
-
return;
|
|
14979
|
-
const declars = [];
|
|
14980
|
-
const result = gatherSequenceExpressions(nodes2, scope2, declars);
|
|
14981
|
-
if (!result)
|
|
14982
|
-
return;
|
|
14983
|
-
for (const declar of declars) {
|
|
14984
|
-
scope2.push(declar);
|
|
14985
|
-
}
|
|
14986
|
-
return result;
|
|
14987
|
-
}
|
|
14988
14857
|
function toStatement(node, ignore) {
|
|
14989
14858
|
if (isStatement(node)) {
|
|
14990
14859
|
return node;
|
|
@@ -15110,6 +14979,94 @@ function prependToMemberExpression(member, prepend) {
|
|
|
15110
14979
|
member.object = memberExpression(prepend, member.object);
|
|
15111
14980
|
return member;
|
|
15112
14981
|
}
|
|
14982
|
+
function getBindingIdentifiers(node, duplicates, outerOnly, newBindingsOnly) {
|
|
14983
|
+
const search = [].concat(node);
|
|
14984
|
+
const ids = /* @__PURE__ */ Object.create(null);
|
|
14985
|
+
while (search.length) {
|
|
14986
|
+
const id = search.shift();
|
|
14987
|
+
if (!id)
|
|
14988
|
+
continue;
|
|
14989
|
+
if (newBindingsOnly && (isAssignmentExpression(id) || isUnaryExpression(id))) {
|
|
14990
|
+
continue;
|
|
14991
|
+
}
|
|
14992
|
+
const keys = getBindingIdentifiers.keys[id.type];
|
|
14993
|
+
if (isIdentifier(id)) {
|
|
14994
|
+
if (duplicates) {
|
|
14995
|
+
const _ids = ids[id.name] = ids[id.name] || [];
|
|
14996
|
+
_ids.push(id);
|
|
14997
|
+
} else {
|
|
14998
|
+
ids[id.name] = id;
|
|
14999
|
+
}
|
|
15000
|
+
continue;
|
|
15001
|
+
}
|
|
15002
|
+
if (isExportDeclaration(id) && !isExportAllDeclaration(id)) {
|
|
15003
|
+
if (isDeclaration(id.declaration)) {
|
|
15004
|
+
search.push(id.declaration);
|
|
15005
|
+
}
|
|
15006
|
+
continue;
|
|
15007
|
+
}
|
|
15008
|
+
if (outerOnly) {
|
|
15009
|
+
if (isFunctionDeclaration(id)) {
|
|
15010
|
+
search.push(id.id);
|
|
15011
|
+
continue;
|
|
15012
|
+
}
|
|
15013
|
+
if (isFunctionExpression(id)) {
|
|
15014
|
+
continue;
|
|
15015
|
+
}
|
|
15016
|
+
}
|
|
15017
|
+
if (keys) {
|
|
15018
|
+
for (let i = 0; i < keys.length; i++) {
|
|
15019
|
+
const key = keys[i];
|
|
15020
|
+
const nodes2 = id[key];
|
|
15021
|
+
if (nodes2) {
|
|
15022
|
+
Array.isArray(nodes2) ? search.push(...nodes2) : search.push(nodes2);
|
|
15023
|
+
}
|
|
15024
|
+
}
|
|
15025
|
+
}
|
|
15026
|
+
}
|
|
15027
|
+
return ids;
|
|
15028
|
+
}
|
|
15029
|
+
getBindingIdentifiers.keys = {
|
|
15030
|
+
DeclareClass: ["id"],
|
|
15031
|
+
DeclareFunction: ["id"],
|
|
15032
|
+
DeclareModule: ["id"],
|
|
15033
|
+
DeclareVariable: ["id"],
|
|
15034
|
+
DeclareInterface: ["id"],
|
|
15035
|
+
DeclareTypeAlias: ["id"],
|
|
15036
|
+
DeclareOpaqueType: ["id"],
|
|
15037
|
+
InterfaceDeclaration: ["id"],
|
|
15038
|
+
TypeAlias: ["id"],
|
|
15039
|
+
OpaqueType: ["id"],
|
|
15040
|
+
CatchClause: ["param"],
|
|
15041
|
+
LabeledStatement: ["label"],
|
|
15042
|
+
UnaryExpression: ["argument"],
|
|
15043
|
+
AssignmentExpression: ["left"],
|
|
15044
|
+
ImportSpecifier: ["local"],
|
|
15045
|
+
ImportNamespaceSpecifier: ["local"],
|
|
15046
|
+
ImportDefaultSpecifier: ["local"],
|
|
15047
|
+
ImportDeclaration: ["specifiers"],
|
|
15048
|
+
ExportSpecifier: ["exported"],
|
|
15049
|
+
ExportNamespaceSpecifier: ["exported"],
|
|
15050
|
+
ExportDefaultSpecifier: ["exported"],
|
|
15051
|
+
FunctionDeclaration: ["id", "params"],
|
|
15052
|
+
FunctionExpression: ["id", "params"],
|
|
15053
|
+
ArrowFunctionExpression: ["params"],
|
|
15054
|
+
ObjectMethod: ["params"],
|
|
15055
|
+
ClassMethod: ["params"],
|
|
15056
|
+
ClassPrivateMethod: ["params"],
|
|
15057
|
+
ForInStatement: ["left"],
|
|
15058
|
+
ForOfStatement: ["left"],
|
|
15059
|
+
ClassDeclaration: ["id"],
|
|
15060
|
+
ClassExpression: ["id"],
|
|
15061
|
+
RestElement: ["argument"],
|
|
15062
|
+
UpdateExpression: ["argument"],
|
|
15063
|
+
ObjectProperty: ["value"],
|
|
15064
|
+
AssignmentPattern: ["left"],
|
|
15065
|
+
ArrayPattern: ["elements"],
|
|
15066
|
+
ObjectPattern: ["properties"],
|
|
15067
|
+
VariableDeclaration: ["declarations"],
|
|
15068
|
+
VariableDeclarator: ["id"]
|
|
15069
|
+
};
|
|
15113
15070
|
function getOuterBindingIdentifiers(node, duplicates) {
|
|
15114
15071
|
return getBindingIdentifiers(node, duplicates, true);
|
|
15115
15072
|
}
|
|
@@ -18822,11 +18779,6 @@ function newAsyncArrowScope() {
|
|
|
18822
18779
|
function newExpressionScope() {
|
|
18823
18780
|
return new ExpressionScope();
|
|
18824
18781
|
}
|
|
18825
|
-
var PARAM = 0;
|
|
18826
|
-
var PARAM_YIELD = 1;
|
|
18827
|
-
var PARAM_AWAIT = 2;
|
|
18828
|
-
var PARAM_RETURN = 4;
|
|
18829
|
-
var PARAM_IN = 8;
|
|
18830
18782
|
var ProductionParameterHandler = class {
|
|
18831
18783
|
stacks = [];
|
|
18832
18784
|
enter(flags) {
|
|
@@ -18839,20 +18791,20 @@ var ProductionParameterHandler = class {
|
|
|
18839
18791
|
return this.stacks[this.stacks.length - 1];
|
|
18840
18792
|
}
|
|
18841
18793
|
get hasAwait() {
|
|
18842
|
-
return (this.currentFlags() &
|
|
18794
|
+
return (this.currentFlags() & 2) > 0;
|
|
18843
18795
|
}
|
|
18844
18796
|
get hasYield() {
|
|
18845
|
-
return (this.currentFlags() &
|
|
18797
|
+
return (this.currentFlags() & 1) > 0;
|
|
18846
18798
|
}
|
|
18847
18799
|
get hasReturn() {
|
|
18848
|
-
return (this.currentFlags() &
|
|
18800
|
+
return (this.currentFlags() & 4) > 0;
|
|
18849
18801
|
}
|
|
18850
18802
|
get hasIn() {
|
|
18851
|
-
return (this.currentFlags() &
|
|
18803
|
+
return (this.currentFlags() & 8) > 0;
|
|
18852
18804
|
}
|
|
18853
18805
|
};
|
|
18854
18806
|
function functionFlags(isAsync, isGenerator) {
|
|
18855
|
-
return (isAsync ?
|
|
18807
|
+
return (isAsync ? 2 : 0) | (isGenerator ? 1 : 0);
|
|
18856
18808
|
}
|
|
18857
18809
|
var UtilParser = class extends Tokenizer {
|
|
18858
18810
|
addExtra(node, key, value, enumerable = true) {
|
|
@@ -19052,9 +19004,9 @@ var UtilParser = class extends Tokenizer {
|
|
|
19052
19004
|
};
|
|
19053
19005
|
}
|
|
19054
19006
|
enterInitialScopes() {
|
|
19055
|
-
let paramFlags =
|
|
19007
|
+
let paramFlags = 0;
|
|
19056
19008
|
if (this.inModule) {
|
|
19057
|
-
paramFlags |=
|
|
19009
|
+
paramFlags |= 2;
|
|
19058
19010
|
}
|
|
19059
19011
|
this.scope.enter(1);
|
|
19060
19012
|
this.prodParam.enter(paramFlags);
|
|
@@ -19553,9 +19505,9 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
19553
19505
|
this.flowParseInterfaceish(node, false);
|
|
19554
19506
|
return this.finishNode(node, "DeclareInterface");
|
|
19555
19507
|
}
|
|
19556
|
-
flowParseInterfaceish(node,
|
|
19557
|
-
node.id = this.flowParseRestrictedIdentifier(!
|
|
19558
|
-
this.scope.declareName(node.id.name,
|
|
19508
|
+
flowParseInterfaceish(node, isClass3) {
|
|
19509
|
+
node.id = this.flowParseRestrictedIdentifier(!isClass3, true);
|
|
19510
|
+
this.scope.declareName(node.id.name, isClass3 ? 17 : 8201, node.id.loc.start);
|
|
19559
19511
|
if (this.match(47)) {
|
|
19560
19512
|
node.typeParameters = this.flowParseTypeParameterDeclaration();
|
|
19561
19513
|
} else {
|
|
@@ -19565,9 +19517,9 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
19565
19517
|
if (this.eat(81)) {
|
|
19566
19518
|
do {
|
|
19567
19519
|
node.extends.push(this.flowParseInterfaceExtends());
|
|
19568
|
-
} while (!
|
|
19520
|
+
} while (!isClass3 && this.eat(12));
|
|
19569
19521
|
}
|
|
19570
|
-
if (
|
|
19522
|
+
if (isClass3) {
|
|
19571
19523
|
node.implements = [];
|
|
19572
19524
|
node.mixins = [];
|
|
19573
19525
|
if (this.eatContextual(117)) {
|
|
@@ -19582,10 +19534,10 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
19582
19534
|
}
|
|
19583
19535
|
}
|
|
19584
19536
|
node.body = this.flowParseObjectType({
|
|
19585
|
-
allowStatic:
|
|
19537
|
+
allowStatic: isClass3,
|
|
19586
19538
|
allowExact: false,
|
|
19587
19539
|
allowSpread: false,
|
|
19588
|
-
allowProto:
|
|
19540
|
+
allowProto: isClass3,
|
|
19589
19541
|
allowInexact: false
|
|
19590
19542
|
});
|
|
19591
19543
|
}
|
|
@@ -24130,7 +24082,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
24130
24082
|
node.body = inner;
|
|
24131
24083
|
} else {
|
|
24132
24084
|
this.scope.enter(256);
|
|
24133
|
-
this.prodParam.enter(
|
|
24085
|
+
this.prodParam.enter(0);
|
|
24134
24086
|
node.body = this.tsParseModuleBlock();
|
|
24135
24087
|
this.prodParam.exit();
|
|
24136
24088
|
this.scope.exit();
|
|
@@ -24148,7 +24100,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
24148
24100
|
}
|
|
24149
24101
|
if (this.match(5)) {
|
|
24150
24102
|
this.scope.enter(256);
|
|
24151
|
-
this.prodParam.enter(
|
|
24103
|
+
this.prodParam.enter(0);
|
|
24152
24104
|
node.body = this.tsParseModuleBlock();
|
|
24153
24105
|
this.prodParam.exit();
|
|
24154
24106
|
this.scope.exit();
|
|
@@ -24276,7 +24228,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
24276
24228
|
case "global":
|
|
24277
24229
|
if (this.match(5)) {
|
|
24278
24230
|
this.scope.enter(256);
|
|
24279
|
-
this.prodParam.enter(
|
|
24231
|
+
this.prodParam.enter(0);
|
|
24280
24232
|
const mod = node;
|
|
24281
24233
|
mod.global = true;
|
|
24282
24234
|
mod.id = expr;
|
|
@@ -25896,7 +25848,7 @@ var defaultOptions = {
|
|
|
25896
25848
|
strictMode: null,
|
|
25897
25849
|
ranges: false,
|
|
25898
25850
|
tokens: false,
|
|
25899
|
-
createImportExpressions:
|
|
25851
|
+
createImportExpressions: true,
|
|
25900
25852
|
createParenthesizedExpressions: false,
|
|
25901
25853
|
errorRecovery: false,
|
|
25902
25854
|
attachComment: true,
|
|
@@ -26738,7 +26690,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
26738
26690
|
const oldLabels = this.state.labels;
|
|
26739
26691
|
this.state.labels = [];
|
|
26740
26692
|
if (isAsync) {
|
|
26741
|
-
this.prodParam.enter(
|
|
26693
|
+
this.prodParam.enter(2);
|
|
26742
26694
|
node.body = this.parseBlock();
|
|
26743
26695
|
this.prodParam.exit();
|
|
26744
26696
|
} else {
|
|
@@ -27307,7 +27259,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
27307
27259
|
this.scope.enter(2 | 4);
|
|
27308
27260
|
let flags = functionFlags(isAsync, false);
|
|
27309
27261
|
if (!this.match(5) && this.prodParam.hasIn) {
|
|
27310
|
-
flags |=
|
|
27262
|
+
flags |= 8;
|
|
27311
27263
|
}
|
|
27312
27264
|
this.prodParam.enter(flags);
|
|
27313
27265
|
this.initFunction(node, isAsync);
|
|
@@ -27341,7 +27293,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
27341
27293
|
const oldStrict = this.state.strict;
|
|
27342
27294
|
const oldLabels = this.state.labels;
|
|
27343
27295
|
this.state.labels = [];
|
|
27344
|
-
this.prodParam.enter(this.prodParam.currentFlags() |
|
|
27296
|
+
this.prodParam.enter(this.prodParam.currentFlags() | 4);
|
|
27345
27297
|
node.body = this.parseBlock(true, false, (hasStrictModeDirective) => {
|
|
27346
27298
|
const nonSimple = !this.isSimpleParamList(node.params);
|
|
27347
27299
|
if (hasStrictModeDirective && nonSimple) {
|
|
@@ -27686,9 +27638,9 @@ var ExpressionParser = class extends LValParser {
|
|
|
27686
27638
|
}
|
|
27687
27639
|
allowInAnd(callback) {
|
|
27688
27640
|
const flags = this.prodParam.currentFlags();
|
|
27689
|
-
const prodParamToSet =
|
|
27641
|
+
const prodParamToSet = 8 & ~flags;
|
|
27690
27642
|
if (prodParamToSet) {
|
|
27691
|
-
this.prodParam.enter(flags |
|
|
27643
|
+
this.prodParam.enter(flags | 8);
|
|
27692
27644
|
try {
|
|
27693
27645
|
return callback();
|
|
27694
27646
|
} finally {
|
|
@@ -27699,9 +27651,9 @@ var ExpressionParser = class extends LValParser {
|
|
|
27699
27651
|
}
|
|
27700
27652
|
disallowInAnd(callback) {
|
|
27701
27653
|
const flags = this.prodParam.currentFlags();
|
|
27702
|
-
const prodParamToClear =
|
|
27654
|
+
const prodParamToClear = 8 & flags;
|
|
27703
27655
|
if (prodParamToClear) {
|
|
27704
|
-
this.prodParam.enter(flags & ~
|
|
27656
|
+
this.prodParam.enter(flags & ~8);
|
|
27705
27657
|
try {
|
|
27706
27658
|
return callback();
|
|
27707
27659
|
} finally {
|
|
@@ -28904,7 +28856,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
28904
28856
|
this.scope.enter(64 | 128 | 16);
|
|
28905
28857
|
const oldLabels = this.state.labels;
|
|
28906
28858
|
this.state.labels = [];
|
|
28907
|
-
this.prodParam.enter(
|
|
28859
|
+
this.prodParam.enter(0);
|
|
28908
28860
|
const body = member.body = [];
|
|
28909
28861
|
this.parseBlockOrModuleBlockBody(body, void 0, false, 8);
|
|
28910
28862
|
this.prodParam.exit();
|
|
@@ -28977,7 +28929,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
28977
28929
|
parseInitializer(node) {
|
|
28978
28930
|
this.scope.enter(64 | 16);
|
|
28979
28931
|
this.expressionScope.enter(newExpressionScope());
|
|
28980
|
-
this.prodParam.enter(
|
|
28932
|
+
this.prodParam.enter(0);
|
|
28981
28933
|
node.value = this.eat(29) ? this.parseMaybeAssignAllowIn() : null;
|
|
28982
28934
|
this.expressionScope.exit();
|
|
28983
28935
|
this.prodParam.exit();
|
|
@@ -32527,8 +32479,12 @@ var SourceMap = class {
|
|
|
32527
32479
|
}
|
|
32528
32480
|
};
|
|
32529
32481
|
var Buffer2 = class {
|
|
32530
|
-
constructor(map) {
|
|
32482
|
+
constructor(map, indentChar) {
|
|
32531
32483
|
this._map = map;
|
|
32484
|
+
this._indentChar = indentChar;
|
|
32485
|
+
for (let i = 0; i < 64; i++) {
|
|
32486
|
+
this._fastIndentations.push(indentChar.repeat(i));
|
|
32487
|
+
}
|
|
32532
32488
|
this._allocQueue();
|
|
32533
32489
|
}
|
|
32534
32490
|
_map = null;
|
|
@@ -32539,6 +32495,8 @@ var Buffer2 = class {
|
|
|
32539
32495
|
_queue = [];
|
|
32540
32496
|
_queueCursor = 0;
|
|
32541
32497
|
_canMarkIdName = true;
|
|
32498
|
+
_indentChar = "";
|
|
32499
|
+
_fastIndentations = [];
|
|
32542
32500
|
_position = {
|
|
32543
32501
|
line: 1,
|
|
32544
32502
|
column: 0
|
|
@@ -32638,8 +32596,10 @@ var Buffer2 = class {
|
|
|
32638
32596
|
const sourcePosition = this._sourcePosition;
|
|
32639
32597
|
this._pushQueue(char, 1, sourcePosition.line, sourcePosition.column, sourcePosition.filename);
|
|
32640
32598
|
}
|
|
32641
|
-
queueIndentation(
|
|
32642
|
-
|
|
32599
|
+
queueIndentation(repeat) {
|
|
32600
|
+
if (repeat === 0)
|
|
32601
|
+
return;
|
|
32602
|
+
this._pushQueue(-1, repeat, void 0, void 0, void 0);
|
|
32643
32603
|
}
|
|
32644
32604
|
_flush() {
|
|
32645
32605
|
const queueCursor = this._queueCursor;
|
|
@@ -32652,7 +32612,16 @@ var Buffer2 = class {
|
|
|
32652
32612
|
}
|
|
32653
32613
|
_appendChar(char, repeat, sourcePos) {
|
|
32654
32614
|
this._last = char;
|
|
32655
|
-
|
|
32615
|
+
if (char === -1) {
|
|
32616
|
+
const fastIndentation = this._fastIndentations[repeat];
|
|
32617
|
+
if (fastIndentation !== void 0) {
|
|
32618
|
+
this._str += fastIndentation;
|
|
32619
|
+
} else {
|
|
32620
|
+
this._str += repeat > 1 ? this._indentChar.repeat(repeat) : this._indentChar;
|
|
32621
|
+
}
|
|
32622
|
+
} else {
|
|
32623
|
+
this._str += repeat > 1 ? String.fromCharCode(char).repeat(repeat) : String.fromCharCode(char);
|
|
32624
|
+
}
|
|
32656
32625
|
if (char !== 10) {
|
|
32657
32626
|
this._mark(sourcePos.line, sourcePos.column, sourcePos.identifierName, sourcePos.identifierNamePos, sourcePos.filename);
|
|
32658
32627
|
this._position.column += repeat;
|
|
@@ -32831,8 +32800,8 @@ var Buffer2 = class {
|
|
|
32831
32800
|
var {
|
|
32832
32801
|
FLIPPED_ALIAS_KEYS: FLIPPED_ALIAS_KEYS$1,
|
|
32833
32802
|
isArrayExpression: isArrayExpression2,
|
|
32834
|
-
isAssignmentExpression:
|
|
32835
|
-
isBinary:
|
|
32803
|
+
isAssignmentExpression: isAssignmentExpression2,
|
|
32804
|
+
isBinary: isBinary2,
|
|
32836
32805
|
isBlockStatement: isBlockStatement2,
|
|
32837
32806
|
isCallExpression: isCallExpression$3,
|
|
32838
32807
|
isFunction: isFunction$1,
|
|
@@ -32840,7 +32809,7 @@ var {
|
|
|
32840
32809
|
isLiteral: isLiteral$1,
|
|
32841
32810
|
isMemberExpression: isMemberExpression$3,
|
|
32842
32811
|
isObjectExpression: isObjectExpression2,
|
|
32843
|
-
isOptionalCallExpression:
|
|
32812
|
+
isOptionalCallExpression: isOptionalCallExpression2,
|
|
32844
32813
|
isOptionalMemberExpression: isOptionalMemberExpression$1,
|
|
32845
32814
|
isStringLiteral: isStringLiteral3
|
|
32846
32815
|
} = lib_exports;
|
|
@@ -32851,10 +32820,10 @@ function crawlInternal(node, state) {
|
|
|
32851
32820
|
crawlInternal(node.object, state);
|
|
32852
32821
|
if (node.computed)
|
|
32853
32822
|
crawlInternal(node.property, state);
|
|
32854
|
-
} else if (
|
|
32823
|
+
} else if (isBinary2(node) || isAssignmentExpression2(node)) {
|
|
32855
32824
|
crawlInternal(node.left, state);
|
|
32856
32825
|
crawlInternal(node.right, state);
|
|
32857
|
-
} else if (isCallExpression$3(node) ||
|
|
32826
|
+
} else if (isCallExpression$3(node) || isOptionalCallExpression2(node)) {
|
|
32858
32827
|
state.hasCall = true;
|
|
32859
32828
|
crawlInternal(node.callee, state);
|
|
32860
32829
|
} else if (isFunction$1(node)) {
|
|
@@ -32880,7 +32849,7 @@ function isHelper(node) {
|
|
|
32880
32849
|
return node.name === "require" || node.name.charCodeAt(0) === 95;
|
|
32881
32850
|
} else if (isCallExpression$3(node)) {
|
|
32882
32851
|
return isHelper(node.callee);
|
|
32883
|
-
} else if (
|
|
32852
|
+
} else if (isBinary2(node) || isAssignmentExpression2(node)) {
|
|
32884
32853
|
return isIdentifier$2(node.left) && isHelper(node.left) || isHelper(node.right);
|
|
32885
32854
|
} else {
|
|
32886
32855
|
return false;
|
|
@@ -32970,98 +32939,36 @@ nodes.ObjectTypeInternalSlot = function(node, parent) {
|
|
|
32970
32939
|
var {
|
|
32971
32940
|
isArrayTypeAnnotation: isArrayTypeAnnotation2,
|
|
32972
32941
|
isArrowFunctionExpression: isArrowFunctionExpression2,
|
|
32973
|
-
isAssignmentExpression: isAssignmentExpression2,
|
|
32974
|
-
isAwaitExpression: isAwaitExpression2,
|
|
32975
|
-
isBinary: isBinary2,
|
|
32976
32942
|
isBinaryExpression: isBinaryExpression2,
|
|
32977
|
-
isUpdateExpression: isUpdateExpression2,
|
|
32978
32943
|
isCallExpression: isCallExpression$2,
|
|
32979
|
-
isClass: isClass2,
|
|
32980
|
-
isClassExpression: isClassExpression2,
|
|
32981
|
-
isConditional: isConditional2,
|
|
32982
|
-
isConditionalExpression: isConditionalExpression2,
|
|
32983
32944
|
isExportDeclaration: isExportDeclaration2,
|
|
32984
|
-
isExportDefaultDeclaration: isExportDefaultDeclaration$1,
|
|
32985
|
-
isExpressionStatement: isExpressionStatement$1,
|
|
32986
|
-
isFor: isFor$1,
|
|
32987
|
-
isForInStatement: isForInStatement2,
|
|
32988
32945
|
isForOfStatement: isForOfStatement2,
|
|
32989
|
-
isForStatement: isForStatement$1,
|
|
32990
|
-
isFunctionExpression: isFunctionExpression2,
|
|
32991
|
-
isIfStatement: isIfStatement$1,
|
|
32992
32946
|
isIndexedAccessType: isIndexedAccessType2,
|
|
32993
|
-
isIntersectionTypeAnnotation: isIntersectionTypeAnnotation2,
|
|
32994
|
-
isLogicalExpression: isLogicalExpression2,
|
|
32995
32947
|
isMemberExpression: isMemberExpression$2,
|
|
32996
|
-
isNewExpression: isNewExpression$2,
|
|
32997
|
-
isNullableTypeAnnotation: isNullableTypeAnnotation2,
|
|
32998
32948
|
isObjectPattern: isObjectPattern2,
|
|
32999
|
-
isOptionalCallExpression: isOptionalCallExpression2,
|
|
33000
32949
|
isOptionalMemberExpression: isOptionalMemberExpression2,
|
|
33001
|
-
|
|
33002
|
-
isSequenceExpression: isSequenceExpression2,
|
|
33003
|
-
isSwitchStatement: isSwitchStatement2,
|
|
33004
|
-
isTSArrayType: isTSArrayType2,
|
|
33005
|
-
isTSAsExpression: isTSAsExpression2,
|
|
33006
|
-
isTSInstantiationExpression: isTSInstantiationExpression2,
|
|
33007
|
-
isTSIntersectionType: isTSIntersectionType2,
|
|
33008
|
-
isTSNonNullExpression: isTSNonNullExpression2,
|
|
33009
|
-
isTSOptionalType: isTSOptionalType2,
|
|
33010
|
-
isTSRestType: isTSRestType2,
|
|
33011
|
-
isTSTypeAssertion: isTSTypeAssertion2,
|
|
33012
|
-
isTSUnionType: isTSUnionType2,
|
|
33013
|
-
isTaggedTemplateExpression: isTaggedTemplateExpression2,
|
|
33014
|
-
isThrowStatement: isThrowStatement2,
|
|
33015
|
-
isTypeAnnotation: isTypeAnnotation2,
|
|
33016
|
-
isUnaryLike: isUnaryLike2,
|
|
33017
|
-
isUnionTypeAnnotation: isUnionTypeAnnotation2,
|
|
33018
|
-
isVariableDeclarator: isVariableDeclarator2,
|
|
33019
|
-
isWhileStatement: isWhileStatement2,
|
|
33020
|
-
isYieldExpression: isYieldExpression2,
|
|
33021
|
-
isTSSatisfiesExpression: isTSSatisfiesExpression2
|
|
32950
|
+
isYieldExpression: isYieldExpression2
|
|
33022
32951
|
} = lib_exports;
|
|
33023
|
-
var PRECEDENCE =
|
|
33024
|
-
|
|
33025
|
-
"
|
|
33026
|
-
"|>": 0,
|
|
33027
|
-
"&&": 1,
|
|
33028
|
-
"|": 2,
|
|
33029
|
-
"^": 3,
|
|
33030
|
-
"&": 4,
|
|
33031
|
-
"==": 5,
|
|
33032
|
-
"===": 5,
|
|
33033
|
-
"!=": 5,
|
|
33034
|
-
"!==": 5,
|
|
33035
|
-
"<": 6,
|
|
33036
|
-
">": 6,
|
|
33037
|
-
"<=": 6,
|
|
33038
|
-
">=": 6,
|
|
33039
|
-
in: 6,
|
|
33040
|
-
instanceof: 6,
|
|
33041
|
-
">>": 7,
|
|
33042
|
-
"<<": 7,
|
|
33043
|
-
">>>": 7,
|
|
33044
|
-
"+": 8,
|
|
33045
|
-
"-": 8,
|
|
33046
|
-
"*": 9,
|
|
33047
|
-
"/": 9,
|
|
33048
|
-
"%": 9,
|
|
33049
|
-
"**": 10
|
|
33050
|
-
};
|
|
33051
|
-
function isTSTypeExpression(node) {
|
|
33052
|
-
return isTSAsExpression2(node) || isTSSatisfiesExpression2(node) || isTSTypeAssertion2(node);
|
|
32952
|
+
var PRECEDENCE = /* @__PURE__ */ new Map([["||", 0], ["??", 0], ["|>", 0], ["&&", 1], ["|", 2], ["^", 3], ["&", 4], ["==", 5], ["===", 5], ["!=", 5], ["!==", 5], ["<", 6], [">", 6], ["<=", 6], [">=", 6], ["in", 6], ["instanceof", 6], [">>", 7], ["<<", 7], [">>>", 7], ["+", 8], ["-", 8], ["*", 9], ["/", 9], ["%", 9], ["**", 10]]);
|
|
32953
|
+
function isTSTypeExpression(nodeType) {
|
|
32954
|
+
return nodeType === "TSAsExpression" || nodeType === "TSSatisfiesExpression" || nodeType === "TSTypeAssertion";
|
|
33053
32955
|
}
|
|
33054
|
-
var isClassExtendsClause = (node, parent) =>
|
|
33055
|
-
|
|
33056
|
-
|
|
33057
|
-
|
|
32956
|
+
var isClassExtendsClause = (node, parent) => {
|
|
32957
|
+
const parentType = parent.type;
|
|
32958
|
+
return (parentType === "ClassDeclaration" || parentType === "ClassExpression") && parent.superClass === node;
|
|
32959
|
+
};
|
|
32960
|
+
var hasPostfixPart = (node, parent) => {
|
|
32961
|
+
const parentType = parent.type;
|
|
32962
|
+
return (parentType === "MemberExpression" || parentType === "OptionalMemberExpression") && parent.object === node || (parentType === "CallExpression" || parentType === "OptionalCallExpression" || parentType === "NewExpression") && parent.callee === node || parentType === "TaggedTemplateExpression" && parent.tag === node || parentType === "TSNonNullExpression";
|
|
32963
|
+
};
|
|
33058
32964
|
function NullableTypeAnnotation$1(node, parent) {
|
|
33059
32965
|
return isArrayTypeAnnotation2(parent);
|
|
33060
32966
|
}
|
|
33061
32967
|
function FunctionTypeAnnotation$1(node, parent, printStack) {
|
|
33062
32968
|
if (printStack.length < 3)
|
|
33063
32969
|
return;
|
|
33064
|
-
|
|
32970
|
+
const parentType = parent.type;
|
|
32971
|
+
return parentType === "UnionTypeAnnotation" || parentType === "IntersectionTypeAnnotation" || parentType === "ArrayTypeAnnotation" || parentType === "TypeAnnotation" && isArrowFunctionExpression2(printStack[printStack.length - 3]);
|
|
33065
32972
|
}
|
|
33066
32973
|
function UpdateExpression$1(node, parent) {
|
|
33067
32974
|
return hasPostfixPart(node, parent) || isClassExtendsClause(node, parent);
|
|
@@ -33073,67 +32980,70 @@ function DoExpression$1(node, parent, printStack) {
|
|
|
33073
32980
|
return !node.async && isFirstInContext(printStack, 1);
|
|
33074
32981
|
}
|
|
33075
32982
|
function Binary(node, parent) {
|
|
33076
|
-
|
|
33077
|
-
|
|
33078
|
-
})) {
|
|
32983
|
+
const parentType = parent.type;
|
|
32984
|
+
if (node.operator === "**" && parentType === "BinaryExpression" && parent.operator === "**") {
|
|
33079
32985
|
return parent.left === node;
|
|
33080
32986
|
}
|
|
33081
32987
|
if (isClassExtendsClause(node, parent)) {
|
|
33082
32988
|
return true;
|
|
33083
32989
|
}
|
|
33084
|
-
if (hasPostfixPart(node, parent) ||
|
|
32990
|
+
if (hasPostfixPart(node, parent) || parentType === "UnaryExpression" || parentType === "SpreadElement" || parentType === "AwaitExpression") {
|
|
33085
32991
|
return true;
|
|
33086
32992
|
}
|
|
33087
|
-
if (
|
|
33088
|
-
const
|
|
33089
|
-
const
|
|
33090
|
-
|
|
33091
|
-
const nodePos = PRECEDENCE[nodeOp];
|
|
33092
|
-
if (parentPos === nodePos && parent.right === node && !isLogicalExpression2(parent) || parentPos > nodePos) {
|
|
32993
|
+
if (parentType === "BinaryExpression" || parentType === "LogicalExpression") {
|
|
32994
|
+
const parentPos = PRECEDENCE.get(parent.operator);
|
|
32995
|
+
const nodePos = PRECEDENCE.get(node.operator);
|
|
32996
|
+
if (parentPos === nodePos && parent.right === node && parentType !== "LogicalExpression" || parentPos > nodePos) {
|
|
33093
32997
|
return true;
|
|
33094
32998
|
}
|
|
33095
32999
|
}
|
|
33000
|
+
return void 0;
|
|
33096
33001
|
}
|
|
33097
33002
|
function UnionTypeAnnotation$1(node, parent) {
|
|
33098
|
-
|
|
33003
|
+
const parentType = parent.type;
|
|
33004
|
+
return parentType === "ArrayTypeAnnotation" || parentType === "NullableTypeAnnotation" || parentType === "IntersectionTypeAnnotation" || parentType === "UnionTypeAnnotation";
|
|
33099
33005
|
}
|
|
33100
33006
|
function OptionalIndexedAccessType$1(node, parent) {
|
|
33101
|
-
return isIndexedAccessType2(parent
|
|
33102
|
-
objectType: node
|
|
33103
|
-
});
|
|
33007
|
+
return isIndexedAccessType2(parent) && parent.objectType === node;
|
|
33104
33008
|
}
|
|
33105
33009
|
function TSAsExpression() {
|
|
33106
33010
|
return true;
|
|
33107
33011
|
}
|
|
33108
33012
|
function TSUnionType$1(node, parent) {
|
|
33109
|
-
|
|
33013
|
+
const parentType = parent.type;
|
|
33014
|
+
return parentType === "TSArrayType" || parentType === "TSOptionalType" || parentType === "TSIntersectionType" || parentType === "TSUnionType" || parentType === "TSRestType";
|
|
33110
33015
|
}
|
|
33111
33016
|
function TSInferType$1(node, parent) {
|
|
33112
|
-
|
|
33017
|
+
const parentType = parent.type;
|
|
33018
|
+
return parentType === "TSArrayType" || parentType === "TSOptionalType";
|
|
33113
33019
|
}
|
|
33114
33020
|
function TSInstantiationExpression$1(node, parent) {
|
|
33115
|
-
|
|
33021
|
+
const parentType = parent.type;
|
|
33022
|
+
return (parentType === "CallExpression" || parentType === "OptionalCallExpression" || parentType === "NewExpression" || parentType === "TSInstantiationExpression") && !!parent.typeParameters;
|
|
33116
33023
|
}
|
|
33117
33024
|
function BinaryExpression(node, parent) {
|
|
33118
|
-
|
|
33025
|
+
if (node.operator === "in") {
|
|
33026
|
+
const parentType = parent.type;
|
|
33027
|
+
return parentType === "VariableDeclarator" || parentType === "ForStatement" || parentType === "ForInStatement" || parentType === "ForOfStatement";
|
|
33028
|
+
}
|
|
33029
|
+
return false;
|
|
33119
33030
|
}
|
|
33120
33031
|
function SequenceExpression$1(node, parent) {
|
|
33121
|
-
|
|
33032
|
+
const parentType = parent.type;
|
|
33033
|
+
if (parentType === "ForStatement" || parentType === "ThrowStatement" || parentType === "ReturnStatement" || parentType === "IfStatement" && parent.test === node || parentType === "WhileStatement" && parent.test === node || parentType === "ForInStatement" && parent.right === node || parentType === "SwitchStatement" && parent.discriminant === node || parentType === "ExpressionStatement" && parent.expression === node) {
|
|
33122
33034
|
return false;
|
|
33123
33035
|
}
|
|
33124
33036
|
return true;
|
|
33125
33037
|
}
|
|
33126
33038
|
function YieldExpression$1(node, parent) {
|
|
33127
|
-
|
|
33039
|
+
const parentType = parent.type;
|
|
33040
|
+
return parentType === "BinaryExpression" || parentType === "LogicalExpression" || parentType === "UnaryExpression" || parentType === "SpreadElement" || hasPostfixPart(node, parent) || parentType === "AwaitExpression" && isYieldExpression2(node) || parentType === "ConditionalExpression" && node === parent.test || isClassExtendsClause(node, parent);
|
|
33128
33041
|
}
|
|
33129
33042
|
function ClassExpression(node, parent, printStack) {
|
|
33130
33043
|
return isFirstInContext(printStack, 1 | 4);
|
|
33131
33044
|
}
|
|
33132
33045
|
function UnaryLike(node, parent) {
|
|
33133
|
-
return hasPostfixPart(node, parent) || isBinaryExpression2(parent,
|
|
33134
|
-
operator: "**",
|
|
33135
|
-
left: node
|
|
33136
|
-
}) || isClassExtendsClause(node, parent);
|
|
33046
|
+
return hasPostfixPart(node, parent) || isBinaryExpression2(parent) && parent.operator === "**" && parent.left === node || isClassExtendsClause(node, parent);
|
|
33137
33047
|
}
|
|
33138
33048
|
function FunctionExpression$1(node, parent, printStack) {
|
|
33139
33049
|
return isFirstInContext(printStack, 1 | 4);
|
|
@@ -33142,19 +33052,14 @@ function ArrowFunctionExpression$1(node, parent) {
|
|
|
33142
33052
|
return isExportDeclaration2(parent) || ConditionalExpression$1(node, parent);
|
|
33143
33053
|
}
|
|
33144
33054
|
function ConditionalExpression$1(node, parent) {
|
|
33145
|
-
|
|
33146
|
-
|
|
33147
|
-
}) || isAwaitExpression2(parent) || isTSTypeExpression(parent)) {
|
|
33055
|
+
const parentType = parent.type;
|
|
33056
|
+
if (parentType === "UnaryExpression" || parentType === "SpreadElement" || parentType === "BinaryExpression" || parentType === "LogicalExpression" || parentType === "ConditionalExpression" && parent.test === node || parentType === "AwaitExpression" || isTSTypeExpression(parentType)) {
|
|
33148
33057
|
return true;
|
|
33149
33058
|
}
|
|
33150
33059
|
return UnaryLike(node, parent);
|
|
33151
33060
|
}
|
|
33152
33061
|
function OptionalMemberExpression$1(node, parent) {
|
|
33153
|
-
return isCallExpression$2(parent
|
|
33154
|
-
callee: node
|
|
33155
|
-
}) || isMemberExpression$2(parent, {
|
|
33156
|
-
object: node
|
|
33157
|
-
});
|
|
33062
|
+
return isCallExpression$2(parent) && parent.callee === node || isMemberExpression$2(parent) && parent.object === node;
|
|
33158
33063
|
}
|
|
33159
33064
|
function AssignmentExpression$1(node, parent) {
|
|
33160
33065
|
if (isObjectPattern2(node.left)) {
|
|
@@ -33164,27 +33069,28 @@ function AssignmentExpression$1(node, parent) {
|
|
|
33164
33069
|
}
|
|
33165
33070
|
}
|
|
33166
33071
|
function LogicalExpression(node, parent) {
|
|
33167
|
-
|
|
33072
|
+
const parentType = parent.type;
|
|
33073
|
+
if (isTSTypeExpression(parentType))
|
|
33168
33074
|
return true;
|
|
33075
|
+
if (parentType !== "LogicalExpression")
|
|
33076
|
+
return false;
|
|
33169
33077
|
switch (node.operator) {
|
|
33170
33078
|
case "||":
|
|
33171
|
-
if (!isLogicalExpression2(parent))
|
|
33172
|
-
return false;
|
|
33173
33079
|
return parent.operator === "??" || parent.operator === "&&";
|
|
33174
33080
|
case "&&":
|
|
33175
|
-
return
|
|
33176
|
-
operator: "??"
|
|
33177
|
-
});
|
|
33081
|
+
return parent.operator === "??";
|
|
33178
33082
|
case "??":
|
|
33179
|
-
return
|
|
33083
|
+
return parent.operator !== "??";
|
|
33180
33084
|
}
|
|
33181
33085
|
}
|
|
33182
33086
|
function Identifier$1(node, parent, printStack) {
|
|
33183
33087
|
var _a;
|
|
33184
|
-
|
|
33185
|
-
|
|
33186
|
-
|
|
33187
|
-
|
|
33088
|
+
const parentType = parent.type;
|
|
33089
|
+
if (((_a = node.extra) == null ? void 0 : _a.parenthesized) && parentType === "AssignmentExpression" && parent.left === node) {
|
|
33090
|
+
const rightType = parent.right.type;
|
|
33091
|
+
if ((rightType === "FunctionExpression" || rightType === "ClassExpression") && parent.right.id == null) {
|
|
33092
|
+
return true;
|
|
33093
|
+
}
|
|
33188
33094
|
}
|
|
33189
33095
|
if (node.name === "let") {
|
|
33190
33096
|
const isFollowedByBracket = isMemberExpression$2(parent, {
|
|
@@ -33213,28 +33119,11 @@ function isFirstInContext(printStack, checkParam) {
|
|
|
33213
33119
|
i--;
|
|
33214
33120
|
let parent = printStack[i];
|
|
33215
33121
|
while (i >= 0) {
|
|
33216
|
-
|
|
33217
|
-
|
|
33218
|
-
}) || exportDefault && isExportDefaultDeclaration$1(parent, {
|
|
33219
|
-
declaration: node
|
|
33220
|
-
}) || arrowBody && isArrowFunctionExpression2(parent, {
|
|
33221
|
-
body: node
|
|
33222
|
-
}) || forHead && isForStatement$1(parent, {
|
|
33223
|
-
init: node
|
|
33224
|
-
}) || forInHead && isForInStatement2(parent, {
|
|
33225
|
-
left: node
|
|
33226
|
-
}) || forOfHead && isForOfStatement2(parent, {
|
|
33227
|
-
left: node
|
|
33228
|
-
})) {
|
|
33122
|
+
const parentType = parent.type;
|
|
33123
|
+
if (expressionStatement5 && parentType === "ExpressionStatement" && parent.expression === node || exportDefault && parentType === "ExportDefaultDeclaration" && node === parent.declaration || arrowBody && parentType === "ArrowFunctionExpression" && parent.body === node || forHead && parentType === "ForStatement" && parent.init === node || forInHead && parentType === "ForInStatement" && parent.left === node || forOfHead && parentType === "ForOfStatement" && parent.left === node) {
|
|
33229
33124
|
return true;
|
|
33230
33125
|
}
|
|
33231
|
-
if (i > 0 && (hasPostfixPart(node, parent) &&
|
|
33232
|
-
test: node
|
|
33233
|
-
}) || isBinary2(parent, {
|
|
33234
|
-
left: node
|
|
33235
|
-
}) || isAssignmentExpression2(parent, {
|
|
33236
|
-
left: node
|
|
33237
|
-
}))) {
|
|
33126
|
+
if (i > 0 && (hasPostfixPart(node, parent) && parentType !== "NewExpression" || parentType === "SequenceExpression" && parent.expressions[0] === node || parentType === "UpdateExpression" && !parent.prefix || parentType === "ConditionalExpression" && parent.test === node || (parentType === "BinaryExpression" || parentType === "LogicalExpression") && parent.left === node || parentType === "AssignmentExpression" && parent.left === node)) {
|
|
33238
33127
|
node = parent;
|
|
33239
33128
|
i--;
|
|
33240
33129
|
parent = printStack[i];
|
|
@@ -33285,13 +33174,12 @@ var {
|
|
|
33285
33174
|
isNewExpression: isNewExpression$1
|
|
33286
33175
|
} = lib_exports;
|
|
33287
33176
|
function expandAliases(obj) {
|
|
33288
|
-
const
|
|
33177
|
+
const map = /* @__PURE__ */ new Map();
|
|
33289
33178
|
function add(type, func) {
|
|
33290
|
-
const fn =
|
|
33291
|
-
|
|
33292
|
-
|
|
33293
|
-
|
|
33294
|
-
} : func;
|
|
33179
|
+
const fn = map.get(type);
|
|
33180
|
+
map.set(type, fn ? function(node, parent, stack) {
|
|
33181
|
+
return fn(node, parent, stack) ?? func(node, parent, stack);
|
|
33182
|
+
} : func);
|
|
33295
33183
|
}
|
|
33296
33184
|
for (const type of Object.keys(obj)) {
|
|
33297
33185
|
const aliases = FLIPPED_ALIAS_KEYS2[type];
|
|
@@ -33303,14 +33191,10 @@ function expandAliases(obj) {
|
|
|
33303
33191
|
add(type, obj[type]);
|
|
33304
33192
|
}
|
|
33305
33193
|
}
|
|
33306
|
-
return
|
|
33194
|
+
return map;
|
|
33307
33195
|
}
|
|
33308
33196
|
var expandedParens = expandAliases(parens);
|
|
33309
33197
|
var expandedWhitespaceNodes = expandAliases(nodes);
|
|
33310
|
-
function find(obj, node, parent, printStack) {
|
|
33311
|
-
const fn = obj[node.type];
|
|
33312
|
-
return fn ? fn(node, parent, printStack) : null;
|
|
33313
|
-
}
|
|
33314
33198
|
function isOrHasCallExpression(node) {
|
|
33315
33199
|
if (isCallExpression$1(node)) {
|
|
33316
33200
|
return true;
|
|
@@ -33318,12 +33202,13 @@ function isOrHasCallExpression(node) {
|
|
|
33318
33202
|
return isMemberExpression$1(node) && isOrHasCallExpression(node.object);
|
|
33319
33203
|
}
|
|
33320
33204
|
function needsWhitespace(node, parent, type) {
|
|
33205
|
+
var _a;
|
|
33321
33206
|
if (!node)
|
|
33322
33207
|
return false;
|
|
33323
33208
|
if (isExpressionStatement3(node)) {
|
|
33324
33209
|
node = node.expression;
|
|
33325
33210
|
}
|
|
33326
|
-
const flag =
|
|
33211
|
+
const flag = (_a = expandedWhitespaceNodes.get(node.type)) == null ? void 0 : _a(node, parent);
|
|
33327
33212
|
if (typeof flag === "number") {
|
|
33328
33213
|
return (flag & type) !== 0;
|
|
33329
33214
|
}
|
|
@@ -33336,13 +33221,14 @@ function needsWhitespaceAfter(node, parent) {
|
|
|
33336
33221
|
return needsWhitespace(node, parent, 2);
|
|
33337
33222
|
}
|
|
33338
33223
|
function needsParens$1(node, parent, printStack) {
|
|
33224
|
+
var _a;
|
|
33339
33225
|
if (!parent)
|
|
33340
33226
|
return false;
|
|
33341
33227
|
if (isNewExpression$1(parent) && parent.callee === node) {
|
|
33342
33228
|
if (isOrHasCallExpression(node))
|
|
33343
33229
|
return true;
|
|
33344
33230
|
}
|
|
33345
|
-
return
|
|
33231
|
+
return (_a = expandedParens.get(node.type)) == null ? void 0 : _a(node, parent, printStack);
|
|
33346
33232
|
}
|
|
33347
33233
|
var n = /* @__PURE__ */ Object.freeze({
|
|
33348
33234
|
__proto__: null,
|
|
@@ -34610,15 +34496,16 @@ function NullLiteral() {
|
|
|
34610
34496
|
function NumericLiteral(node) {
|
|
34611
34497
|
const raw = this.getPossibleRaw(node);
|
|
34612
34498
|
const opts = this.format.jsescOption;
|
|
34613
|
-
const value = node.value
|
|
34499
|
+
const value = node.value;
|
|
34500
|
+
const str = value + "";
|
|
34614
34501
|
if (opts.numbers) {
|
|
34615
|
-
this.number((0, import_jsesc.default)(
|
|
34502
|
+
this.number((0, import_jsesc.default)(value, opts), value);
|
|
34616
34503
|
} else if (raw == null) {
|
|
34617
|
-
this.number(value);
|
|
34504
|
+
this.number(str, value);
|
|
34618
34505
|
} else if (this.format.minified) {
|
|
34619
|
-
this.number(raw.length <
|
|
34506
|
+
this.number(raw.length < str.length ? raw : str, value);
|
|
34620
34507
|
} else {
|
|
34621
|
-
this.number(raw);
|
|
34508
|
+
this.number(raw, value);
|
|
34622
34509
|
}
|
|
34623
34510
|
}
|
|
34624
34511
|
function StringLiteral(node) {
|
|
@@ -35513,8 +35400,7 @@ function TSConstructSignatureDeclaration(node) {
|
|
|
35513
35400
|
}
|
|
35514
35401
|
function TSPropertySignature(node) {
|
|
35515
35402
|
const {
|
|
35516
|
-
readonly
|
|
35517
|
-
initializer
|
|
35403
|
+
readonly
|
|
35518
35404
|
} = node;
|
|
35519
35405
|
if (readonly) {
|
|
35520
35406
|
this.word("readonly");
|
|
@@ -35522,12 +35408,6 @@ function TSPropertySignature(node) {
|
|
|
35522
35408
|
}
|
|
35523
35409
|
this.tsPrintPropertyOrMethodName(node);
|
|
35524
35410
|
this.print(node.typeAnnotation, node);
|
|
35525
|
-
if (initializer) {
|
|
35526
|
-
this.space();
|
|
35527
|
-
this.tokenChar(61);
|
|
35528
|
-
this.space();
|
|
35529
|
-
this.print(initializer, node);
|
|
35530
|
-
}
|
|
35531
35411
|
this.tokenChar(59);
|
|
35532
35412
|
}
|
|
35533
35413
|
function tsPrintPropertyOrMethodName(node) {
|
|
@@ -36333,25 +36213,21 @@ var {
|
|
|
36333
36213
|
} = lib_exports;
|
|
36334
36214
|
var SCIENTIFIC_NOTATION = /e/i;
|
|
36335
36215
|
var ZERO_DECIMAL_INTEGER = /\.0+$/;
|
|
36336
|
-
var NON_DECIMAL_LITERAL = /^0[box]/;
|
|
36337
|
-
var PURE_ANNOTATION_RE = /^\s*[@#]__PURE__\s*$/;
|
|
36338
36216
|
var HAS_NEWLINE = /[\n\r\u2028\u2029]/;
|
|
36339
|
-
var
|
|
36217
|
+
var HAS_NEWLINE_OR_BlOCK_COMMENT_END = /[\n\r\u2028\u2029]|\*\//;
|
|
36340
36218
|
var {
|
|
36341
36219
|
needsParens
|
|
36342
36220
|
} = n;
|
|
36343
36221
|
var Printer = class {
|
|
36344
36222
|
constructor(format, map) {
|
|
36345
36223
|
this.format = format;
|
|
36346
|
-
this._buf = new Buffer2(map);
|
|
36347
|
-
this._indentChar = format.indent.style.charCodeAt(0);
|
|
36348
36224
|
this._indentRepeat = format.indent.style.length;
|
|
36349
36225
|
this._inputMap = map == null ? void 0 : map._inputMap;
|
|
36226
|
+
this._buf = new Buffer2(map, format.indent.style[0]);
|
|
36350
36227
|
}
|
|
36351
36228
|
inForStatementInitCounter = 0;
|
|
36352
36229
|
_printStack = [];
|
|
36353
36230
|
_indent = 0;
|
|
36354
|
-
_indentChar = 0;
|
|
36355
36231
|
_indentRepeat = 0;
|
|
36356
36232
|
_insideAux = false;
|
|
36357
36233
|
_parenPushNewlineState = null;
|
|
@@ -36420,9 +36296,16 @@ var Printer = class {
|
|
|
36420
36296
|
this._endsWithWord = true;
|
|
36421
36297
|
this._noLineTerminator = noLineTerminatorAfter;
|
|
36422
36298
|
}
|
|
36423
|
-
number(str) {
|
|
36299
|
+
number(str, number) {
|
|
36300
|
+
function isNonDecimalLiteral(str2) {
|
|
36301
|
+
if (str2.length > 2 && str2.charCodeAt(0) === 48) {
|
|
36302
|
+
const secondChar = str2.charCodeAt(1);
|
|
36303
|
+
return secondChar === 98 || secondChar === 111 || secondChar === 120;
|
|
36304
|
+
}
|
|
36305
|
+
return false;
|
|
36306
|
+
}
|
|
36424
36307
|
this.word(str);
|
|
36425
|
-
this._endsWithInteger = Number.isInteger(
|
|
36308
|
+
this._endsWithInteger = Number.isInteger(number) && !isNonDecimalLiteral(str) && !SCIENTIFIC_NOTATION.test(str) && !ZERO_DECIMAL_INTEGER.test(str) && str.charCodeAt(str.length - 1) !== 46;
|
|
36426
36309
|
}
|
|
36427
36310
|
token(str, maybeNewline = false) {
|
|
36428
36311
|
this._maybePrintInnerComments();
|
|
@@ -36540,7 +36423,7 @@ var Printer = class {
|
|
|
36540
36423
|
}
|
|
36541
36424
|
_maybeIndent(firstChar) {
|
|
36542
36425
|
if (this._indent && firstChar !== 10 && this.endsWith(10)) {
|
|
36543
|
-
this._buf.queueIndentation(this.
|
|
36426
|
+
this._buf.queueIndentation(this._getIndent());
|
|
36544
36427
|
}
|
|
36545
36428
|
}
|
|
36546
36429
|
_shouldIndent(firstChar) {
|
|
@@ -36582,9 +36465,7 @@ var Printer = class {
|
|
|
36582
36465
|
}
|
|
36583
36466
|
const chaPost = str.charCodeAt(i + 1);
|
|
36584
36467
|
if (chaPost === 42) {
|
|
36585
|
-
|
|
36586
|
-
return;
|
|
36587
|
-
}
|
|
36468
|
+
return;
|
|
36588
36469
|
} else if (chaPost !== 47) {
|
|
36589
36470
|
this._parenPushNewlineState = null;
|
|
36590
36471
|
return;
|
|
@@ -36635,7 +36516,7 @@ var Printer = class {
|
|
|
36635
36516
|
}
|
|
36636
36517
|
}
|
|
36637
36518
|
print(node, parent, noLineTerminatorAfter, trailingCommentsLineOffset, forceParens) {
|
|
36638
|
-
var _a;
|
|
36519
|
+
var _a, _b;
|
|
36639
36520
|
if (!node)
|
|
36640
36521
|
return;
|
|
36641
36522
|
this._endsWithInnerRaw = false;
|
|
@@ -36653,7 +36534,25 @@ var Printer = class {
|
|
|
36653
36534
|
const oldInAux = this._insideAux;
|
|
36654
36535
|
this._insideAux = node.loc == void 0;
|
|
36655
36536
|
this._maybeAddAuxComment(this._insideAux && !oldInAux);
|
|
36656
|
-
const
|
|
36537
|
+
const parenthesized = (_a = node.extra) == null ? void 0 : _a.parenthesized;
|
|
36538
|
+
let shouldPrintParens = forceParens || parenthesized && format.retainFunctionParens && nodeType === "FunctionExpression" || needsParens(node, parent, this._printStack);
|
|
36539
|
+
if (!shouldPrintParens && parenthesized && ((_b = node.leadingComments) == null ? void 0 : _b.length) && node.leadingComments[0].type === "CommentBlock") {
|
|
36540
|
+
const parentType = parent == null ? void 0 : parent.type;
|
|
36541
|
+
switch (parentType) {
|
|
36542
|
+
case "ExpressionStatement":
|
|
36543
|
+
case "VariableDeclarator":
|
|
36544
|
+
case "AssignmentExpression":
|
|
36545
|
+
case "ReturnStatement":
|
|
36546
|
+
break;
|
|
36547
|
+
case "CallExpression":
|
|
36548
|
+
case "OptionalCallExpression":
|
|
36549
|
+
case "NewExpression":
|
|
36550
|
+
if (parent.callee !== node)
|
|
36551
|
+
break;
|
|
36552
|
+
default:
|
|
36553
|
+
shouldPrintParens = true;
|
|
36554
|
+
}
|
|
36555
|
+
}
|
|
36657
36556
|
if (shouldPrintParens) {
|
|
36658
36557
|
this.tokenChar(40);
|
|
36659
36558
|
this._endsWithInnerRaw = false;
|
|
@@ -36714,7 +36613,7 @@ var Printer = class {
|
|
|
36714
36613
|
}
|
|
36715
36614
|
}
|
|
36716
36615
|
printJoin(nodes2, parent, opts = {}) {
|
|
36717
|
-
var _a, _b, _c;
|
|
36616
|
+
var _a, _b, _c, _d;
|
|
36718
36617
|
if (!(nodes2 == null ? void 0 : nodes2.length))
|
|
36719
36618
|
return;
|
|
36720
36619
|
let {
|
|
@@ -36745,11 +36644,14 @@ var Printer = class {
|
|
|
36745
36644
|
if (i < len - 1)
|
|
36746
36645
|
separator == null ? void 0 : separator();
|
|
36747
36646
|
if (opts.statement) {
|
|
36647
|
+
if (!((_c = node.trailingComments) == null ? void 0 : _c.length)) {
|
|
36648
|
+
this._lastCommentLine = 0;
|
|
36649
|
+
}
|
|
36748
36650
|
if (i + 1 === len) {
|
|
36749
36651
|
this.newline(1);
|
|
36750
36652
|
} else {
|
|
36751
36653
|
const nextNode = nodes2[i + 1];
|
|
36752
|
-
newlineOpts.nextNodeStartLine = ((
|
|
36654
|
+
newlineOpts.nextNodeStartLine = ((_d = nextNode.loc) == null ? void 0 : _d.start.line) || 0;
|
|
36753
36655
|
this._printNewline(true, newlineOpts);
|
|
36754
36656
|
}
|
|
36755
36657
|
}
|
|
@@ -36856,7 +36758,7 @@ var Printer = class {
|
|
|
36856
36758
|
return 0;
|
|
36857
36759
|
if (this._printedComments.has(comment))
|
|
36858
36760
|
return 0;
|
|
36859
|
-
if (this._noLineTerminator &&
|
|
36761
|
+
if (this._noLineTerminator && HAS_NEWLINE_OR_BlOCK_COMMENT_END.test(comment.value)) {
|
|
36860
36762
|
return 2;
|
|
36861
36763
|
}
|
|
36862
36764
|
this._printedComments.add(comment);
|
|
@@ -36879,6 +36781,14 @@ var Printer = class {
|
|
|
36879
36781
|
}
|
|
36880
36782
|
let val;
|
|
36881
36783
|
if (isBlockComment) {
|
|
36784
|
+
const {
|
|
36785
|
+
_parenPushNewlineState
|
|
36786
|
+
} = this;
|
|
36787
|
+
if ((_parenPushNewlineState == null ? void 0 : _parenPushNewlineState.printed) === false && HAS_NEWLINE.test(comment.value)) {
|
|
36788
|
+
this.tokenChar(40);
|
|
36789
|
+
this.indent();
|
|
36790
|
+
_parenPushNewlineState.printed = true;
|
|
36791
|
+
}
|
|
36882
36792
|
val = `/*${comment.value}*/`;
|
|
36883
36793
|
if (this.format.indent.adjustMultilineComment) {
|
|
36884
36794
|
const offset = (_a = comment.loc) == null ? void 0 : _a.start.column;
|
|
@@ -36886,12 +36796,17 @@ var Printer = class {
|
|
|
36886
36796
|
const newlineRegex = new RegExp("\\n\\s{1," + offset + "}", "g");
|
|
36887
36797
|
val = val.replace(newlineRegex, "\n");
|
|
36888
36798
|
}
|
|
36889
|
-
|
|
36890
|
-
|
|
36891
|
-
|
|
36892
|
-
}
|
|
36893
|
-
|
|
36799
|
+
if (this.format.concise) {
|
|
36800
|
+
val = val.replace(/\n(?!$)/g, `
|
|
36801
|
+
`);
|
|
36802
|
+
} else {
|
|
36803
|
+
let indentSize = this.format.retainLines ? 0 : this._buf.getCurrentColumn();
|
|
36804
|
+
if (this._shouldIndent(47) || this.format.retainLines) {
|
|
36805
|
+
indentSize += this._getIndent();
|
|
36806
|
+
}
|
|
36807
|
+
val = val.replace(/\n(?!$)/g, `
|
|
36894
36808
|
${" ".repeat(indentSize)}`);
|
|
36809
|
+
}
|
|
36895
36810
|
}
|
|
36896
36811
|
} else if (!noLineTerminator) {
|
|
36897
36812
|
val = `//${comment.value}`;
|
|
@@ -36994,18 +36909,6 @@ function commaSeparator() {
|
|
|
36994
36909
|
this.tokenChar(44);
|
|
36995
36910
|
this.space();
|
|
36996
36911
|
}
|
|
36997
|
-
var Generator = class extends Printer {
|
|
36998
|
-
constructor(ast, opts = {}, code2) {
|
|
36999
|
-
const format = normalizeOptions(code2, opts);
|
|
37000
|
-
const map = opts.sourceMaps ? new SourceMap(opts, code2) : null;
|
|
37001
|
-
super(format, map);
|
|
37002
|
-
this.ast = ast;
|
|
37003
|
-
}
|
|
37004
|
-
ast;
|
|
37005
|
-
generate() {
|
|
37006
|
-
return super.generate(this.ast);
|
|
37007
|
-
}
|
|
37008
|
-
};
|
|
37009
36912
|
function normalizeOptions(code2, opts) {
|
|
37010
36913
|
const format = {
|
|
37011
36914
|
auxiliaryCommentBefore: opts.auxiliaryCommentBefore,
|
|
@@ -37058,9 +36961,11 @@ function normalizeOptions(code2, opts) {
|
|
|
37058
36961
|
}
|
|
37059
36962
|
return format;
|
|
37060
36963
|
}
|
|
37061
|
-
function generate(ast, opts, code2) {
|
|
37062
|
-
const
|
|
37063
|
-
|
|
36964
|
+
function generate(ast, opts = {}, code2) {
|
|
36965
|
+
const format = normalizeOptions(code2, opts);
|
|
36966
|
+
const map = opts.sourceMaps ? new SourceMap(opts, code2) : null;
|
|
36967
|
+
const printer = new Printer(format, map);
|
|
36968
|
+
return printer.generate(ast);
|
|
37064
36969
|
}
|
|
37065
36970
|
|
|
37066
36971
|
// node_modules/@babel/traverse/lib/index.js
|
|
@@ -37217,7 +37122,7 @@ var {
|
|
|
37217
37122
|
isRegExpLiteral: isRegExpLiteral2,
|
|
37218
37123
|
isRestElement: isRestElement2,
|
|
37219
37124
|
isTemplateLiteral: isTemplateLiteral2,
|
|
37220
|
-
isVariableDeclarator:
|
|
37125
|
+
isVariableDeclarator: isVariableDeclarator2,
|
|
37221
37126
|
toBindingIdentifierName: toBindingIdentifierName2
|
|
37222
37127
|
} = lib_exports;
|
|
37223
37128
|
function getFunctionArity(node) {
|
|
@@ -37331,7 +37236,7 @@ function index2({
|
|
|
37331
37236
|
kind: "method"
|
|
37332
37237
|
})) && (!parent.computed || isLiteral3(parent.key))) {
|
|
37333
37238
|
id = parent.key;
|
|
37334
|
-
} else if (
|
|
37239
|
+
} else if (isVariableDeclarator2(parent)) {
|
|
37335
37240
|
id = parent.id;
|
|
37336
37241
|
if (isIdentifier4(id) && !localBinding) {
|
|
37337
37242
|
const binding = scope2.parent.getBinding(id.name);
|
|
@@ -37407,6 +37312,157 @@ var virtualTypes = /* @__PURE__ */ Object.freeze({
|
|
|
37407
37312
|
User,
|
|
37408
37313
|
Var
|
|
37409
37314
|
});
|
|
37315
|
+
var {
|
|
37316
|
+
isBinding: isBinding2,
|
|
37317
|
+
isBlockScoped: nodeIsBlockScoped,
|
|
37318
|
+
isExportDeclaration: isExportDeclaration$1,
|
|
37319
|
+
isExpression: nodeIsExpression,
|
|
37320
|
+
isFlow: nodeIsFlow,
|
|
37321
|
+
isForStatement: isForStatement3,
|
|
37322
|
+
isForXStatement: isForXStatement2,
|
|
37323
|
+
isIdentifier: isIdentifier$6,
|
|
37324
|
+
isImportDeclaration: isImportDeclaration$1,
|
|
37325
|
+
isImportSpecifier: isImportSpecifier2,
|
|
37326
|
+
isJSXIdentifier: isJSXIdentifier3,
|
|
37327
|
+
isJSXMemberExpression: isJSXMemberExpression2,
|
|
37328
|
+
isMemberExpression: isMemberExpression3,
|
|
37329
|
+
isRestElement: nodeIsRestElement,
|
|
37330
|
+
isReferenced: nodeIsReferenced,
|
|
37331
|
+
isScope: nodeIsScope,
|
|
37332
|
+
isStatement: nodeIsStatement,
|
|
37333
|
+
isVar: nodeIsVar,
|
|
37334
|
+
isVariableDeclaration: isVariableDeclaration$2,
|
|
37335
|
+
react: react$1,
|
|
37336
|
+
isForOfStatement: isForOfStatement3
|
|
37337
|
+
} = lib_exports;
|
|
37338
|
+
var {
|
|
37339
|
+
isCompatTag: isCompatTag2
|
|
37340
|
+
} = react$1;
|
|
37341
|
+
function isReferencedIdentifier(opts) {
|
|
37342
|
+
const {
|
|
37343
|
+
node,
|
|
37344
|
+
parent
|
|
37345
|
+
} = this;
|
|
37346
|
+
if (!isIdentifier$6(node, opts) && !isJSXMemberExpression2(parent, opts)) {
|
|
37347
|
+
if (isJSXIdentifier3(node, opts)) {
|
|
37348
|
+
if (isCompatTag2(node.name))
|
|
37349
|
+
return false;
|
|
37350
|
+
} else {
|
|
37351
|
+
return false;
|
|
37352
|
+
}
|
|
37353
|
+
}
|
|
37354
|
+
return nodeIsReferenced(node, parent, this.parentPath.parent);
|
|
37355
|
+
}
|
|
37356
|
+
function isReferencedMemberExpression() {
|
|
37357
|
+
const {
|
|
37358
|
+
node,
|
|
37359
|
+
parent
|
|
37360
|
+
} = this;
|
|
37361
|
+
return isMemberExpression3(node) && nodeIsReferenced(node, parent);
|
|
37362
|
+
}
|
|
37363
|
+
function isBindingIdentifier() {
|
|
37364
|
+
const {
|
|
37365
|
+
node,
|
|
37366
|
+
parent
|
|
37367
|
+
} = this;
|
|
37368
|
+
const grandparent = this.parentPath.parent;
|
|
37369
|
+
return isIdentifier$6(node) && isBinding2(node, parent, grandparent);
|
|
37370
|
+
}
|
|
37371
|
+
function isStatement$13() {
|
|
37372
|
+
const {
|
|
37373
|
+
node,
|
|
37374
|
+
parent
|
|
37375
|
+
} = this;
|
|
37376
|
+
if (nodeIsStatement(node)) {
|
|
37377
|
+
if (isVariableDeclaration$2(node)) {
|
|
37378
|
+
if (isForXStatement2(parent, {
|
|
37379
|
+
left: node
|
|
37380
|
+
}))
|
|
37381
|
+
return false;
|
|
37382
|
+
if (isForStatement3(parent, {
|
|
37383
|
+
init: node
|
|
37384
|
+
}))
|
|
37385
|
+
return false;
|
|
37386
|
+
}
|
|
37387
|
+
return true;
|
|
37388
|
+
} else {
|
|
37389
|
+
return false;
|
|
37390
|
+
}
|
|
37391
|
+
}
|
|
37392
|
+
function isExpression$3() {
|
|
37393
|
+
if (this.isIdentifier()) {
|
|
37394
|
+
return this.isReferencedIdentifier();
|
|
37395
|
+
} else {
|
|
37396
|
+
return nodeIsExpression(this.node);
|
|
37397
|
+
}
|
|
37398
|
+
}
|
|
37399
|
+
function isScope2() {
|
|
37400
|
+
return nodeIsScope(this.node, this.parent);
|
|
37401
|
+
}
|
|
37402
|
+
function isReferenced2() {
|
|
37403
|
+
return nodeIsReferenced(this.node, this.parent);
|
|
37404
|
+
}
|
|
37405
|
+
function isBlockScoped2() {
|
|
37406
|
+
return nodeIsBlockScoped(this.node);
|
|
37407
|
+
}
|
|
37408
|
+
function isVar2() {
|
|
37409
|
+
return nodeIsVar(this.node);
|
|
37410
|
+
}
|
|
37411
|
+
function isUser() {
|
|
37412
|
+
return this.node && !!this.node.loc;
|
|
37413
|
+
}
|
|
37414
|
+
function isGenerated() {
|
|
37415
|
+
return !this.isUser();
|
|
37416
|
+
}
|
|
37417
|
+
function isPure(constantsOnly) {
|
|
37418
|
+
return this.scope.isPure(this.node, constantsOnly);
|
|
37419
|
+
}
|
|
37420
|
+
function isFlow2() {
|
|
37421
|
+
const {
|
|
37422
|
+
node
|
|
37423
|
+
} = this;
|
|
37424
|
+
if (nodeIsFlow(node)) {
|
|
37425
|
+
return true;
|
|
37426
|
+
} else if (isImportDeclaration$1(node)) {
|
|
37427
|
+
return node.importKind === "type" || node.importKind === "typeof";
|
|
37428
|
+
} else if (isExportDeclaration$1(node)) {
|
|
37429
|
+
return node.exportKind === "type";
|
|
37430
|
+
} else if (isImportSpecifier2(node)) {
|
|
37431
|
+
return node.importKind === "type" || node.importKind === "typeof";
|
|
37432
|
+
} else {
|
|
37433
|
+
return false;
|
|
37434
|
+
}
|
|
37435
|
+
}
|
|
37436
|
+
function isRestProperty2() {
|
|
37437
|
+
return nodeIsRestElement(this.node) && this.parentPath && this.parentPath.isObjectPattern();
|
|
37438
|
+
}
|
|
37439
|
+
function isSpreadProperty2() {
|
|
37440
|
+
return nodeIsRestElement(this.node) && this.parentPath && this.parentPath.isObjectExpression();
|
|
37441
|
+
}
|
|
37442
|
+
function isForAwaitStatement() {
|
|
37443
|
+
return isForOfStatement3(this.node, {
|
|
37444
|
+
await: true
|
|
37445
|
+
});
|
|
37446
|
+
}
|
|
37447
|
+
var NodePath_virtual_types_validator = /* @__PURE__ */ Object.freeze({
|
|
37448
|
+
__proto__: null,
|
|
37449
|
+
isBindingIdentifier,
|
|
37450
|
+
isBlockScoped: isBlockScoped2,
|
|
37451
|
+
isExpression: isExpression$3,
|
|
37452
|
+
isFlow: isFlow2,
|
|
37453
|
+
isForAwaitStatement,
|
|
37454
|
+
isGenerated,
|
|
37455
|
+
isPure,
|
|
37456
|
+
isReferenced: isReferenced2,
|
|
37457
|
+
isReferencedIdentifier,
|
|
37458
|
+
isReferencedMemberExpression,
|
|
37459
|
+
isRestProperty: isRestProperty2,
|
|
37460
|
+
isScope: isScope2,
|
|
37461
|
+
isSpreadProperty: isSpreadProperty2,
|
|
37462
|
+
isStatement: isStatement$13,
|
|
37463
|
+
isUser,
|
|
37464
|
+
isVar: isVar2
|
|
37465
|
+
});
|
|
37410
37466
|
var {
|
|
37411
37467
|
DEPRECATED_KEYS: DEPRECATED_KEYS2,
|
|
37412
37468
|
DEPRECATED_ALIASES: DEPRECATED_ALIASES2,
|
|
@@ -37604,8 +37660,10 @@ function ensureCallbackArrays(obj) {
|
|
|
37604
37660
|
obj.exit = [obj.exit];
|
|
37605
37661
|
}
|
|
37606
37662
|
function wrapCheck(nodeType, fn) {
|
|
37663
|
+
const fnKey = `is${nodeType}`;
|
|
37664
|
+
const validator = NodePath_virtual_types_validator[fnKey];
|
|
37607
37665
|
const newFn = function(path) {
|
|
37608
|
-
if (path
|
|
37666
|
+
if (validator.call(path)) {
|
|
37609
37667
|
return fn.apply(this, arguments);
|
|
37610
37668
|
}
|
|
37611
37669
|
};
|
|
@@ -37858,19 +37916,19 @@ var {
|
|
|
37858
37916
|
NOT_LOCAL_BINDING: NOT_LOCAL_BINDING3,
|
|
37859
37917
|
callExpression: callExpression$3,
|
|
37860
37918
|
cloneNode: cloneNode$3,
|
|
37861
|
-
getBindingIdentifiers: getBindingIdentifiers$
|
|
37919
|
+
getBindingIdentifiers: getBindingIdentifiers$3,
|
|
37862
37920
|
identifier: identifier$3,
|
|
37863
37921
|
isArrayExpression: isArrayExpression3,
|
|
37864
37922
|
isBinary: isBinary3,
|
|
37865
|
-
isClass:
|
|
37923
|
+
isClass: isClass2,
|
|
37866
37924
|
isClassBody: isClassBody3,
|
|
37867
37925
|
isClassDeclaration: isClassDeclaration3,
|
|
37868
37926
|
isExportAllDeclaration: isExportAllDeclaration2,
|
|
37869
37927
|
isExportDefaultDeclaration: isExportDefaultDeclaration3,
|
|
37870
37928
|
isExportNamedDeclaration: isExportNamedDeclaration$1,
|
|
37871
37929
|
isFunctionDeclaration: isFunctionDeclaration2,
|
|
37872
|
-
isIdentifier: isIdentifier$
|
|
37873
|
-
isImportDeclaration:
|
|
37930
|
+
isIdentifier: isIdentifier$5,
|
|
37931
|
+
isImportDeclaration: isImportDeclaration2,
|
|
37874
37932
|
isLiteral: isLiteral$12,
|
|
37875
37933
|
isMethod: isMethod2,
|
|
37876
37934
|
isModuleSpecifier: isModuleSpecifier2,
|
|
@@ -37880,7 +37938,7 @@ var {
|
|
|
37880
37938
|
isPureish: isPureish2,
|
|
37881
37939
|
isRegExpLiteral: isRegExpLiteral3,
|
|
37882
37940
|
isSuper: isSuper$1,
|
|
37883
|
-
isTaggedTemplateExpression:
|
|
37941
|
+
isTaggedTemplateExpression: isTaggedTemplateExpression2,
|
|
37884
37942
|
isTemplateLiteral: isTemplateLiteral3,
|
|
37885
37943
|
isThisExpression: isThisExpression2,
|
|
37886
37944
|
isUnaryExpression: isUnaryExpression2,
|
|
@@ -37897,17 +37955,17 @@ var {
|
|
|
37897
37955
|
isTopicReference: isTopicReference2,
|
|
37898
37956
|
isMetaProperty: isMetaProperty2,
|
|
37899
37957
|
isPrivateName: isPrivateName2,
|
|
37900
|
-
isExportDeclaration:
|
|
37901
|
-
buildUndefinedNode:
|
|
37958
|
+
isExportDeclaration: isExportDeclaration3,
|
|
37959
|
+
buildUndefinedNode: buildUndefinedNode$1
|
|
37902
37960
|
} = lib_exports;
|
|
37903
37961
|
function gatherNodeParts(node, parts) {
|
|
37904
37962
|
var _a;
|
|
37905
37963
|
switch (node == null ? void 0 : node.type) {
|
|
37906
37964
|
default:
|
|
37907
|
-
if (
|
|
37908
|
-
if ((isExportAllDeclaration2(node) || isExportNamedDeclaration$1(node) ||
|
|
37965
|
+
if (isImportDeclaration2(node) || isExportDeclaration3(node)) {
|
|
37966
|
+
if ((isExportAllDeclaration2(node) || isExportNamedDeclaration$1(node) || isImportDeclaration2(node)) && node.source) {
|
|
37909
37967
|
gatherNodeParts(node.source, parts);
|
|
37910
|
-
} else if ((isExportNamedDeclaration$1(node) ||
|
|
37968
|
+
} else if ((isExportNamedDeclaration$1(node) || isImportDeclaration2(node)) && ((_a = node.specifiers) == null ? void 0 : _a.length)) {
|
|
37911
37969
|
for (const e of node.specifiers)
|
|
37912
37970
|
gatherNodeParts(e, parts);
|
|
37913
37971
|
} else if ((isExportDefaultDeclaration3(node) || isExportNamedDeclaration$1(node)) && node.declaration) {
|
|
@@ -38073,7 +38131,7 @@ var collectorVisitor = {
|
|
|
38073
38131
|
binding == null ? void 0 : binding.reference(path);
|
|
38074
38132
|
} else if (isVariableDeclaration$1(declar)) {
|
|
38075
38133
|
for (const decl of declar.declarations) {
|
|
38076
|
-
for (const name of Object.keys(getBindingIdentifiers$
|
|
38134
|
+
for (const name of Object.keys(getBindingIdentifiers$3(decl))) {
|
|
38077
38135
|
const binding = scope2.getBinding(name);
|
|
38078
38136
|
binding == null ? void 0 : binding.reference(path);
|
|
38079
38137
|
}
|
|
@@ -38219,7 +38277,7 @@ var Scope2 = class _Scope {
|
|
|
38219
38277
|
if (isThisExpression2(node) || isSuper$1(node) || isTopicReference2(node)) {
|
|
38220
38278
|
return true;
|
|
38221
38279
|
}
|
|
38222
|
-
if (isIdentifier$
|
|
38280
|
+
if (isIdentifier$5(node)) {
|
|
38223
38281
|
const binding = this.getBinding(node.name);
|
|
38224
38282
|
if (binding) {
|
|
38225
38283
|
return binding.constant;
|
|
@@ -38288,7 +38346,7 @@ var Scope2 = class _Scope {
|
|
|
38288
38346
|
console.log(sep);
|
|
38289
38347
|
}
|
|
38290
38348
|
toArray(node, i, arrayLikeIsIterable) {
|
|
38291
|
-
if (isIdentifier$
|
|
38349
|
+
if (isIdentifier$5(node)) {
|
|
38292
38350
|
const binding = this.getBinding(node.name);
|
|
38293
38351
|
if ((binding == null ? void 0 : binding.constant) && binding.path.isGenericType("Array")) {
|
|
38294
38352
|
return node;
|
|
@@ -38297,7 +38355,7 @@ var Scope2 = class _Scope {
|
|
|
38297
38355
|
if (isArrayExpression3(node)) {
|
|
38298
38356
|
return node;
|
|
38299
38357
|
}
|
|
38300
|
-
if (isIdentifier$
|
|
38358
|
+
if (isIdentifier$5(node, {
|
|
38301
38359
|
name: "arguments"
|
|
38302
38360
|
})) {
|
|
38303
38361
|
return callExpression$3(memberExpression$1(memberExpression$1(memberExpression$1(identifier$3("Array"), identifier$3("prototype")), identifier$3("slice")), identifier$3("call")), [node]);
|
|
@@ -38361,7 +38419,7 @@ var Scope2 = class _Scope {
|
|
|
38361
38419
|
}
|
|
38362
38420
|
}
|
|
38363
38421
|
buildUndefinedNode() {
|
|
38364
|
-
return
|
|
38422
|
+
return buildUndefinedNode$1();
|
|
38365
38423
|
}
|
|
38366
38424
|
registerConstantViolation(path) {
|
|
38367
38425
|
var _a;
|
|
@@ -38428,7 +38486,7 @@ var Scope2 = class _Scope {
|
|
|
38428
38486
|
}
|
|
38429
38487
|
isPure(node, constantsOnly) {
|
|
38430
38488
|
var _a, _b, _c;
|
|
38431
|
-
if (isIdentifier$
|
|
38489
|
+
if (isIdentifier$5(node)) {
|
|
38432
38490
|
const binding = this.getBinding(node.name);
|
|
38433
38491
|
if (!binding)
|
|
38434
38492
|
return false;
|
|
@@ -38437,7 +38495,7 @@ var Scope2 = class _Scope {
|
|
|
38437
38495
|
return true;
|
|
38438
38496
|
} else if (isThisExpression2(node) || isMetaProperty2(node) || isTopicReference2(node) || isPrivateName2(node)) {
|
|
38439
38497
|
return true;
|
|
38440
|
-
} else if (
|
|
38498
|
+
} else if (isClass2(node)) {
|
|
38441
38499
|
if (node.superClass && !this.isPure(node.superClass, constantsOnly)) {
|
|
38442
38500
|
return false;
|
|
38443
38501
|
}
|
|
@@ -38486,7 +38544,7 @@ var Scope2 = class _Scope {
|
|
|
38486
38544
|
return true;
|
|
38487
38545
|
} else if (isUnaryExpression2(node)) {
|
|
38488
38546
|
return this.isPure(node.argument, constantsOnly);
|
|
38489
|
-
} else if (
|
|
38547
|
+
} else if (isTaggedTemplateExpression2(node)) {
|
|
38490
38548
|
return matchesPattern$1(node.tag, "String.raw") && !this.hasBinding("String", true) && this.isPure(node.quasi, constantsOnly);
|
|
38491
38549
|
} else if (isTemplateLiteral3(node)) {
|
|
38492
38550
|
for (const expression2 of node.expressions) {
|
|
@@ -38770,7 +38828,7 @@ function findParent(callback) {
|
|
|
38770
38828
|
}
|
|
38771
38829
|
return null;
|
|
38772
38830
|
}
|
|
38773
|
-
function
|
|
38831
|
+
function find(callback) {
|
|
38774
38832
|
let path = this;
|
|
38775
38833
|
do {
|
|
38776
38834
|
if (callback(path))
|
|
@@ -38888,7 +38946,7 @@ function inType(...candidateTypes) {
|
|
|
38888
38946
|
}
|
|
38889
38947
|
var NodePath_ancestry = /* @__PURE__ */ Object.freeze({
|
|
38890
38948
|
__proto__: null,
|
|
38891
|
-
find
|
|
38949
|
+
find,
|
|
38892
38950
|
findParent,
|
|
38893
38951
|
getAncestry,
|
|
38894
38952
|
getDeepestCommonAncestorFrom,
|
|
@@ -39086,7 +39144,7 @@ var {
|
|
|
39086
39144
|
tupleTypeAnnotation: tupleTypeAnnotation2,
|
|
39087
39145
|
unionTypeAnnotation: unionTypeAnnotation2,
|
|
39088
39146
|
voidTypeAnnotation: voidTypeAnnotation$1,
|
|
39089
|
-
isIdentifier: isIdentifier$
|
|
39147
|
+
isIdentifier: isIdentifier$4
|
|
39090
39148
|
} = lib_exports;
|
|
39091
39149
|
function VariableDeclarator2() {
|
|
39092
39150
|
if (!this.get("id").isIdentifier())
|
|
@@ -39202,7 +39260,7 @@ function CallExpression2() {
|
|
|
39202
39260
|
} = this.node;
|
|
39203
39261
|
if (isObjectKeys(callee)) {
|
|
39204
39262
|
return arrayTypeAnnotation2(stringTypeAnnotation$1());
|
|
39205
|
-
} else if (isArrayFrom(callee) || isObjectValues(callee) || isIdentifier$
|
|
39263
|
+
} else if (isArrayFrom(callee) || isObjectValues(callee) || isIdentifier$4(callee, {
|
|
39206
39264
|
name: "Array"
|
|
39207
39265
|
})) {
|
|
39208
39266
|
return arrayTypeAnnotation2(anyTypeAnnotation$1());
|
|
@@ -39277,16 +39335,16 @@ var {
|
|
|
39277
39335
|
isEmptyTypeAnnotation: isEmptyTypeAnnotation2,
|
|
39278
39336
|
isFlowBaseAnnotation: isFlowBaseAnnotation2,
|
|
39279
39337
|
isGenericTypeAnnotation: isGenericTypeAnnotation2,
|
|
39280
|
-
isIdentifier: isIdentifier$
|
|
39338
|
+
isIdentifier: isIdentifier$3,
|
|
39281
39339
|
isMixedTypeAnnotation: isMixedTypeAnnotation2,
|
|
39282
39340
|
isNumberTypeAnnotation: isNumberTypeAnnotation2,
|
|
39283
39341
|
isStringTypeAnnotation: isStringTypeAnnotation2,
|
|
39284
|
-
isTSArrayType:
|
|
39342
|
+
isTSArrayType: isTSArrayType2,
|
|
39285
39343
|
isTSTypeAnnotation: isTSTypeAnnotation2,
|
|
39286
39344
|
isTSTypeReference: isTSTypeReference2,
|
|
39287
39345
|
isTupleTypeAnnotation: isTupleTypeAnnotation2,
|
|
39288
|
-
isTypeAnnotation:
|
|
39289
|
-
isUnionTypeAnnotation:
|
|
39346
|
+
isTypeAnnotation: isTypeAnnotation2,
|
|
39347
|
+
isUnionTypeAnnotation: isUnionTypeAnnotation2,
|
|
39290
39348
|
isVoidTypeAnnotation: isVoidTypeAnnotation2,
|
|
39291
39349
|
stringTypeAnnotation: stringTypeAnnotation2,
|
|
39292
39350
|
voidTypeAnnotation: voidTypeAnnotation2
|
|
@@ -39297,7 +39355,7 @@ function getTypeAnnotation() {
|
|
|
39297
39355
|
return type;
|
|
39298
39356
|
}
|
|
39299
39357
|
type = this._getTypeAnnotation() || anyTypeAnnotation2();
|
|
39300
|
-
if (
|
|
39358
|
+
if (isTypeAnnotation2(type) || isTSTypeAnnotation2(type)) {
|
|
39301
39359
|
type = type.typeAnnotation;
|
|
39302
39360
|
}
|
|
39303
39361
|
this.setData("typeAnnotation", type);
|
|
@@ -39371,7 +39429,7 @@ function couldBeBaseType(name) {
|
|
|
39371
39429
|
const type = this.getTypeAnnotation();
|
|
39372
39430
|
if (isAnyTypeAnnotation2(type))
|
|
39373
39431
|
return true;
|
|
39374
|
-
if (
|
|
39432
|
+
if (isUnionTypeAnnotation2(type)) {
|
|
39375
39433
|
for (const type2 of type.types) {
|
|
39376
39434
|
if (isAnyTypeAnnotation2(type2) || _isBaseType(name, type2, true)) {
|
|
39377
39435
|
return true;
|
|
@@ -39393,13 +39451,13 @@ function baseTypeStrictlyMatches(rightArg) {
|
|
|
39393
39451
|
function isGenericType(genericName) {
|
|
39394
39452
|
const type = this.getTypeAnnotation();
|
|
39395
39453
|
if (genericName === "Array") {
|
|
39396
|
-
if (
|
|
39454
|
+
if (isTSArrayType2(type) || isArrayTypeAnnotation3(type) || isTupleTypeAnnotation2(type)) {
|
|
39397
39455
|
return true;
|
|
39398
39456
|
}
|
|
39399
39457
|
}
|
|
39400
|
-
return isGenericTypeAnnotation2(type) && isIdentifier$
|
|
39458
|
+
return isGenericTypeAnnotation2(type) && isIdentifier$3(type.id, {
|
|
39401
39459
|
name: genericName
|
|
39402
|
-
}) || isTSTypeReference2(type) && isIdentifier$
|
|
39460
|
+
}) || isTSTypeReference2(type) && isIdentifier$3(type.typeName, {
|
|
39403
39461
|
name: genericName
|
|
39404
39462
|
});
|
|
39405
39463
|
}
|
|
@@ -39418,19 +39476,27 @@ var {
|
|
|
39418
39476
|
assignmentExpression: assignmentExpression$2,
|
|
39419
39477
|
awaitExpression: awaitExpression2,
|
|
39420
39478
|
blockStatement: blockStatement$2,
|
|
39479
|
+
buildUndefinedNode: buildUndefinedNode2,
|
|
39421
39480
|
callExpression: callExpression$2,
|
|
39422
39481
|
cloneNode: cloneNode$2,
|
|
39482
|
+
conditionalExpression: conditionalExpression$1,
|
|
39423
39483
|
expressionStatement: expressionStatement$2,
|
|
39484
|
+
getBindingIdentifiers: getBindingIdentifiers$2,
|
|
39424
39485
|
identifier: identifier$1,
|
|
39425
39486
|
inheritLeadingComments: inheritLeadingComments2,
|
|
39426
39487
|
inheritTrailingComments: inheritTrailingComments2,
|
|
39427
39488
|
inheritsComments: inheritsComments2,
|
|
39428
|
-
|
|
39489
|
+
isBlockStatement: isBlockStatement$1,
|
|
39490
|
+
isEmptyStatement: isEmptyStatement2,
|
|
39491
|
+
isExpression: isExpression$2,
|
|
39492
|
+
isExpressionStatement: isExpressionStatement4,
|
|
39493
|
+
isIfStatement: isIfStatement3,
|
|
39429
39494
|
isProgram: isProgram2,
|
|
39430
|
-
isStatement:
|
|
39495
|
+
isStatement: isStatement4,
|
|
39496
|
+
isVariableDeclaration: isVariableDeclaration2,
|
|
39431
39497
|
removeComments: removeComments2,
|
|
39432
39498
|
returnStatement: returnStatement$1,
|
|
39433
|
-
|
|
39499
|
+
sequenceExpression: sequenceExpression$1,
|
|
39434
39500
|
validate: validate$13,
|
|
39435
39501
|
yieldExpression: yieldExpression2
|
|
39436
39502
|
} = lib_exports;
|
|
@@ -39495,13 +39561,13 @@ function replaceWith(replacementPath) {
|
|
|
39495
39561
|
throw new Error("Don't use `path.replaceWith()` with a source string, use `path.replaceWithSourceString()`");
|
|
39496
39562
|
}
|
|
39497
39563
|
let nodePath = "";
|
|
39498
|
-
if (this.isNodeType("Statement") && isExpression$
|
|
39564
|
+
if (this.isNodeType("Statement") && isExpression$2(replacement)) {
|
|
39499
39565
|
if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement) && !this.parentPath.isExportDefaultDeclaration()) {
|
|
39500
39566
|
replacement = expressionStatement$2(replacement);
|
|
39501
39567
|
nodePath = "expression";
|
|
39502
39568
|
}
|
|
39503
39569
|
}
|
|
39504
|
-
if (this.isNodeType("Expression") &&
|
|
39570
|
+
if (this.isNodeType("Expression") && isStatement4(replacement)) {
|
|
39505
39571
|
if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement)) {
|
|
39506
39572
|
return this.replaceExpressionWithStatements([replacement]);
|
|
39507
39573
|
}
|
|
@@ -39533,9 +39599,14 @@ function _replaceWith(node) {
|
|
|
39533
39599
|
}
|
|
39534
39600
|
function replaceExpressionWithStatements(nodes2) {
|
|
39535
39601
|
this.resync();
|
|
39536
|
-
const
|
|
39537
|
-
|
|
39538
|
-
|
|
39602
|
+
const declars = [];
|
|
39603
|
+
const nodesAsSingleExpression = gatherSequenceExpressions(nodes2, declars);
|
|
39604
|
+
if (nodesAsSingleExpression) {
|
|
39605
|
+
for (const id of declars)
|
|
39606
|
+
this.scope.push({
|
|
39607
|
+
id
|
|
39608
|
+
});
|
|
39609
|
+
return this.replaceWith(nodesAsSingleExpression)[0].get("expressions");
|
|
39539
39610
|
}
|
|
39540
39611
|
const functionParent = this.getFunctionParent();
|
|
39541
39612
|
const isParentAsync = functionParent == null ? void 0 : functionParent.is("async");
|
|
@@ -39583,6 +39654,57 @@ function replaceExpressionWithStatements(nodes2) {
|
|
|
39583
39654
|
}
|
|
39584
39655
|
return newCallee.get("body.body");
|
|
39585
39656
|
}
|
|
39657
|
+
function gatherSequenceExpressions(nodes2, declars) {
|
|
39658
|
+
const exprs = [];
|
|
39659
|
+
let ensureLastUndefined = true;
|
|
39660
|
+
for (const node of nodes2) {
|
|
39661
|
+
if (!isEmptyStatement2(node)) {
|
|
39662
|
+
ensureLastUndefined = false;
|
|
39663
|
+
}
|
|
39664
|
+
if (isExpression$2(node)) {
|
|
39665
|
+
exprs.push(node);
|
|
39666
|
+
} else if (isExpressionStatement4(node)) {
|
|
39667
|
+
exprs.push(node.expression);
|
|
39668
|
+
} else if (isVariableDeclaration2(node)) {
|
|
39669
|
+
if (node.kind !== "var")
|
|
39670
|
+
return;
|
|
39671
|
+
for (const declar of node.declarations) {
|
|
39672
|
+
const bindings = getBindingIdentifiers$2(declar);
|
|
39673
|
+
for (const key of Object.keys(bindings)) {
|
|
39674
|
+
declars.push(cloneNode$2(bindings[key]));
|
|
39675
|
+
}
|
|
39676
|
+
if (declar.init) {
|
|
39677
|
+
exprs.push(assignmentExpression$2("=", declar.id, declar.init));
|
|
39678
|
+
}
|
|
39679
|
+
}
|
|
39680
|
+
ensureLastUndefined = true;
|
|
39681
|
+
} else if (isIfStatement3(node)) {
|
|
39682
|
+
const consequent = node.consequent ? gatherSequenceExpressions([node.consequent], declars) : buildUndefinedNode2();
|
|
39683
|
+
const alternate = node.alternate ? gatherSequenceExpressions([node.alternate], declars) : buildUndefinedNode2();
|
|
39684
|
+
if (!consequent || !alternate)
|
|
39685
|
+
return;
|
|
39686
|
+
exprs.push(conditionalExpression$1(node.test, consequent, alternate));
|
|
39687
|
+
} else if (isBlockStatement$1(node)) {
|
|
39688
|
+
const body = gatherSequenceExpressions(node.body, declars);
|
|
39689
|
+
if (!body)
|
|
39690
|
+
return;
|
|
39691
|
+
exprs.push(body);
|
|
39692
|
+
} else if (isEmptyStatement2(node)) {
|
|
39693
|
+
if (nodes2.indexOf(node) === 0) {
|
|
39694
|
+
ensureLastUndefined = true;
|
|
39695
|
+
}
|
|
39696
|
+
} else {
|
|
39697
|
+
return;
|
|
39698
|
+
}
|
|
39699
|
+
}
|
|
39700
|
+
if (ensureLastUndefined)
|
|
39701
|
+
exprs.push(buildUndefinedNode2());
|
|
39702
|
+
if (exprs.length === 1) {
|
|
39703
|
+
return exprs[0];
|
|
39704
|
+
} else {
|
|
39705
|
+
return sequenceExpression$1(exprs);
|
|
39706
|
+
}
|
|
39707
|
+
}
|
|
39586
39708
|
function replaceInline(nodes2) {
|
|
39587
39709
|
this.resync();
|
|
39588
39710
|
if (Array.isArray(nodes2)) {
|
|
@@ -39975,7 +40097,7 @@ var {
|
|
|
39975
40097
|
conditionalExpression: conditionalExpression2,
|
|
39976
40098
|
expressionStatement: expressionStatement$1,
|
|
39977
40099
|
identifier: identifier6,
|
|
39978
|
-
isIdentifier: isIdentifier$
|
|
40100
|
+
isIdentifier: isIdentifier$22,
|
|
39979
40101
|
jsxIdentifier: jsxIdentifier2,
|
|
39980
40102
|
logicalExpression: logicalExpression2,
|
|
39981
40103
|
LOGICAL_OPERATORS: LOGICAL_OPERATORS2,
|
|
@@ -40003,7 +40125,7 @@ function toComputedKey2() {
|
|
|
40003
40125
|
throw new ReferenceError("todo");
|
|
40004
40126
|
}
|
|
40005
40127
|
if (!this.node.computed) {
|
|
40006
|
-
if (isIdentifier$
|
|
40128
|
+
if (isIdentifier$22(key))
|
|
40007
40129
|
key = stringLiteral3(key.name);
|
|
40008
40130
|
}
|
|
40009
40131
|
return key;
|
|
@@ -40435,8 +40557,8 @@ var {
|
|
|
40435
40557
|
STATEMENT_OR_BLOCK_KEYS: STATEMENT_OR_BLOCK_KEYS2,
|
|
40436
40558
|
VISITOR_KEYS: VISITOR_KEYS$3,
|
|
40437
40559
|
isBlockStatement: isBlockStatement3,
|
|
40438
|
-
isExpression: isExpression$
|
|
40439
|
-
isIdentifier: isIdentifier$
|
|
40560
|
+
isExpression: isExpression$1,
|
|
40561
|
+
isIdentifier: isIdentifier$12,
|
|
40440
40562
|
isLiteral: isLiteral4,
|
|
40441
40563
|
isStringLiteral: isStringLiteral4,
|
|
40442
40564
|
isType: isType3,
|
|
@@ -40476,7 +40598,7 @@ function canSwapBetweenExpressionAndStatement(replacement) {
|
|
|
40476
40598
|
if (this.isExpression()) {
|
|
40477
40599
|
return isBlockStatement3(replacement);
|
|
40478
40600
|
} else if (this.isBlockStatement()) {
|
|
40479
|
-
return isExpression$
|
|
40601
|
+
return isExpression$1(replacement);
|
|
40480
40602
|
}
|
|
40481
40603
|
return false;
|
|
40482
40604
|
}
|
|
@@ -40534,7 +40656,7 @@ function referencesImport(moduleSource, importName) {
|
|
|
40534
40656
|
if (path.isImportNamespaceSpecifier() && importName === "*") {
|
|
40535
40657
|
return true;
|
|
40536
40658
|
}
|
|
40537
|
-
if (path.isImportSpecifier() && isIdentifier$
|
|
40659
|
+
if (path.isImportSpecifier() && isIdentifier$12(path.node.imported, {
|
|
40538
40660
|
name: importName
|
|
40539
40661
|
})) {
|
|
40540
40662
|
return true;
|
|
@@ -41090,6 +41212,9 @@ var hooks = [function(self, parent) {
|
|
|
41090
41212
|
return true;
|
|
41091
41213
|
}
|
|
41092
41214
|
}];
|
|
41215
|
+
var {
|
|
41216
|
+
getBindingIdentifiers: getBindingIdentifiers$1
|
|
41217
|
+
} = lib_exports;
|
|
41093
41218
|
function remove() {
|
|
41094
41219
|
var _a;
|
|
41095
41220
|
this._assertUnremoved();
|
|
@@ -41106,7 +41231,7 @@ function remove() {
|
|
|
41106
41231
|
this._markRemoved();
|
|
41107
41232
|
}
|
|
41108
41233
|
function _removeFromScope() {
|
|
41109
|
-
const bindings = this.
|
|
41234
|
+
const bindings = getBindingIdentifiers$1(this.node, false, false, true);
|
|
41110
41235
|
Object.keys(bindings).forEach((name) => this.scope.removeBinding(name));
|
|
41111
41236
|
}
|
|
41112
41237
|
function _callRemovalHooks() {
|
|
@@ -41145,7 +41270,7 @@ var NodePath_removal = /* @__PURE__ */ Object.freeze({
|
|
|
41145
41270
|
remove
|
|
41146
41271
|
});
|
|
41147
41272
|
var {
|
|
41148
|
-
react:
|
|
41273
|
+
react: react2
|
|
41149
41274
|
} = lib_exports;
|
|
41150
41275
|
var {
|
|
41151
41276
|
cloneNode: cloneNode$1,
|
|
@@ -41155,7 +41280,7 @@ var {
|
|
|
41155
41280
|
} = lib_exports;
|
|
41156
41281
|
var referenceVisitor = {
|
|
41157
41282
|
ReferencedIdentifier(path, state) {
|
|
41158
|
-
if (path.isJSXIdentifier() &&
|
|
41283
|
+
if (path.isJSXIdentifier() && react2.isCompatTag(path.node.name) && !path.parentPath.isJSXMemberExpression()) {
|
|
41159
41284
|
return;
|
|
41160
41285
|
}
|
|
41161
41286
|
if (path.node.name === "this") {
|
|
@@ -41329,9 +41454,9 @@ var {
|
|
|
41329
41454
|
isAssignmentExpression: isAssignmentExpression4,
|
|
41330
41455
|
isCallExpression: isCallExpression4,
|
|
41331
41456
|
isExportNamedDeclaration: isExportNamedDeclaration3,
|
|
41332
|
-
isExpression:
|
|
41333
|
-
isIdentifier:
|
|
41334
|
-
isSequenceExpression:
|
|
41457
|
+
isExpression: isExpression2,
|
|
41458
|
+
isIdentifier: isIdentifier5,
|
|
41459
|
+
isSequenceExpression: isSequenceExpression2,
|
|
41335
41460
|
isSuper: isSuper2,
|
|
41336
41461
|
thisExpression: thisExpression2
|
|
41337
41462
|
} = lib_exports;
|
|
@@ -41390,10 +41515,10 @@ function _containerInsertAfter(nodes2) {
|
|
|
41390
41515
|
}
|
|
41391
41516
|
var last = (arr) => arr[arr.length - 1];
|
|
41392
41517
|
function isHiddenInSequenceExpression(path) {
|
|
41393
|
-
return
|
|
41518
|
+
return isSequenceExpression2(path.parent) && (last(path.parent.expressions) !== path.node || isHiddenInSequenceExpression(path.parentPath));
|
|
41394
41519
|
}
|
|
41395
41520
|
function isAlmostConstantAssignment(node, scope2) {
|
|
41396
|
-
if (!isAssignmentExpression4(node) || !
|
|
41521
|
+
if (!isAssignmentExpression4(node) || !isIdentifier5(node.left)) {
|
|
41397
41522
|
return false;
|
|
41398
41523
|
}
|
|
41399
41524
|
const blockScope = scope2.getBlockParent();
|
|
@@ -41411,7 +41536,7 @@ function insertAfter(nodes_) {
|
|
|
41411
41536
|
} = this;
|
|
41412
41537
|
if (parentPath.isExpressionStatement() || parentPath.isLabeledStatement() || isExportNamedDeclaration3(parent) || parentPath.isExportDefaultDeclaration() && this.isDeclaration()) {
|
|
41413
41538
|
return parentPath.insertAfter(nodes2.map((node) => {
|
|
41414
|
-
return
|
|
41539
|
+
return isExpression2(node) ? expressionStatement4(node) : node;
|
|
41415
41540
|
}));
|
|
41416
41541
|
} else if (this.isNodeType("Expression") && !this.isJSXElement() && !parentPath.isJSXElement() || parentPath.isForStatement() && this.key === "init") {
|
|
41417
41542
|
if (this.node) {
|
|
@@ -41904,14 +42029,11 @@ function shareCommentsWithSiblings() {
|
|
|
41904
42029
|
}
|
|
41905
42030
|
}
|
|
41906
42031
|
function removeIfExisting(list, toRemove) {
|
|
41907
|
-
if (!toRemove)
|
|
42032
|
+
if (!(toRemove == null ? void 0 : toRemove.length))
|
|
41908
42033
|
return list;
|
|
41909
|
-
|
|
42034
|
+
const set = new Set(toRemove);
|
|
41910
42035
|
return list.filter((el) => {
|
|
41911
|
-
|
|
41912
|
-
if (i === -1)
|
|
41913
|
-
return true;
|
|
41914
|
-
lastFoundIndex = i;
|
|
42036
|
+
return !set.has(el);
|
|
41915
42037
|
});
|
|
41916
42038
|
}
|
|
41917
42039
|
function addComment2(type, content, line) {
|
|
@@ -41926,157 +42048,6 @@ var NodePath_comments = /* @__PURE__ */ Object.freeze({
|
|
|
41926
42048
|
addComments: addComments2,
|
|
41927
42049
|
shareCommentsWithSiblings
|
|
41928
42050
|
});
|
|
41929
|
-
var {
|
|
41930
|
-
isBinding: isBinding2,
|
|
41931
|
-
isBlockScoped: nodeIsBlockScoped,
|
|
41932
|
-
isExportDeclaration: isExportDeclaration3,
|
|
41933
|
-
isExpression: nodeIsExpression,
|
|
41934
|
-
isFlow: nodeIsFlow,
|
|
41935
|
-
isForStatement: isForStatement3,
|
|
41936
|
-
isForXStatement: isForXStatement2,
|
|
41937
|
-
isIdentifier: isIdentifier5,
|
|
41938
|
-
isImportDeclaration: isImportDeclaration2,
|
|
41939
|
-
isImportSpecifier: isImportSpecifier2,
|
|
41940
|
-
isJSXIdentifier: isJSXIdentifier3,
|
|
41941
|
-
isJSXMemberExpression: isJSXMemberExpression2,
|
|
41942
|
-
isMemberExpression: isMemberExpression3,
|
|
41943
|
-
isRestElement: nodeIsRestElement,
|
|
41944
|
-
isReferenced: nodeIsReferenced,
|
|
41945
|
-
isScope: nodeIsScope,
|
|
41946
|
-
isStatement: nodeIsStatement,
|
|
41947
|
-
isVar: nodeIsVar,
|
|
41948
|
-
isVariableDeclaration: isVariableDeclaration2,
|
|
41949
|
-
react: react2,
|
|
41950
|
-
isForOfStatement: isForOfStatement3
|
|
41951
|
-
} = lib_exports;
|
|
41952
|
-
var {
|
|
41953
|
-
isCompatTag: isCompatTag2
|
|
41954
|
-
} = react2;
|
|
41955
|
-
function isReferencedIdentifier(opts) {
|
|
41956
|
-
const {
|
|
41957
|
-
node,
|
|
41958
|
-
parent
|
|
41959
|
-
} = this;
|
|
41960
|
-
if (!isIdentifier5(node, opts) && !isJSXMemberExpression2(parent, opts)) {
|
|
41961
|
-
if (isJSXIdentifier3(node, opts)) {
|
|
41962
|
-
if (isCompatTag2(node.name))
|
|
41963
|
-
return false;
|
|
41964
|
-
} else {
|
|
41965
|
-
return false;
|
|
41966
|
-
}
|
|
41967
|
-
}
|
|
41968
|
-
return nodeIsReferenced(node, parent, this.parentPath.parent);
|
|
41969
|
-
}
|
|
41970
|
-
function isReferencedMemberExpression() {
|
|
41971
|
-
const {
|
|
41972
|
-
node,
|
|
41973
|
-
parent
|
|
41974
|
-
} = this;
|
|
41975
|
-
return isMemberExpression3(node) && nodeIsReferenced(node, parent);
|
|
41976
|
-
}
|
|
41977
|
-
function isBindingIdentifier() {
|
|
41978
|
-
const {
|
|
41979
|
-
node,
|
|
41980
|
-
parent
|
|
41981
|
-
} = this;
|
|
41982
|
-
const grandparent = this.parentPath.parent;
|
|
41983
|
-
return isIdentifier5(node) && isBinding2(node, parent, grandparent);
|
|
41984
|
-
}
|
|
41985
|
-
function isStatement4() {
|
|
41986
|
-
const {
|
|
41987
|
-
node,
|
|
41988
|
-
parent
|
|
41989
|
-
} = this;
|
|
41990
|
-
if (nodeIsStatement(node)) {
|
|
41991
|
-
if (isVariableDeclaration2(node)) {
|
|
41992
|
-
if (isForXStatement2(parent, {
|
|
41993
|
-
left: node
|
|
41994
|
-
}))
|
|
41995
|
-
return false;
|
|
41996
|
-
if (isForStatement3(parent, {
|
|
41997
|
-
init: node
|
|
41998
|
-
}))
|
|
41999
|
-
return false;
|
|
42000
|
-
}
|
|
42001
|
-
return true;
|
|
42002
|
-
} else {
|
|
42003
|
-
return false;
|
|
42004
|
-
}
|
|
42005
|
-
}
|
|
42006
|
-
function isExpression2() {
|
|
42007
|
-
if (this.isIdentifier()) {
|
|
42008
|
-
return this.isReferencedIdentifier();
|
|
42009
|
-
} else {
|
|
42010
|
-
return nodeIsExpression(this.node);
|
|
42011
|
-
}
|
|
42012
|
-
}
|
|
42013
|
-
function isScope2() {
|
|
42014
|
-
return nodeIsScope(this.node, this.parent);
|
|
42015
|
-
}
|
|
42016
|
-
function isReferenced2() {
|
|
42017
|
-
return nodeIsReferenced(this.node, this.parent);
|
|
42018
|
-
}
|
|
42019
|
-
function isBlockScoped2() {
|
|
42020
|
-
return nodeIsBlockScoped(this.node);
|
|
42021
|
-
}
|
|
42022
|
-
function isVar2() {
|
|
42023
|
-
return nodeIsVar(this.node);
|
|
42024
|
-
}
|
|
42025
|
-
function isUser() {
|
|
42026
|
-
return this.node && !!this.node.loc;
|
|
42027
|
-
}
|
|
42028
|
-
function isGenerated() {
|
|
42029
|
-
return !this.isUser();
|
|
42030
|
-
}
|
|
42031
|
-
function isPure(constantsOnly) {
|
|
42032
|
-
return this.scope.isPure(this.node, constantsOnly);
|
|
42033
|
-
}
|
|
42034
|
-
function isFlow2() {
|
|
42035
|
-
const {
|
|
42036
|
-
node
|
|
42037
|
-
} = this;
|
|
42038
|
-
if (nodeIsFlow(node)) {
|
|
42039
|
-
return true;
|
|
42040
|
-
} else if (isImportDeclaration2(node)) {
|
|
42041
|
-
return node.importKind === "type" || node.importKind === "typeof";
|
|
42042
|
-
} else if (isExportDeclaration3(node)) {
|
|
42043
|
-
return node.exportKind === "type";
|
|
42044
|
-
} else if (isImportSpecifier2(node)) {
|
|
42045
|
-
return node.importKind === "type" || node.importKind === "typeof";
|
|
42046
|
-
} else {
|
|
42047
|
-
return false;
|
|
42048
|
-
}
|
|
42049
|
-
}
|
|
42050
|
-
function isRestProperty2() {
|
|
42051
|
-
return nodeIsRestElement(this.node) && this.parentPath && this.parentPath.isObjectPattern();
|
|
42052
|
-
}
|
|
42053
|
-
function isSpreadProperty2() {
|
|
42054
|
-
return nodeIsRestElement(this.node) && this.parentPath && this.parentPath.isObjectExpression();
|
|
42055
|
-
}
|
|
42056
|
-
function isForAwaitStatement() {
|
|
42057
|
-
return isForOfStatement3(this.node, {
|
|
42058
|
-
await: true
|
|
42059
|
-
});
|
|
42060
|
-
}
|
|
42061
|
-
var NodePath_virtual_types_validator = /* @__PURE__ */ Object.freeze({
|
|
42062
|
-
__proto__: null,
|
|
42063
|
-
isBindingIdentifier,
|
|
42064
|
-
isBlockScoped: isBlockScoped2,
|
|
42065
|
-
isExpression: isExpression2,
|
|
42066
|
-
isFlow: isFlow2,
|
|
42067
|
-
isForAwaitStatement,
|
|
42068
|
-
isGenerated,
|
|
42069
|
-
isPure,
|
|
42070
|
-
isReferenced: isReferenced2,
|
|
42071
|
-
isReferencedIdentifier,
|
|
42072
|
-
isReferencedMemberExpression,
|
|
42073
|
-
isRestProperty: isRestProperty2,
|
|
42074
|
-
isScope: isScope2,
|
|
42075
|
-
isSpreadProperty: isSpreadProperty2,
|
|
42076
|
-
isStatement: isStatement4,
|
|
42077
|
-
isUser,
|
|
42078
|
-
isVar: isVar2
|
|
42079
|
-
});
|
|
42080
42051
|
var {
|
|
42081
42052
|
validate: validate3
|
|
42082
42053
|
} = lib_exports;
|