@delance/builder 0.3.6 → 0.3.7
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/dist/cli.js +4 -1
- package/dist/index.js +183 -247
- package/package.json +32 -24
package/dist/cli.js
CHANGED
|
@@ -94,7 +94,10 @@ if (!process.isBun) {
|
|
|
94
94
|
async function main(argv2) {
|
|
95
95
|
debug.enable("*,-babel");
|
|
96
96
|
const cwd = argv2.pop();
|
|
97
|
-
for await (const x of new Bun.Glob("
|
|
97
|
+
for await (const x of new Bun.Glob("*.bundle.js").scan({ absolute: true, cwd })) {
|
|
98
|
+
if (x.includes("browser.")) {
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
98
101
|
console.group(`${magenta("> build")} ${dim(x)}`);
|
|
99
102
|
const label = `${bgBlue(white(" Processed "))} ${dim(x)}`;
|
|
100
103
|
console.time(label);
|
package/dist/index.js
CHANGED
|
@@ -533,8 +533,7 @@ class ArrayExpressionMatcher extends Matcher {
|
|
|
533
533
|
if (!t12.isNode(node) || !t12.isArrayExpression(node)) {
|
|
534
534
|
return false;
|
|
535
535
|
}
|
|
536
|
-
if (typeof this.elements === "undefined") {
|
|
537
|
-
} else if (Array.isArray(this.elements)) {
|
|
536
|
+
if (typeof this.elements === "undefined") {} else if (Array.isArray(this.elements)) {
|
|
538
537
|
if (!tupleOf(...this.elements).matchValue(node.elements, [
|
|
539
538
|
...keys,
|
|
540
539
|
"elements"
|
|
@@ -561,8 +560,7 @@ class ArrayPatternMatcher extends Matcher {
|
|
|
561
560
|
if (!t12.isNode(node) || !t12.isArrayPattern(node)) {
|
|
562
561
|
return false;
|
|
563
562
|
}
|
|
564
|
-
if (typeof this.elements === "undefined") {
|
|
565
|
-
} else if (Array.isArray(this.elements)) {
|
|
563
|
+
if (typeof this.elements === "undefined") {} else if (Array.isArray(this.elements)) {
|
|
566
564
|
if (!tupleOf(...this.elements).matchValue(node.elements, [
|
|
567
565
|
...keys,
|
|
568
566
|
"elements"
|
|
@@ -592,8 +590,7 @@ class ArrowFunctionExpressionMatcher extends Matcher {
|
|
|
592
590
|
if (!t12.isNode(node) || !t12.isArrowFunctionExpression(node)) {
|
|
593
591
|
return false;
|
|
594
592
|
}
|
|
595
|
-
if (typeof this.params === "undefined") {
|
|
596
|
-
} else if (Array.isArray(this.params)) {
|
|
593
|
+
if (typeof this.params === "undefined") {} else if (Array.isArray(this.params)) {
|
|
597
594
|
if (!tupleOf(...this.params).matchValue(node.params, [
|
|
598
595
|
...keys,
|
|
599
596
|
"params"
|
|
@@ -603,12 +600,10 @@ class ArrowFunctionExpressionMatcher extends Matcher {
|
|
|
603
600
|
} else if (!this.params.matchValue(node.params, [...keys, "params"])) {
|
|
604
601
|
return false;
|
|
605
602
|
}
|
|
606
|
-
if (typeof this.body === "undefined") {
|
|
607
|
-
} else if (!this.body.matchValue(node.body, [...keys, "body"])) {
|
|
603
|
+
if (typeof this.body === "undefined") {} else if (!this.body.matchValue(node.body, [...keys, "body"])) {
|
|
608
604
|
return false;
|
|
609
605
|
}
|
|
610
|
-
if (typeof this.async === "undefined") {
|
|
611
|
-
} else if (typeof this.async === "boolean") {
|
|
606
|
+
if (typeof this.async === "undefined") {} else if (typeof this.async === "boolean") {
|
|
612
607
|
if (this.async !== node.async) {
|
|
613
608
|
return false;
|
|
614
609
|
}
|
|
@@ -636,20 +631,17 @@ class AssignmentExpressionMatcher extends Matcher {
|
|
|
636
631
|
if (!t12.isNode(node) || !t12.isAssignmentExpression(node)) {
|
|
637
632
|
return false;
|
|
638
633
|
}
|
|
639
|
-
if (typeof this.operator === "undefined") {
|
|
640
|
-
} else if (typeof this.operator === "string") {
|
|
634
|
+
if (typeof this.operator === "undefined") {} else if (typeof this.operator === "string") {
|
|
641
635
|
if (this.operator !== node.operator) {
|
|
642
636
|
return false;
|
|
643
637
|
}
|
|
644
638
|
} else if (!this.operator.matchValue(node.operator, [...keys, "operator"])) {
|
|
645
639
|
return false;
|
|
646
640
|
}
|
|
647
|
-
if (typeof this.left === "undefined") {
|
|
648
|
-
} else if (!this.left.matchValue(node.left, [...keys, "left"])) {
|
|
641
|
+
if (typeof this.left === "undefined") {} else if (!this.left.matchValue(node.left, [...keys, "left"])) {
|
|
649
642
|
return false;
|
|
650
643
|
}
|
|
651
|
-
if (typeof this.right === "undefined") {
|
|
652
|
-
} else if (!this.right.matchValue(node.right, [...keys, "right"])) {
|
|
644
|
+
if (typeof this.right === "undefined") {} else if (!this.right.matchValue(node.right, [...keys, "right"])) {
|
|
653
645
|
return false;
|
|
654
646
|
}
|
|
655
647
|
return true;
|
|
@@ -672,20 +664,17 @@ class BinaryExpressionMatcher extends Matcher {
|
|
|
672
664
|
if (!t12.isNode(node) || !t12.isBinaryExpression(node)) {
|
|
673
665
|
return false;
|
|
674
666
|
}
|
|
675
|
-
if (typeof this.operator === "undefined") {
|
|
676
|
-
} else if (typeof this.operator === "string") {
|
|
667
|
+
if (typeof this.operator === "undefined") {} else if (typeof this.operator === "string") {
|
|
677
668
|
if (this.operator !== node.operator) {
|
|
678
669
|
return false;
|
|
679
670
|
}
|
|
680
671
|
} else if (!this.operator.matchValue(node.operator, [...keys, "operator"])) {
|
|
681
672
|
return false;
|
|
682
673
|
}
|
|
683
|
-
if (typeof this.left === "undefined") {
|
|
684
|
-
} else if (!this.left.matchValue(node.left, [...keys, "left"])) {
|
|
674
|
+
if (typeof this.left === "undefined") {} else if (!this.left.matchValue(node.left, [...keys, "left"])) {
|
|
685
675
|
return false;
|
|
686
676
|
}
|
|
687
|
-
if (typeof this.right === "undefined") {
|
|
688
|
-
} else if (!this.right.matchValue(node.right, [...keys, "right"])) {
|
|
677
|
+
if (typeof this.right === "undefined") {} else if (!this.right.matchValue(node.right, [...keys, "right"])) {
|
|
689
678
|
return false;
|
|
690
679
|
}
|
|
691
680
|
return true;
|
|
@@ -706,16 +695,14 @@ class BlockStatementMatcher extends Matcher {
|
|
|
706
695
|
if (!t12.isNode(node) || !t12.isBlockStatement(node)) {
|
|
707
696
|
return false;
|
|
708
697
|
}
|
|
709
|
-
if (typeof this.body === "undefined") {
|
|
710
|
-
} else if (Array.isArray(this.body)) {
|
|
698
|
+
if (typeof this.body === "undefined") {} else if (Array.isArray(this.body)) {
|
|
711
699
|
if (!tupleOf(...this.body).matchValue(node.body, [...keys, "body"])) {
|
|
712
700
|
return false;
|
|
713
701
|
}
|
|
714
702
|
} else if (!this.body.matchValue(node.body, [...keys, "body"])) {
|
|
715
703
|
return false;
|
|
716
704
|
}
|
|
717
|
-
if (typeof this.directives === "undefined") {
|
|
718
|
-
} else if (Array.isArray(this.directives)) {
|
|
705
|
+
if (typeof this.directives === "undefined") {} else if (Array.isArray(this.directives)) {
|
|
719
706
|
if (!tupleOf(...this.directives).matchValue(node.directives, [
|
|
720
707
|
...keys,
|
|
721
708
|
"directives"
|
|
@@ -742,8 +729,7 @@ class BooleanLiteralMatcher extends Matcher {
|
|
|
742
729
|
if (!t12.isNode(node) || !t12.isBooleanLiteral(node)) {
|
|
743
730
|
return false;
|
|
744
731
|
}
|
|
745
|
-
if (typeof this.value === "undefined") {
|
|
746
|
-
} else if (typeof this.value === "boolean") {
|
|
732
|
+
if (typeof this.value === "undefined") {} else if (typeof this.value === "boolean") {
|
|
747
733
|
if (this.value !== node.value) {
|
|
748
734
|
return false;
|
|
749
735
|
}
|
|
@@ -766,8 +752,7 @@ class BreakStatementMatcher extends Matcher {
|
|
|
766
752
|
if (!t12.isNode(node) || !t12.isBreakStatement(node)) {
|
|
767
753
|
return false;
|
|
768
754
|
}
|
|
769
|
-
if (typeof this.label === "undefined") {
|
|
770
|
-
} else if (this.label === null) {
|
|
755
|
+
if (typeof this.label === "undefined") {} else if (this.label === null) {
|
|
771
756
|
if (node.label !== null) {
|
|
772
757
|
return false;
|
|
773
758
|
}
|
|
@@ -793,12 +778,10 @@ class CallExpressionMatcher extends Matcher {
|
|
|
793
778
|
if (!t12.isNode(node) || !t12.isCallExpression(node)) {
|
|
794
779
|
return false;
|
|
795
780
|
}
|
|
796
|
-
if (typeof this.callee === "undefined") {
|
|
797
|
-
} else if (!this.callee.matchValue(node.callee, [...keys, "callee"])) {
|
|
781
|
+
if (typeof this.callee === "undefined") {} else if (!this.callee.matchValue(node.callee, [...keys, "callee"])) {
|
|
798
782
|
return false;
|
|
799
783
|
}
|
|
800
|
-
if (typeof this._arguments === "undefined") {
|
|
801
|
-
} else if (Array.isArray(this._arguments)) {
|
|
784
|
+
if (typeof this._arguments === "undefined") {} else if (Array.isArray(this._arguments)) {
|
|
802
785
|
if (!tupleOf(...this._arguments).matchValue(node.arguments, [
|
|
803
786
|
...keys,
|
|
804
787
|
"arguments"
|
|
@@ -824,8 +807,7 @@ class ClassBodyMatcher extends Matcher {
|
|
|
824
807
|
if (!t12.isNode(node) || !t12.isClassBody(node)) {
|
|
825
808
|
return false;
|
|
826
809
|
}
|
|
827
|
-
if (typeof this.body === "undefined") {
|
|
828
|
-
} else if (Array.isArray(this.body)) {
|
|
810
|
+
if (typeof this.body === "undefined") {} else if (Array.isArray(this.body)) {
|
|
829
811
|
if (!tupleOf(...this.body).matchValue(node.body, [...keys, "body"])) {
|
|
830
812
|
return false;
|
|
831
813
|
}
|
|
@@ -862,20 +844,17 @@ class ClassMethodMatcher extends Matcher {
|
|
|
862
844
|
if (!t12.isNode(node) || !t12.isClassMethod(node)) {
|
|
863
845
|
return false;
|
|
864
846
|
}
|
|
865
|
-
if (typeof this.kind === "undefined") {
|
|
866
|
-
} else if (typeof this.kind === "string") {
|
|
847
|
+
if (typeof this.kind === "undefined") {} else if (typeof this.kind === "string") {
|
|
867
848
|
if (this.kind !== node.kind) {
|
|
868
849
|
return false;
|
|
869
850
|
}
|
|
870
851
|
} else if (!this.kind.matchValue(node.kind, [...keys, "kind"])) {
|
|
871
852
|
return false;
|
|
872
853
|
}
|
|
873
|
-
if (typeof this.key === "undefined") {
|
|
874
|
-
} else if (!this.key.matchValue(node.key, [...keys, "key"])) {
|
|
854
|
+
if (typeof this.key === "undefined") {} else if (!this.key.matchValue(node.key, [...keys, "key"])) {
|
|
875
855
|
return false;
|
|
876
856
|
}
|
|
877
|
-
if (typeof this.params === "undefined") {
|
|
878
|
-
} else if (Array.isArray(this.params)) {
|
|
857
|
+
if (typeof this.params === "undefined") {} else if (Array.isArray(this.params)) {
|
|
879
858
|
if (!tupleOf(...this.params).matchValue(node.params, [
|
|
880
859
|
...keys,
|
|
881
860
|
"params"
|
|
@@ -885,36 +864,31 @@ class ClassMethodMatcher extends Matcher {
|
|
|
885
864
|
} else if (!this.params.matchValue(node.params, [...keys, "params"])) {
|
|
886
865
|
return false;
|
|
887
866
|
}
|
|
888
|
-
if (typeof this.body === "undefined") {
|
|
889
|
-
} else if (!this.body.matchValue(node.body, [...keys, "body"])) {
|
|
867
|
+
if (typeof this.body === "undefined") {} else if (!this.body.matchValue(node.body, [...keys, "body"])) {
|
|
890
868
|
return false;
|
|
891
869
|
}
|
|
892
|
-
if (typeof this.computed === "undefined") {
|
|
893
|
-
} else if (typeof this.computed === "boolean") {
|
|
870
|
+
if (typeof this.computed === "undefined") {} else if (typeof this.computed === "boolean") {
|
|
894
871
|
if (this.computed !== node.computed) {
|
|
895
872
|
return false;
|
|
896
873
|
}
|
|
897
874
|
} else if (!this.computed.matchValue(node.computed, [...keys, "computed"])) {
|
|
898
875
|
return false;
|
|
899
876
|
}
|
|
900
|
-
if (typeof this._static === "undefined") {
|
|
901
|
-
} else if (typeof this._static === "boolean") {
|
|
877
|
+
if (typeof this._static === "undefined") {} else if (typeof this._static === "boolean") {
|
|
902
878
|
if (this._static !== node.static) {
|
|
903
879
|
return false;
|
|
904
880
|
}
|
|
905
881
|
} else if (!this._static.matchValue(node.static, [...keys, "static"])) {
|
|
906
882
|
return false;
|
|
907
883
|
}
|
|
908
|
-
if (typeof this.generator === "undefined") {
|
|
909
|
-
} else if (typeof this.generator === "boolean") {
|
|
884
|
+
if (typeof this.generator === "undefined") {} else if (typeof this.generator === "boolean") {
|
|
910
885
|
if (this.generator !== node.generator) {
|
|
911
886
|
return false;
|
|
912
887
|
}
|
|
913
888
|
} else if (!this.generator.matchValue(node.generator, [...keys, "generator"])) {
|
|
914
889
|
return false;
|
|
915
890
|
}
|
|
916
|
-
if (typeof this.async === "undefined") {
|
|
917
|
-
} else if (typeof this.async === "boolean") {
|
|
891
|
+
if (typeof this.async === "undefined") {} else if (typeof this.async === "boolean") {
|
|
918
892
|
if (this.async !== node.async) {
|
|
919
893
|
return false;
|
|
920
894
|
}
|
|
@@ -947,20 +921,17 @@ class ClassPropertyMatcher extends Matcher {
|
|
|
947
921
|
if (!t12.isNode(node) || !t12.isClassProperty(node)) {
|
|
948
922
|
return false;
|
|
949
923
|
}
|
|
950
|
-
if (typeof this.key === "undefined") {
|
|
951
|
-
} else if (!this.key.matchValue(node.key, [...keys, "key"])) {
|
|
924
|
+
if (typeof this.key === "undefined") {} else if (!this.key.matchValue(node.key, [...keys, "key"])) {
|
|
952
925
|
return false;
|
|
953
926
|
}
|
|
954
|
-
if (typeof this.value === "undefined") {
|
|
955
|
-
} else if (this.value === null) {
|
|
927
|
+
if (typeof this.value === "undefined") {} else if (this.value === null) {
|
|
956
928
|
if (node.value !== null) {
|
|
957
929
|
return false;
|
|
958
930
|
}
|
|
959
931
|
} else if (!this.value.matchValue(node.value, [...keys, "value"])) {
|
|
960
932
|
return false;
|
|
961
933
|
}
|
|
962
|
-
if (typeof this.typeAnnotation === "undefined") {
|
|
963
|
-
} else if (this.typeAnnotation === null) {
|
|
934
|
+
if (typeof this.typeAnnotation === "undefined") {} else if (this.typeAnnotation === null) {
|
|
964
935
|
if (node.typeAnnotation !== null) {
|
|
965
936
|
return false;
|
|
966
937
|
}
|
|
@@ -970,8 +941,7 @@ class ClassPropertyMatcher extends Matcher {
|
|
|
970
941
|
])) {
|
|
971
942
|
return false;
|
|
972
943
|
}
|
|
973
|
-
if (typeof this.decorators === "undefined") {
|
|
974
|
-
} else if (this.decorators === null) {
|
|
944
|
+
if (typeof this.decorators === "undefined") {} else if (this.decorators === null) {
|
|
975
945
|
if (node.decorators !== null) {
|
|
976
946
|
return false;
|
|
977
947
|
}
|
|
@@ -985,16 +955,14 @@ class ClassPropertyMatcher extends Matcher {
|
|
|
985
955
|
} else if (!this.decorators.matchValue(node.decorators, [...keys, "decorators"])) {
|
|
986
956
|
return false;
|
|
987
957
|
}
|
|
988
|
-
if (typeof this.computed === "undefined") {
|
|
989
|
-
} else if (typeof this.computed === "boolean") {
|
|
958
|
+
if (typeof this.computed === "undefined") {} else if (typeof this.computed === "boolean") {
|
|
990
959
|
if (this.computed !== node.computed) {
|
|
991
960
|
return false;
|
|
992
961
|
}
|
|
993
962
|
} else if (!this.computed.matchValue(node.computed, [...keys, "computed"])) {
|
|
994
963
|
return false;
|
|
995
964
|
}
|
|
996
|
-
if (typeof this._static === "undefined") {
|
|
997
|
-
} else if (typeof this._static === "boolean") {
|
|
965
|
+
if (typeof this._static === "undefined") {} else if (typeof this._static === "boolean") {
|
|
998
966
|
if (this._static !== node.static) {
|
|
999
967
|
return false;
|
|
1000
968
|
}
|
|
@@ -1022,16 +990,13 @@ class ConditionalExpressionMatcher extends Matcher {
|
|
|
1022
990
|
if (!t12.isNode(node) || !t12.isConditionalExpression(node)) {
|
|
1023
991
|
return false;
|
|
1024
992
|
}
|
|
1025
|
-
if (typeof this.test === "undefined") {
|
|
1026
|
-
} else if (!this.test.matchValue(node.test, [...keys, "test"])) {
|
|
993
|
+
if (typeof this.test === "undefined") {} else if (!this.test.matchValue(node.test, [...keys, "test"])) {
|
|
1027
994
|
return false;
|
|
1028
995
|
}
|
|
1029
|
-
if (typeof this.consequent === "undefined") {
|
|
1030
|
-
} else if (!this.consequent.matchValue(node.consequent, [...keys, "consequent"])) {
|
|
996
|
+
if (typeof this.consequent === "undefined") {} else if (!this.consequent.matchValue(node.consequent, [...keys, "consequent"])) {
|
|
1031
997
|
return false;
|
|
1032
998
|
}
|
|
1033
|
-
if (typeof this.alternate === "undefined") {
|
|
1034
|
-
} else if (!this.alternate.matchValue(node.alternate, [...keys, "alternate"])) {
|
|
999
|
+
if (typeof this.alternate === "undefined") {} else if (!this.alternate.matchValue(node.alternate, [...keys, "alternate"])) {
|
|
1035
1000
|
return false;
|
|
1036
1001
|
}
|
|
1037
1002
|
return true;
|
|
@@ -1051,8 +1016,7 @@ class ContinueStatementMatcher extends Matcher {
|
|
|
1051
1016
|
if (!t12.isNode(node) || !t12.isContinueStatement(node)) {
|
|
1052
1017
|
return false;
|
|
1053
1018
|
}
|
|
1054
|
-
if (typeof this.label === "undefined") {
|
|
1055
|
-
} else if (this.label === null) {
|
|
1019
|
+
if (typeof this.label === "undefined") {} else if (this.label === null) {
|
|
1056
1020
|
if (node.label !== null) {
|
|
1057
1021
|
return false;
|
|
1058
1022
|
}
|
|
@@ -1077,12 +1041,10 @@ class DoWhileStatementMatcher extends Matcher {
|
|
|
1077
1041
|
if (!t12.isNode(node) || !t12.isDoWhileStatement(node)) {
|
|
1078
1042
|
return false;
|
|
1079
1043
|
}
|
|
1080
|
-
if (typeof this.test === "undefined") {
|
|
1081
|
-
} else if (!this.test.matchValue(node.test, [...keys, "test"])) {
|
|
1044
|
+
if (typeof this.test === "undefined") {} else if (!this.test.matchValue(node.test, [...keys, "test"])) {
|
|
1082
1045
|
return false;
|
|
1083
1046
|
}
|
|
1084
|
-
if (typeof this.body === "undefined") {
|
|
1085
|
-
} else if (!this.body.matchValue(node.body, [...keys, "body"])) {
|
|
1047
|
+
if (typeof this.body === "undefined") {} else if (!this.body.matchValue(node.body, [...keys, "body"])) {
|
|
1086
1048
|
return false;
|
|
1087
1049
|
}
|
|
1088
1050
|
return true;
|
|
@@ -1101,8 +1063,7 @@ class ExpressionStatementMatcher extends Matcher {
|
|
|
1101
1063
|
if (!t12.isNode(node) || !t12.isExpressionStatement(node)) {
|
|
1102
1064
|
return false;
|
|
1103
1065
|
}
|
|
1104
|
-
if (typeof this.expression === "undefined") {
|
|
1105
|
-
} else if (!this.expression.matchValue(node.expression, [...keys, "expression"])) {
|
|
1066
|
+
if (typeof this.expression === "undefined") {} else if (!this.expression.matchValue(node.expression, [...keys, "expression"])) {
|
|
1106
1067
|
return false;
|
|
1107
1068
|
}
|
|
1108
1069
|
return true;
|
|
@@ -1125,16 +1086,13 @@ class ForInStatementMatcher extends Matcher {
|
|
|
1125
1086
|
if (!t12.isNode(node) || !t12.isForInStatement(node)) {
|
|
1126
1087
|
return false;
|
|
1127
1088
|
}
|
|
1128
|
-
if (typeof this.left === "undefined") {
|
|
1129
|
-
} else if (!this.left.matchValue(node.left, [...keys, "left"])) {
|
|
1089
|
+
if (typeof this.left === "undefined") {} else if (!this.left.matchValue(node.left, [...keys, "left"])) {
|
|
1130
1090
|
return false;
|
|
1131
1091
|
}
|
|
1132
|
-
if (typeof this.right === "undefined") {
|
|
1133
|
-
} else if (!this.right.matchValue(node.right, [...keys, "right"])) {
|
|
1092
|
+
if (typeof this.right === "undefined") {} else if (!this.right.matchValue(node.right, [...keys, "right"])) {
|
|
1134
1093
|
return false;
|
|
1135
1094
|
}
|
|
1136
|
-
if (typeof this.body === "undefined") {
|
|
1137
|
-
} else if (!this.body.matchValue(node.body, [...keys, "body"])) {
|
|
1095
|
+
if (typeof this.body === "undefined") {} else if (!this.body.matchValue(node.body, [...keys, "body"])) {
|
|
1138
1096
|
return false;
|
|
1139
1097
|
}
|
|
1140
1098
|
return true;
|
|
@@ -1160,20 +1118,16 @@ class ForOfStatementMatcher extends Matcher {
|
|
|
1160
1118
|
if (!t12.isNode(node) || !t12.isForOfStatement(node)) {
|
|
1161
1119
|
return false;
|
|
1162
1120
|
}
|
|
1163
|
-
if (typeof this.left === "undefined") {
|
|
1164
|
-
} else if (!this.left.matchValue(node.left, [...keys, "left"])) {
|
|
1121
|
+
if (typeof this.left === "undefined") {} else if (!this.left.matchValue(node.left, [...keys, "left"])) {
|
|
1165
1122
|
return false;
|
|
1166
1123
|
}
|
|
1167
|
-
if (typeof this.right === "undefined") {
|
|
1168
|
-
} else if (!this.right.matchValue(node.right, [...keys, "right"])) {
|
|
1124
|
+
if (typeof this.right === "undefined") {} else if (!this.right.matchValue(node.right, [...keys, "right"])) {
|
|
1169
1125
|
return false;
|
|
1170
1126
|
}
|
|
1171
|
-
if (typeof this.body === "undefined") {
|
|
1172
|
-
} else if (!this.body.matchValue(node.body, [...keys, "body"])) {
|
|
1127
|
+
if (typeof this.body === "undefined") {} else if (!this.body.matchValue(node.body, [...keys, "body"])) {
|
|
1173
1128
|
return false;
|
|
1174
1129
|
}
|
|
1175
|
-
if (typeof this._await === "undefined") {
|
|
1176
|
-
} else if (typeof this._await === "boolean") {
|
|
1130
|
+
if (typeof this._await === "undefined") {} else if (typeof this._await === "boolean") {
|
|
1177
1131
|
if (this._await !== node.await) {
|
|
1178
1132
|
return false;
|
|
1179
1133
|
}
|
|
@@ -1203,32 +1157,28 @@ class ForStatementMatcher extends Matcher {
|
|
|
1203
1157
|
if (!t12.isNode(node) || !t12.isForStatement(node)) {
|
|
1204
1158
|
return false;
|
|
1205
1159
|
}
|
|
1206
|
-
if (typeof this.init === "undefined") {
|
|
1207
|
-
} else if (this.init === null) {
|
|
1160
|
+
if (typeof this.init === "undefined") {} else if (this.init === null) {
|
|
1208
1161
|
if (node.init !== null) {
|
|
1209
1162
|
return false;
|
|
1210
1163
|
}
|
|
1211
1164
|
} else if (!this.init.matchValue(node.init, [...keys, "init"])) {
|
|
1212
1165
|
return false;
|
|
1213
1166
|
}
|
|
1214
|
-
if (typeof this.test === "undefined") {
|
|
1215
|
-
} else if (this.test === null) {
|
|
1167
|
+
if (typeof this.test === "undefined") {} else if (this.test === null) {
|
|
1216
1168
|
if (node.test !== null) {
|
|
1217
1169
|
return false;
|
|
1218
1170
|
}
|
|
1219
1171
|
} else if (!this.test.matchValue(node.test, [...keys, "test"])) {
|
|
1220
1172
|
return false;
|
|
1221
1173
|
}
|
|
1222
|
-
if (typeof this.update === "undefined") {
|
|
1223
|
-
} else if (this.update === null) {
|
|
1174
|
+
if (typeof this.update === "undefined") {} else if (this.update === null) {
|
|
1224
1175
|
if (node.update !== null) {
|
|
1225
1176
|
return false;
|
|
1226
1177
|
}
|
|
1227
1178
|
} else if (!this.update.matchValue(node.update, [...keys, "update"])) {
|
|
1228
1179
|
return false;
|
|
1229
1180
|
}
|
|
1230
|
-
if (typeof this.body === "undefined") {
|
|
1231
|
-
} else if (!this.body.matchValue(node.body, [...keys, "body"])) {
|
|
1181
|
+
if (typeof this.body === "undefined") {} else if (!this.body.matchValue(node.body, [...keys, "body"])) {
|
|
1232
1182
|
return false;
|
|
1233
1183
|
}
|
|
1234
1184
|
return true;
|
|
@@ -1256,16 +1206,14 @@ class FunctionDeclarationMatcher extends Matcher {
|
|
|
1256
1206
|
if (!t12.isNode(node) || !t12.isFunctionDeclaration(node)) {
|
|
1257
1207
|
return false;
|
|
1258
1208
|
}
|
|
1259
|
-
if (typeof this.id === "undefined") {
|
|
1260
|
-
} else if (this.id === null) {
|
|
1209
|
+
if (typeof this.id === "undefined") {} else if (this.id === null) {
|
|
1261
1210
|
if (node.id !== null) {
|
|
1262
1211
|
return false;
|
|
1263
1212
|
}
|
|
1264
1213
|
} else if (!this.id.matchValue(node.id, [...keys, "id"])) {
|
|
1265
1214
|
return false;
|
|
1266
1215
|
}
|
|
1267
|
-
if (typeof this.params === "undefined") {
|
|
1268
|
-
} else if (Array.isArray(this.params)) {
|
|
1216
|
+
if (typeof this.params === "undefined") {} else if (Array.isArray(this.params)) {
|
|
1269
1217
|
if (!tupleOf(...this.params).matchValue(node.params, [
|
|
1270
1218
|
...keys,
|
|
1271
1219
|
"params"
|
|
@@ -1275,20 +1223,17 @@ class FunctionDeclarationMatcher extends Matcher {
|
|
|
1275
1223
|
} else if (!this.params.matchValue(node.params, [...keys, "params"])) {
|
|
1276
1224
|
return false;
|
|
1277
1225
|
}
|
|
1278
|
-
if (typeof this.body === "undefined") {
|
|
1279
|
-
} else if (!this.body.matchValue(node.body, [...keys, "body"])) {
|
|
1226
|
+
if (typeof this.body === "undefined") {} else if (!this.body.matchValue(node.body, [...keys, "body"])) {
|
|
1280
1227
|
return false;
|
|
1281
1228
|
}
|
|
1282
|
-
if (typeof this.generator === "undefined") {
|
|
1283
|
-
} else if (typeof this.generator === "boolean") {
|
|
1229
|
+
if (typeof this.generator === "undefined") {} else if (typeof this.generator === "boolean") {
|
|
1284
1230
|
if (this.generator !== node.generator) {
|
|
1285
1231
|
return false;
|
|
1286
1232
|
}
|
|
1287
1233
|
} else if (!this.generator.matchValue(node.generator, [...keys, "generator"])) {
|
|
1288
1234
|
return false;
|
|
1289
1235
|
}
|
|
1290
|
-
if (typeof this.async === "undefined") {
|
|
1291
|
-
} else if (typeof this.async === "boolean") {
|
|
1236
|
+
if (typeof this.async === "undefined") {} else if (typeof this.async === "boolean") {
|
|
1292
1237
|
if (this.async !== node.async) {
|
|
1293
1238
|
return false;
|
|
1294
1239
|
}
|
|
@@ -1320,16 +1265,14 @@ class FunctionExpressionMatcher extends Matcher {
|
|
|
1320
1265
|
if (!t12.isNode(node) || !t12.isFunctionExpression(node)) {
|
|
1321
1266
|
return false;
|
|
1322
1267
|
}
|
|
1323
|
-
if (typeof this.id === "undefined") {
|
|
1324
|
-
} else if (this.id === null) {
|
|
1268
|
+
if (typeof this.id === "undefined") {} else if (this.id === null) {
|
|
1325
1269
|
if (node.id !== null) {
|
|
1326
1270
|
return false;
|
|
1327
1271
|
}
|
|
1328
1272
|
} else if (!this.id.matchValue(node.id, [...keys, "id"])) {
|
|
1329
1273
|
return false;
|
|
1330
1274
|
}
|
|
1331
|
-
if (typeof this.params === "undefined") {
|
|
1332
|
-
} else if (Array.isArray(this.params)) {
|
|
1275
|
+
if (typeof this.params === "undefined") {} else if (Array.isArray(this.params)) {
|
|
1333
1276
|
if (!tupleOf(...this.params).matchValue(node.params, [
|
|
1334
1277
|
...keys,
|
|
1335
1278
|
"params"
|
|
@@ -1339,20 +1282,17 @@ class FunctionExpressionMatcher extends Matcher {
|
|
|
1339
1282
|
} else if (!this.params.matchValue(node.params, [...keys, "params"])) {
|
|
1340
1283
|
return false;
|
|
1341
1284
|
}
|
|
1342
|
-
if (typeof this.body === "undefined") {
|
|
1343
|
-
} else if (!this.body.matchValue(node.body, [...keys, "body"])) {
|
|
1285
|
+
if (typeof this.body === "undefined") {} else if (!this.body.matchValue(node.body, [...keys, "body"])) {
|
|
1344
1286
|
return false;
|
|
1345
1287
|
}
|
|
1346
|
-
if (typeof this.generator === "undefined") {
|
|
1347
|
-
} else if (typeof this.generator === "boolean") {
|
|
1288
|
+
if (typeof this.generator === "undefined") {} else if (typeof this.generator === "boolean") {
|
|
1348
1289
|
if (this.generator !== node.generator) {
|
|
1349
1290
|
return false;
|
|
1350
1291
|
}
|
|
1351
1292
|
} else if (!this.generator.matchValue(node.generator, [...keys, "generator"])) {
|
|
1352
1293
|
return false;
|
|
1353
1294
|
}
|
|
1354
|
-
if (typeof this.async === "undefined") {
|
|
1355
|
-
} else if (typeof this.async === "boolean") {
|
|
1295
|
+
if (typeof this.async === "undefined") {} else if (typeof this.async === "boolean") {
|
|
1356
1296
|
if (this.async !== node.async) {
|
|
1357
1297
|
return false;
|
|
1358
1298
|
}
|
|
@@ -1375,8 +1315,7 @@ class IdentifierMatcher extends Matcher {
|
|
|
1375
1315
|
if (!t12.isNode(node) || !t12.isIdentifier(node)) {
|
|
1376
1316
|
return false;
|
|
1377
1317
|
}
|
|
1378
|
-
if (typeof this.name === "undefined") {
|
|
1379
|
-
} else if (typeof this.name === "string") {
|
|
1318
|
+
if (typeof this.name === "undefined") {} else if (typeof this.name === "string") {
|
|
1380
1319
|
if (this.name !== node.name) {
|
|
1381
1320
|
return false;
|
|
1382
1321
|
}
|
|
@@ -1404,16 +1343,13 @@ class IfStatementMatcher extends Matcher {
|
|
|
1404
1343
|
if (!t12.isNode(node) || !t12.isIfStatement(node)) {
|
|
1405
1344
|
return false;
|
|
1406
1345
|
}
|
|
1407
|
-
if (typeof this.test === "undefined") {
|
|
1408
|
-
} else if (!this.test.matchValue(node.test, [...keys, "test"])) {
|
|
1346
|
+
if (typeof this.test === "undefined") {} else if (!this.test.matchValue(node.test, [...keys, "test"])) {
|
|
1409
1347
|
return false;
|
|
1410
1348
|
}
|
|
1411
|
-
if (typeof this.consequent === "undefined") {
|
|
1412
|
-
} else if (!this.consequent.matchValue(node.consequent, [...keys, "consequent"])) {
|
|
1349
|
+
if (typeof this.consequent === "undefined") {} else if (!this.consequent.matchValue(node.consequent, [...keys, "consequent"])) {
|
|
1413
1350
|
return false;
|
|
1414
1351
|
}
|
|
1415
|
-
if (typeof this.alternate === "undefined") {
|
|
1416
|
-
} else if (this.alternate === null) {
|
|
1352
|
+
if (typeof this.alternate === "undefined") {} else if (this.alternate === null) {
|
|
1417
1353
|
if (node.alternate !== null) {
|
|
1418
1354
|
return false;
|
|
1419
1355
|
}
|
|
@@ -1440,20 +1376,17 @@ class LogicalExpressionMatcher extends Matcher {
|
|
|
1440
1376
|
if (!t12.isNode(node) || !t12.isLogicalExpression(node)) {
|
|
1441
1377
|
return false;
|
|
1442
1378
|
}
|
|
1443
|
-
if (typeof this.operator === "undefined") {
|
|
1444
|
-
} else if (typeof this.operator === "string") {
|
|
1379
|
+
if (typeof this.operator === "undefined") {} else if (typeof this.operator === "string") {
|
|
1445
1380
|
if (this.operator !== node.operator) {
|
|
1446
1381
|
return false;
|
|
1447
1382
|
}
|
|
1448
1383
|
} else if (!this.operator.matchValue(node.operator, [...keys, "operator"])) {
|
|
1449
1384
|
return false;
|
|
1450
1385
|
}
|
|
1451
|
-
if (typeof this.left === "undefined") {
|
|
1452
|
-
} else if (!this.left.matchValue(node.left, [...keys, "left"])) {
|
|
1386
|
+
if (typeof this.left === "undefined") {} else if (!this.left.matchValue(node.left, [...keys, "left"])) {
|
|
1453
1387
|
return false;
|
|
1454
1388
|
}
|
|
1455
|
-
if (typeof this.right === "undefined") {
|
|
1456
|
-
} else if (!this.right.matchValue(node.right, [...keys, "right"])) {
|
|
1389
|
+
if (typeof this.right === "undefined") {} else if (!this.right.matchValue(node.right, [...keys, "right"])) {
|
|
1457
1390
|
return false;
|
|
1458
1391
|
}
|
|
1459
1392
|
return true;
|
|
@@ -1479,24 +1412,20 @@ class MemberExpressionMatcher extends Matcher {
|
|
|
1479
1412
|
if (!t12.isNode(node) || !t12.isMemberExpression(node)) {
|
|
1480
1413
|
return false;
|
|
1481
1414
|
}
|
|
1482
|
-
if (typeof this.object === "undefined") {
|
|
1483
|
-
} else if (!this.object.matchValue(node.object, [...keys, "object"])) {
|
|
1415
|
+
if (typeof this.object === "undefined") {} else if (!this.object.matchValue(node.object, [...keys, "object"])) {
|
|
1484
1416
|
return false;
|
|
1485
1417
|
}
|
|
1486
|
-
if (typeof this.property === "undefined") {
|
|
1487
|
-
} else if (!this.property.matchValue(node.property, [...keys, "property"])) {
|
|
1418
|
+
if (typeof this.property === "undefined") {} else if (!this.property.matchValue(node.property, [...keys, "property"])) {
|
|
1488
1419
|
return false;
|
|
1489
1420
|
}
|
|
1490
|
-
if (typeof this.computed === "undefined") {
|
|
1491
|
-
} else if (typeof this.computed === "boolean") {
|
|
1421
|
+
if (typeof this.computed === "undefined") {} else if (typeof this.computed === "boolean") {
|
|
1492
1422
|
if (this.computed !== node.computed) {
|
|
1493
1423
|
return false;
|
|
1494
1424
|
}
|
|
1495
1425
|
} else if (!this.computed.matchValue(node.computed, [...keys, "computed"])) {
|
|
1496
1426
|
return false;
|
|
1497
1427
|
}
|
|
1498
|
-
if (typeof this.optional === "undefined") {
|
|
1499
|
-
} else if (typeof this.optional === "boolean") {
|
|
1428
|
+
if (typeof this.optional === "undefined") {} else if (typeof this.optional === "boolean") {
|
|
1500
1429
|
if (this.optional !== node.optional) {
|
|
1501
1430
|
return false;
|
|
1502
1431
|
}
|
|
@@ -1537,8 +1466,7 @@ class NumericLiteralMatcher extends Matcher {
|
|
|
1537
1466
|
if (!t12.isNode(node) || !t12.isNumericLiteral(node)) {
|
|
1538
1467
|
return false;
|
|
1539
1468
|
}
|
|
1540
|
-
if (typeof this.value === "undefined") {
|
|
1541
|
-
} else if (typeof this.value === "number") {
|
|
1469
|
+
if (typeof this.value === "undefined") {} else if (typeof this.value === "number") {
|
|
1542
1470
|
if (this.value !== node.value) {
|
|
1543
1471
|
return false;
|
|
1544
1472
|
}
|
|
@@ -1562,8 +1490,7 @@ class ObjectExpressionMatcher extends Matcher {
|
|
|
1562
1490
|
if (!t12.isNode(node) || !t12.isObjectExpression(node)) {
|
|
1563
1491
|
return false;
|
|
1564
1492
|
}
|
|
1565
|
-
if (typeof this.properties === "undefined") {
|
|
1566
|
-
} else if (Array.isArray(this.properties)) {
|
|
1493
|
+
if (typeof this.properties === "undefined") {} else if (Array.isArray(this.properties)) {
|
|
1567
1494
|
if (!tupleOf(...this.properties).matchValue(node.properties, [
|
|
1568
1495
|
...keys,
|
|
1569
1496
|
"properties"
|
|
@@ -1602,20 +1529,17 @@ class ObjectMethodMatcher extends Matcher {
|
|
|
1602
1529
|
if (!t12.isNode(node) || !t12.isObjectMethod(node)) {
|
|
1603
1530
|
return false;
|
|
1604
1531
|
}
|
|
1605
|
-
if (typeof this.kind === "undefined") {
|
|
1606
|
-
} else if (typeof this.kind === "string") {
|
|
1532
|
+
if (typeof this.kind === "undefined") {} else if (typeof this.kind === "string") {
|
|
1607
1533
|
if (this.kind !== node.kind) {
|
|
1608
1534
|
return false;
|
|
1609
1535
|
}
|
|
1610
1536
|
} else if (!this.kind.matchValue(node.kind, [...keys, "kind"])) {
|
|
1611
1537
|
return false;
|
|
1612
1538
|
}
|
|
1613
|
-
if (typeof this.key === "undefined") {
|
|
1614
|
-
} else if (!this.key.matchValue(node.key, [...keys, "key"])) {
|
|
1539
|
+
if (typeof this.key === "undefined") {} else if (!this.key.matchValue(node.key, [...keys, "key"])) {
|
|
1615
1540
|
return false;
|
|
1616
1541
|
}
|
|
1617
|
-
if (typeof this.params === "undefined") {
|
|
1618
|
-
} else if (Array.isArray(this.params)) {
|
|
1542
|
+
if (typeof this.params === "undefined") {} else if (Array.isArray(this.params)) {
|
|
1619
1543
|
if (!tupleOf(...this.params).matchValue(node.params, [
|
|
1620
1544
|
...keys,
|
|
1621
1545
|
"params"
|
|
@@ -1625,28 +1549,24 @@ class ObjectMethodMatcher extends Matcher {
|
|
|
1625
1549
|
} else if (!this.params.matchValue(node.params, [...keys, "params"])) {
|
|
1626
1550
|
return false;
|
|
1627
1551
|
}
|
|
1628
|
-
if (typeof this.body === "undefined") {
|
|
1629
|
-
} else if (!this.body.matchValue(node.body, [...keys, "body"])) {
|
|
1552
|
+
if (typeof this.body === "undefined") {} else if (!this.body.matchValue(node.body, [...keys, "body"])) {
|
|
1630
1553
|
return false;
|
|
1631
1554
|
}
|
|
1632
|
-
if (typeof this.computed === "undefined") {
|
|
1633
|
-
} else if (typeof this.computed === "boolean") {
|
|
1555
|
+
if (typeof this.computed === "undefined") {} else if (typeof this.computed === "boolean") {
|
|
1634
1556
|
if (this.computed !== node.computed) {
|
|
1635
1557
|
return false;
|
|
1636
1558
|
}
|
|
1637
1559
|
} else if (!this.computed.matchValue(node.computed, [...keys, "computed"])) {
|
|
1638
1560
|
return false;
|
|
1639
1561
|
}
|
|
1640
|
-
if (typeof this.generator === "undefined") {
|
|
1641
|
-
} else if (typeof this.generator === "boolean") {
|
|
1562
|
+
if (typeof this.generator === "undefined") {} else if (typeof this.generator === "boolean") {
|
|
1642
1563
|
if (this.generator !== node.generator) {
|
|
1643
1564
|
return false;
|
|
1644
1565
|
}
|
|
1645
1566
|
} else if (!this.generator.matchValue(node.generator, [...keys, "generator"])) {
|
|
1646
1567
|
return false;
|
|
1647
1568
|
}
|
|
1648
|
-
if (typeof this.async === "undefined") {
|
|
1649
|
-
} else if (typeof this.async === "boolean") {
|
|
1569
|
+
if (typeof this.async === "undefined") {} else if (typeof this.async === "boolean") {
|
|
1650
1570
|
if (this.async !== node.async) {
|
|
1651
1571
|
return false;
|
|
1652
1572
|
}
|
|
@@ -1670,8 +1590,7 @@ class ObjectPatternMatcher extends Matcher {
|
|
|
1670
1590
|
if (!t12.isNode(node) || !t12.isObjectPattern(node)) {
|
|
1671
1591
|
return false;
|
|
1672
1592
|
}
|
|
1673
|
-
if (typeof this.properties === "undefined") {
|
|
1674
|
-
} else if (Array.isArray(this.properties)) {
|
|
1593
|
+
if (typeof this.properties === "undefined") {} else if (Array.isArray(this.properties)) {
|
|
1675
1594
|
if (!tupleOf(...this.properties).matchValue(node.properties, [
|
|
1676
1595
|
...keys,
|
|
1677
1596
|
"properties"
|
|
@@ -1706,32 +1625,27 @@ class ObjectPropertyMatcher extends Matcher {
|
|
|
1706
1625
|
if (!t12.isNode(node) || !t12.isObjectProperty(node)) {
|
|
1707
1626
|
return false;
|
|
1708
1627
|
}
|
|
1709
|
-
if (typeof this.key === "undefined") {
|
|
1710
|
-
} else if (!this.key.matchValue(node.key, [...keys, "key"])) {
|
|
1628
|
+
if (typeof this.key === "undefined") {} else if (!this.key.matchValue(node.key, [...keys, "key"])) {
|
|
1711
1629
|
return false;
|
|
1712
1630
|
}
|
|
1713
|
-
if (typeof this.value === "undefined") {
|
|
1714
|
-
} else if (!this.value.matchValue(node.value, [...keys, "value"])) {
|
|
1631
|
+
if (typeof this.value === "undefined") {} else if (!this.value.matchValue(node.value, [...keys, "value"])) {
|
|
1715
1632
|
return false;
|
|
1716
1633
|
}
|
|
1717
|
-
if (typeof this.computed === "undefined") {
|
|
1718
|
-
} else if (typeof this.computed === "boolean") {
|
|
1634
|
+
if (typeof this.computed === "undefined") {} else if (typeof this.computed === "boolean") {
|
|
1719
1635
|
if (this.computed !== node.computed) {
|
|
1720
1636
|
return false;
|
|
1721
1637
|
}
|
|
1722
1638
|
} else if (!this.computed.matchValue(node.computed, [...keys, "computed"])) {
|
|
1723
1639
|
return false;
|
|
1724
1640
|
}
|
|
1725
|
-
if (typeof this.shorthand === "undefined") {
|
|
1726
|
-
} else if (typeof this.shorthand === "boolean") {
|
|
1641
|
+
if (typeof this.shorthand === "undefined") {} else if (typeof this.shorthand === "boolean") {
|
|
1727
1642
|
if (this.shorthand !== node.shorthand) {
|
|
1728
1643
|
return false;
|
|
1729
1644
|
}
|
|
1730
1645
|
} else if (!this.shorthand.matchValue(node.shorthand, [...keys, "shorthand"])) {
|
|
1731
1646
|
return false;
|
|
1732
1647
|
}
|
|
1733
|
-
if (typeof this.decorators === "undefined") {
|
|
1734
|
-
} else if (this.decorators === null) {
|
|
1648
|
+
if (typeof this.decorators === "undefined") {} else if (this.decorators === null) {
|
|
1735
1649
|
if (node.decorators !== null) {
|
|
1736
1650
|
return false;
|
|
1737
1651
|
}
|
|
@@ -1767,24 +1681,20 @@ class OptionalMemberExpressionMatcher extends Matcher {
|
|
|
1767
1681
|
if (!t12.isNode(node) || !t12.isOptionalMemberExpression(node)) {
|
|
1768
1682
|
return false;
|
|
1769
1683
|
}
|
|
1770
|
-
if (typeof this.object === "undefined") {
|
|
1771
|
-
} else if (!this.object.matchValue(node.object, [...keys, "object"])) {
|
|
1684
|
+
if (typeof this.object === "undefined") {} else if (!this.object.matchValue(node.object, [...keys, "object"])) {
|
|
1772
1685
|
return false;
|
|
1773
1686
|
}
|
|
1774
|
-
if (typeof this.property === "undefined") {
|
|
1775
|
-
} else if (!this.property.matchValue(node.property, [...keys, "property"])) {
|
|
1687
|
+
if (typeof this.property === "undefined") {} else if (!this.property.matchValue(node.property, [...keys, "property"])) {
|
|
1776
1688
|
return false;
|
|
1777
1689
|
}
|
|
1778
|
-
if (typeof this.computed === "undefined") {
|
|
1779
|
-
} else if (typeof this.computed === "boolean") {
|
|
1690
|
+
if (typeof this.computed === "undefined") {} else if (typeof this.computed === "boolean") {
|
|
1780
1691
|
if (this.computed !== node.computed) {
|
|
1781
1692
|
return false;
|
|
1782
1693
|
}
|
|
1783
1694
|
} else if (!this.computed.matchValue(node.computed, [...keys, "computed"])) {
|
|
1784
1695
|
return false;
|
|
1785
1696
|
}
|
|
1786
|
-
if (typeof this.optional === "undefined") {
|
|
1787
|
-
} else if (typeof this.optional === "boolean") {
|
|
1697
|
+
if (typeof this.optional === "undefined") {} else if (typeof this.optional === "boolean") {
|
|
1788
1698
|
if (this.optional !== node.optional) {
|
|
1789
1699
|
return false;
|
|
1790
1700
|
}
|
|
@@ -1807,8 +1717,7 @@ class RestElementMatcher extends Matcher {
|
|
|
1807
1717
|
if (!t12.isNode(node) || !t12.isRestElement(node)) {
|
|
1808
1718
|
return false;
|
|
1809
1719
|
}
|
|
1810
|
-
if (typeof this.argument === "undefined") {
|
|
1811
|
-
} else if (!this.argument.matchValue(node.argument, [...keys, "argument"])) {
|
|
1720
|
+
if (typeof this.argument === "undefined") {} else if (!this.argument.matchValue(node.argument, [...keys, "argument"])) {
|
|
1812
1721
|
return false;
|
|
1813
1722
|
}
|
|
1814
1723
|
return true;
|
|
@@ -1828,8 +1737,7 @@ class ReturnStatementMatcher extends Matcher {
|
|
|
1828
1737
|
if (!t12.isNode(node) || !t12.isReturnStatement(node)) {
|
|
1829
1738
|
return false;
|
|
1830
1739
|
}
|
|
1831
|
-
if (typeof this.argument === "undefined") {
|
|
1832
|
-
} else if (this.argument === null) {
|
|
1740
|
+
if (typeof this.argument === "undefined") {} else if (this.argument === null) {
|
|
1833
1741
|
if (node.argument !== null) {
|
|
1834
1742
|
return false;
|
|
1835
1743
|
}
|
|
@@ -1853,8 +1761,7 @@ class SequenceExpressionMatcher extends Matcher {
|
|
|
1853
1761
|
if (!t12.isNode(node) || !t12.isSequenceExpression(node)) {
|
|
1854
1762
|
return false;
|
|
1855
1763
|
}
|
|
1856
|
-
if (typeof this.expressions === "undefined") {
|
|
1857
|
-
} else if (Array.isArray(this.expressions)) {
|
|
1764
|
+
if (typeof this.expressions === "undefined") {} else if (Array.isArray(this.expressions)) {
|
|
1858
1765
|
if (!tupleOf(...this.expressions).matchValue(node.expressions, [
|
|
1859
1766
|
...keys,
|
|
1860
1767
|
"expressions"
|
|
@@ -1881,8 +1788,7 @@ class SpreadElementMatcher extends Matcher {
|
|
|
1881
1788
|
if (!t12.isNode(node) || !t12.isSpreadElement(node)) {
|
|
1882
1789
|
return false;
|
|
1883
1790
|
}
|
|
1884
|
-
if (typeof this.argument === "undefined") {
|
|
1885
|
-
} else if (!this.argument.matchValue(node.argument, [...keys, "argument"])) {
|
|
1791
|
+
if (typeof this.argument === "undefined") {} else if (!this.argument.matchValue(node.argument, [...keys, "argument"])) {
|
|
1886
1792
|
return false;
|
|
1887
1793
|
}
|
|
1888
1794
|
return true;
|
|
@@ -1901,8 +1807,7 @@ class StringLiteralMatcher extends Matcher {
|
|
|
1901
1807
|
if (!t12.isNode(node) || !t12.isStringLiteral(node)) {
|
|
1902
1808
|
return false;
|
|
1903
1809
|
}
|
|
1904
|
-
if (typeof this.value === "undefined") {
|
|
1905
|
-
} else if (typeof this.value === "string") {
|
|
1810
|
+
if (typeof this.value === "undefined") {} else if (typeof this.value === "string") {
|
|
1906
1811
|
if (this.value !== node.value) {
|
|
1907
1812
|
return false;
|
|
1908
1813
|
}
|
|
@@ -1927,16 +1832,14 @@ class SwitchCaseMatcher extends Matcher {
|
|
|
1927
1832
|
if (!t12.isNode(node) || !t12.isSwitchCase(node)) {
|
|
1928
1833
|
return false;
|
|
1929
1834
|
}
|
|
1930
|
-
if (typeof this.test === "undefined") {
|
|
1931
|
-
} else if (this.test === null) {
|
|
1835
|
+
if (typeof this.test === "undefined") {} else if (this.test === null) {
|
|
1932
1836
|
if (node.test !== null) {
|
|
1933
1837
|
return false;
|
|
1934
1838
|
}
|
|
1935
1839
|
} else if (!this.test.matchValue(node.test, [...keys, "test"])) {
|
|
1936
1840
|
return false;
|
|
1937
1841
|
}
|
|
1938
|
-
if (typeof this.consequent === "undefined") {
|
|
1939
|
-
} else if (Array.isArray(this.consequent)) {
|
|
1842
|
+
if (typeof this.consequent === "undefined") {} else if (Array.isArray(this.consequent)) {
|
|
1940
1843
|
if (!tupleOf(...this.consequent).matchValue(node.consequent, [
|
|
1941
1844
|
...keys,
|
|
1942
1845
|
"consequent"
|
|
@@ -1965,15 +1868,13 @@ class SwitchStatementMatcher extends Matcher {
|
|
|
1965
1868
|
if (!t12.isNode(node) || !t12.isSwitchStatement(node)) {
|
|
1966
1869
|
return false;
|
|
1967
1870
|
}
|
|
1968
|
-
if (typeof this.discriminant === "undefined") {
|
|
1969
|
-
} else if (!this.discriminant.matchValue(node.discriminant, [
|
|
1871
|
+
if (typeof this.discriminant === "undefined") {} else if (!this.discriminant.matchValue(node.discriminant, [
|
|
1970
1872
|
...keys,
|
|
1971
1873
|
"discriminant"
|
|
1972
1874
|
])) {
|
|
1973
1875
|
return false;
|
|
1974
1876
|
}
|
|
1975
|
-
if (typeof this.cases === "undefined") {
|
|
1976
|
-
} else if (Array.isArray(this.cases)) {
|
|
1877
|
+
if (typeof this.cases === "undefined") {} else if (Array.isArray(this.cases)) {
|
|
1977
1878
|
if (!tupleOf(...this.cases).matchValue(node.cases, [
|
|
1978
1879
|
...keys,
|
|
1979
1880
|
"cases"
|
|
@@ -2001,8 +1902,7 @@ class TemplateLiteralMatcher extends Matcher {
|
|
|
2001
1902
|
if (!t12.isNode(node) || !t12.isTemplateLiteral(node)) {
|
|
2002
1903
|
return false;
|
|
2003
1904
|
}
|
|
2004
|
-
if (typeof this.quasis === "undefined") {
|
|
2005
|
-
} else if (Array.isArray(this.quasis)) {
|
|
1905
|
+
if (typeof this.quasis === "undefined") {} else if (Array.isArray(this.quasis)) {
|
|
2006
1906
|
if (!tupleOf(...this.quasis).matchValue(node.quasis, [
|
|
2007
1907
|
...keys,
|
|
2008
1908
|
"quasis"
|
|
@@ -2012,8 +1912,7 @@ class TemplateLiteralMatcher extends Matcher {
|
|
|
2012
1912
|
} else if (!this.quasis.matchValue(node.quasis, [...keys, "quasis"])) {
|
|
2013
1913
|
return false;
|
|
2014
1914
|
}
|
|
2015
|
-
if (typeof this.expressions === "undefined") {
|
|
2016
|
-
} else if (Array.isArray(this.expressions)) {
|
|
1915
|
+
if (typeof this.expressions === "undefined") {} else if (Array.isArray(this.expressions)) {
|
|
2017
1916
|
if (!tupleOf(...this.expressions).matchValue(node.expressions, [
|
|
2018
1917
|
...keys,
|
|
2019
1918
|
"expressions"
|
|
@@ -2058,20 +1957,17 @@ class TryStatementMatcher extends Matcher {
|
|
|
2058
1957
|
if (!t12.isNode(node) || !t12.isTryStatement(node)) {
|
|
2059
1958
|
return false;
|
|
2060
1959
|
}
|
|
2061
|
-
if (typeof this.block === "undefined") {
|
|
2062
|
-
} else if (!this.block.matchValue(node.block, [...keys, "block"])) {
|
|
1960
|
+
if (typeof this.block === "undefined") {} else if (!this.block.matchValue(node.block, [...keys, "block"])) {
|
|
2063
1961
|
return false;
|
|
2064
1962
|
}
|
|
2065
|
-
if (typeof this.handler === "undefined") {
|
|
2066
|
-
} else if (this.handler === null) {
|
|
1963
|
+
if (typeof this.handler === "undefined") {} else if (this.handler === null) {
|
|
2067
1964
|
if (node.handler !== null) {
|
|
2068
1965
|
return false;
|
|
2069
1966
|
}
|
|
2070
1967
|
} else if (!this.handler.matchValue(node.handler, [...keys, "handler"])) {
|
|
2071
1968
|
return false;
|
|
2072
1969
|
}
|
|
2073
|
-
if (typeof this.finalizer === "undefined") {
|
|
2074
|
-
} else if (this.finalizer === null) {
|
|
1970
|
+
if (typeof this.finalizer === "undefined") {} else if (this.finalizer === null) {
|
|
2075
1971
|
if (node.finalizer !== null) {
|
|
2076
1972
|
return false;
|
|
2077
1973
|
}
|
|
@@ -2098,20 +1994,17 @@ class UnaryExpressionMatcher extends Matcher {
|
|
|
2098
1994
|
if (!t12.isNode(node) || !t12.isUnaryExpression(node)) {
|
|
2099
1995
|
return false;
|
|
2100
1996
|
}
|
|
2101
|
-
if (typeof this.operator === "undefined") {
|
|
2102
|
-
} else if (typeof this.operator === "string") {
|
|
1997
|
+
if (typeof this.operator === "undefined") {} else if (typeof this.operator === "string") {
|
|
2103
1998
|
if (this.operator !== node.operator) {
|
|
2104
1999
|
return false;
|
|
2105
2000
|
}
|
|
2106
2001
|
} else if (!this.operator.matchValue(node.operator, [...keys, "operator"])) {
|
|
2107
2002
|
return false;
|
|
2108
2003
|
}
|
|
2109
|
-
if (typeof this.argument === "undefined") {
|
|
2110
|
-
} else if (!this.argument.matchValue(node.argument, [...keys, "argument"])) {
|
|
2004
|
+
if (typeof this.argument === "undefined") {} else if (!this.argument.matchValue(node.argument, [...keys, "argument"])) {
|
|
2111
2005
|
return false;
|
|
2112
2006
|
}
|
|
2113
|
-
if (typeof this.prefix === "undefined") {
|
|
2114
|
-
} else if (typeof this.prefix === "boolean") {
|
|
2007
|
+
if (typeof this.prefix === "undefined") {} else if (typeof this.prefix === "boolean") {
|
|
2115
2008
|
if (this.prefix !== node.prefix) {
|
|
2116
2009
|
return false;
|
|
2117
2010
|
}
|
|
@@ -2138,20 +2031,17 @@ class UpdateExpressionMatcher extends Matcher {
|
|
|
2138
2031
|
if (!t12.isNode(node) || !t12.isUpdateExpression(node)) {
|
|
2139
2032
|
return false;
|
|
2140
2033
|
}
|
|
2141
|
-
if (typeof this.operator === "undefined") {
|
|
2142
|
-
} else if (typeof this.operator === "string") {
|
|
2034
|
+
if (typeof this.operator === "undefined") {} else if (typeof this.operator === "string") {
|
|
2143
2035
|
if (this.operator !== node.operator) {
|
|
2144
2036
|
return false;
|
|
2145
2037
|
}
|
|
2146
2038
|
} else if (!this.operator.matchValue(node.operator, [...keys, "operator"])) {
|
|
2147
2039
|
return false;
|
|
2148
2040
|
}
|
|
2149
|
-
if (typeof this.argument === "undefined") {
|
|
2150
|
-
} else if (!this.argument.matchValue(node.argument, [...keys, "argument"])) {
|
|
2041
|
+
if (typeof this.argument === "undefined") {} else if (!this.argument.matchValue(node.argument, [...keys, "argument"])) {
|
|
2151
2042
|
return false;
|
|
2152
2043
|
}
|
|
2153
|
-
if (typeof this.prefix === "undefined") {
|
|
2154
|
-
} else if (typeof this.prefix === "boolean") {
|
|
2044
|
+
if (typeof this.prefix === "undefined") {} else if (typeof this.prefix === "boolean") {
|
|
2155
2045
|
if (this.prefix !== node.prefix) {
|
|
2156
2046
|
return false;
|
|
2157
2047
|
}
|
|
@@ -2176,16 +2066,14 @@ class VariableDeclarationMatcher extends Matcher {
|
|
|
2176
2066
|
if (!t12.isNode(node) || !t12.isVariableDeclaration(node)) {
|
|
2177
2067
|
return false;
|
|
2178
2068
|
}
|
|
2179
|
-
if (typeof this.kind === "undefined") {
|
|
2180
|
-
} else if (typeof this.kind === "string") {
|
|
2069
|
+
if (typeof this.kind === "undefined") {} else if (typeof this.kind === "string") {
|
|
2181
2070
|
if (this.kind !== node.kind) {
|
|
2182
2071
|
return false;
|
|
2183
2072
|
}
|
|
2184
2073
|
} else if (!this.kind.matchValue(node.kind, [...keys, "kind"])) {
|
|
2185
2074
|
return false;
|
|
2186
2075
|
}
|
|
2187
|
-
if (typeof this.declarations === "undefined") {
|
|
2188
|
-
} else if (Array.isArray(this.declarations)) {
|
|
2076
|
+
if (typeof this.declarations === "undefined") {} else if (Array.isArray(this.declarations)) {
|
|
2189
2077
|
if (!tupleOf(...this.declarations).matchValue(node.declarations, [
|
|
2190
2078
|
...keys,
|
|
2191
2079
|
"declarations"
|
|
@@ -2217,12 +2105,10 @@ class VariableDeclaratorMatcher extends Matcher {
|
|
|
2217
2105
|
if (!t12.isNode(node) || !t12.isVariableDeclarator(node)) {
|
|
2218
2106
|
return false;
|
|
2219
2107
|
}
|
|
2220
|
-
if (typeof this.id === "undefined") {
|
|
2221
|
-
} else if (!this.id.matchValue(node.id, [...keys, "id"])) {
|
|
2108
|
+
if (typeof this.id === "undefined") {} else if (!this.id.matchValue(node.id, [...keys, "id"])) {
|
|
2222
2109
|
return false;
|
|
2223
2110
|
}
|
|
2224
|
-
if (typeof this.init === "undefined") {
|
|
2225
|
-
} else if (this.init === null) {
|
|
2111
|
+
if (typeof this.init === "undefined") {} else if (this.init === null) {
|
|
2226
2112
|
if (node.init !== null) {
|
|
2227
2113
|
return false;
|
|
2228
2114
|
}
|
|
@@ -2247,12 +2133,10 @@ class WhileStatementMatcher extends Matcher {
|
|
|
2247
2133
|
if (!t12.isNode(node) || !t12.isWhileStatement(node)) {
|
|
2248
2134
|
return false;
|
|
2249
2135
|
}
|
|
2250
|
-
if (typeof this.test === "undefined") {
|
|
2251
|
-
} else if (!this.test.matchValue(node.test, [...keys, "test"])) {
|
|
2136
|
+
if (typeof this.test === "undefined") {} else if (!this.test.matchValue(node.test, [...keys, "test"])) {
|
|
2252
2137
|
return false;
|
|
2253
2138
|
}
|
|
2254
|
-
if (typeof this.body === "undefined") {
|
|
2255
|
-
} else if (!this.body.matchValue(node.body, [...keys, "body"])) {
|
|
2139
|
+
if (typeof this.body === "undefined") {} else if (!this.body.matchValue(node.body, [...keys, "body"])) {
|
|
2256
2140
|
return false;
|
|
2257
2141
|
}
|
|
2258
2142
|
return true;
|
|
@@ -4290,7 +4174,9 @@ __export(exports_transforms2, {
|
|
|
4290
4174
|
unminifyBooleans: () => unminify_booleans_default,
|
|
4291
4175
|
unaryExpressions: () => unary_expressions_default,
|
|
4292
4176
|
typeofUndefined: () => typeof_undefined_default,
|
|
4177
|
+
truncateNumberLiteral: () => truncate_number_literal_default,
|
|
4293
4178
|
ternaryToIf: () => ternary_to_if_default,
|
|
4179
|
+
stringLiteralInTemplate: () => string_literal_in_template_default,
|
|
4294
4180
|
splitVariableDeclarations: () => split_variable_declarations_default,
|
|
4295
4181
|
splitForLoopVars: () => split_for_loop_vars_default,
|
|
4296
4182
|
sequence: () => sequence_default,
|
|
@@ -4491,8 +4377,7 @@ var json_parse_default = {
|
|
|
4491
4377
|
const parsed = parseExpression(string.current);
|
|
4492
4378
|
path.replaceWith(parsed);
|
|
4493
4379
|
this.changes++;
|
|
4494
|
-
} catch {
|
|
4495
|
-
}
|
|
4380
|
+
} catch {}
|
|
4496
4381
|
}
|
|
4497
4382
|
}
|
|
4498
4383
|
}
|
|
@@ -4792,7 +4677,8 @@ var split_for_loop_vars_default = {
|
|
|
4792
4677
|
const isUsedInTestOrUpdate = binding.constantViolations.some((reference) => reference.find((p2) => p2.node === test || p2.node === update)) || binding.referencePaths.some((reference) => reference.find((p2) => p2.node === test || p2.node === update));
|
|
4793
4678
|
if (isUsedInTestOrUpdate)
|
|
4794
4679
|
break;
|
|
4795
|
-
path.insertBefore(t42.variableDeclaration("var", [declarator]));
|
|
4680
|
+
const [replacement] = path.insertBefore(t42.variableDeclaration("var", [declarator]));
|
|
4681
|
+
binding.path = replacement.get("declarations.0");
|
|
4796
4682
|
declarations.shift();
|
|
4797
4683
|
i--;
|
|
4798
4684
|
this.changes++;
|
|
@@ -4831,6 +4717,31 @@ var split_variable_declarations_default = {
|
|
|
4831
4717
|
}
|
|
4832
4718
|
})
|
|
4833
4719
|
};
|
|
4720
|
+
// webcrack/unminify/transforms/string-literal-in-template.js
|
|
4721
|
+
import * as t44 from "@babel/types";
|
|
4722
|
+
var string_literal_in_template_default = {
|
|
4723
|
+
name: "string-literal-in-template-literal",
|
|
4724
|
+
tags: ["safe"],
|
|
4725
|
+
visitor: () => ({
|
|
4726
|
+
TemplateLiteral(path) {
|
|
4727
|
+
for (let i = 0;i < path.node.expressions.length; i++) {
|
|
4728
|
+
const expr = path.node.expressions[i];
|
|
4729
|
+
if (t44.isStringLiteral(expr)) {
|
|
4730
|
+
path.node.expressions.splice(i, 1);
|
|
4731
|
+
const main2 = path.node.quasis[i];
|
|
4732
|
+
main2.value.raw += expr.value;
|
|
4733
|
+
const next = path.node.quasis[i + 1];
|
|
4734
|
+
if (next) {
|
|
4735
|
+
main2.value.raw += next.value.raw;
|
|
4736
|
+
path.node.quasis.splice(i + 1, 1);
|
|
4737
|
+
}
|
|
4738
|
+
this.changes++;
|
|
4739
|
+
i--;
|
|
4740
|
+
}
|
|
4741
|
+
}
|
|
4742
|
+
}
|
|
4743
|
+
})
|
|
4744
|
+
};
|
|
4834
4745
|
// webcrack/unminify/transforms/ternary-to-if.js
|
|
4835
4746
|
import { statement as statement2 } from "@babel/template";
|
|
4836
4747
|
var ternary_to_if_default = {
|
|
@@ -4871,8 +4782,33 @@ var ternary_to_if_default = {
|
|
|
4871
4782
|
};
|
|
4872
4783
|
}
|
|
4873
4784
|
};
|
|
4785
|
+
// webcrack/unminify/transforms/truncate-number-literal.js
|
|
4786
|
+
var truncate_number_literal_default = {
|
|
4787
|
+
name: "truncate-number-literal",
|
|
4788
|
+
tags: ["safe"],
|
|
4789
|
+
visitor: () => {
|
|
4790
|
+
const binaryOperators = or("|", "&", "^", "<<", ">>", ">>>");
|
|
4791
|
+
const literal = capture(numericLiteral());
|
|
4792
|
+
const matcher4 = or(binaryExpression(binaryOperators, literal, anything()), binaryExpression(binaryOperators, anything(), literal));
|
|
4793
|
+
return {
|
|
4794
|
+
BinaryExpression: {
|
|
4795
|
+
exit(path) {
|
|
4796
|
+
if (!matcher4.match(path.node))
|
|
4797
|
+
return;
|
|
4798
|
+
const value = literal.current.value;
|
|
4799
|
+
const isShifter = literal.current === path.node.right && (path.node.operator === "<<" || path.node.operator === ">>");
|
|
4800
|
+
const truncation = isShifter ? 31 : 4294967295;
|
|
4801
|
+
const truncated = value & truncation;
|
|
4802
|
+
if (truncated === value)
|
|
4803
|
+
return;
|
|
4804
|
+
literal.current.value = truncated;
|
|
4805
|
+
}
|
|
4806
|
+
}
|
|
4807
|
+
};
|
|
4808
|
+
}
|
|
4809
|
+
};
|
|
4874
4810
|
// webcrack/unminify/transforms/typeof-undefined.js
|
|
4875
|
-
import * as
|
|
4811
|
+
import * as t45 from "@babel/types";
|
|
4876
4812
|
var OPERATOR_MAP = {
|
|
4877
4813
|
">": "===",
|
|
4878
4814
|
"<": "!=="
|
|
@@ -4889,7 +4825,7 @@ var typeof_undefined_default = {
|
|
|
4889
4825
|
exit(path) {
|
|
4890
4826
|
if (!matcher4.match(path.node))
|
|
4891
4827
|
return;
|
|
4892
|
-
path.replaceWith(
|
|
4828
|
+
path.replaceWith(t45.binaryExpression(OPERATOR_MAP[operator.current], t45.unaryExpression("typeof", argument.current), t45.stringLiteral("undefined")));
|
|
4893
4829
|
this.changes++;
|
|
4894
4830
|
}
|
|
4895
4831
|
}
|
|
@@ -4897,7 +4833,7 @@ var typeof_undefined_default = {
|
|
|
4897
4833
|
}
|
|
4898
4834
|
};
|
|
4899
4835
|
// webcrack/unminify/transforms/unary-expressions.js
|
|
4900
|
-
import * as
|
|
4836
|
+
import * as t46 from "@babel/types";
|
|
4901
4837
|
var unary_expressions_default = {
|
|
4902
4838
|
name: "unary-expressions",
|
|
4903
4839
|
tags: ["safe"],
|
|
@@ -4919,7 +4855,7 @@ var unary_expressions_default = {
|
|
|
4919
4855
|
if (!returnVoid.match(path.node))
|
|
4920
4856
|
return;
|
|
4921
4857
|
path.replaceWith(argument.current);
|
|
4922
|
-
path.insertAfter(
|
|
4858
|
+
path.insertAfter(t46.returnStatement());
|
|
4923
4859
|
this.changes++;
|
|
4924
4860
|
}
|
|
4925
4861
|
}
|
|
@@ -4927,17 +4863,17 @@ var unary_expressions_default = {
|
|
|
4927
4863
|
}
|
|
4928
4864
|
};
|
|
4929
4865
|
// webcrack/unminify/transforms/unminify-booleans.js
|
|
4930
|
-
import * as
|
|
4866
|
+
import * as t47 from "@babel/types";
|
|
4931
4867
|
var unminify_booleans_default = {
|
|
4932
4868
|
name: "unminify-booleans",
|
|
4933
4869
|
tags: ["safe"],
|
|
4934
4870
|
visitor: () => ({
|
|
4935
4871
|
UnaryExpression(path) {
|
|
4936
4872
|
if (trueMatcher2.match(path.node)) {
|
|
4937
|
-
path.replaceWith(
|
|
4873
|
+
path.replaceWith(t47.booleanLiteral(true));
|
|
4938
4874
|
this.changes++;
|
|
4939
4875
|
} else if (falseMatcher2.match(path.node)) {
|
|
4940
|
-
path.replaceWith(
|
|
4876
|
+
path.replaceWith(t47.booleanLiteral(false));
|
|
4941
4877
|
this.changes++;
|
|
4942
4878
|
}
|
|
4943
4879
|
}
|
|
@@ -4946,7 +4882,7 @@ var unminify_booleans_default = {
|
|
|
4946
4882
|
var trueMatcher2 = or(unaryExpression("!", numericLiteral(0)), unaryExpression("!", unaryExpression("!", numericLiteral(1))), unaryExpression("!", unaryExpression("!", arrayExpression([]))));
|
|
4947
4883
|
var falseMatcher2 = or(unaryExpression("!", numericLiteral(1)), unaryExpression("!", arrayExpression([])));
|
|
4948
4884
|
// webcrack/unminify/transforms/void-to-undefined.js
|
|
4949
|
-
import * as
|
|
4885
|
+
import * as t48 from "@babel/types";
|
|
4950
4886
|
var void_to_undefined_default = {
|
|
4951
4887
|
name: "void-to-undefined",
|
|
4952
4888
|
tags: ["safe"],
|
|
@@ -4957,7 +4893,7 @@ var void_to_undefined_default = {
|
|
|
4957
4893
|
UnaryExpression: {
|
|
4958
4894
|
exit(path) {
|
|
4959
4895
|
if (matcher4.match(path.node) && !path.scope.hasBinding("undefined", { noGlobals: true })) {
|
|
4960
|
-
path.replaceWith(
|
|
4896
|
+
path.replaceWith(t48.identifier("undefined"));
|
|
4961
4897
|
this.changes++;
|
|
4962
4898
|
}
|
|
4963
4899
|
}
|
|
@@ -4966,7 +4902,7 @@ var void_to_undefined_default = {
|
|
|
4966
4902
|
}
|
|
4967
4903
|
};
|
|
4968
4904
|
// webcrack/unminify/transforms/yoda.js
|
|
4969
|
-
import * as
|
|
4905
|
+
import * as t49 from "@babel/types";
|
|
4970
4906
|
var FLIPPED_OPERATORS = {
|
|
4971
4907
|
"==": "==",
|
|
4972
4908
|
"===": "===",
|
|
@@ -4991,7 +4927,7 @@ var yoda_default = {
|
|
|
4991
4927
|
BinaryExpression: {
|
|
4992
4928
|
exit(path) {
|
|
4993
4929
|
if (matcher4.match(path.node)) {
|
|
4994
|
-
path.replaceWith(
|
|
4930
|
+
path.replaceWith(t49.binaryExpression(FLIPPED_OPERATORS[path.node.operator], path.node.right, path.node.left));
|
|
4995
4931
|
this.changes++;
|
|
4996
4932
|
}
|
|
4997
4933
|
}
|
|
@@ -5014,7 +4950,7 @@ async function transform5(ast2) {
|
|
|
5014
4950
|
const quickjs = await getQuickJS();
|
|
5015
4951
|
await applyTransformAsync(ast2, deobfuscate_default, async (code) => quickjs.evalCode(code, {
|
|
5016
4952
|
shouldInterrupt: shouldInterruptAfterDeadline(Date.now() + 2000),
|
|
5017
|
-
memoryLimitBytes:
|
|
4953
|
+
memoryLimitBytes: 4 * 1024 * 1024
|
|
5018
4954
|
}));
|
|
5019
4955
|
applyTransform2(ast2, unminify_default);
|
|
5020
4956
|
applyTransform2(ast2, merge_object_assignments_default);
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@delance/builder",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.7",
|
|
5
|
+
"packageManager": "pnpm@10.15.1+sha512.34e538c329b5553014ca8e8f4535997f96180a1d0f614339357449935350d924e22f8614682191264ec33d1462ac21561aff97f6bb18065351c162c7e8f6de67",
|
|
5
6
|
"description": "A spear to the Python language server built with black magic",
|
|
6
7
|
"author": "mochaaP <npm@mochaa.ws>",
|
|
7
8
|
"license": "0BSD",
|
|
@@ -20,18 +21,30 @@
|
|
|
20
21
|
"engines": {
|
|
21
22
|
"node": ">=18"
|
|
22
23
|
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "bun build.ts",
|
|
26
|
+
"build:minify": "bun run build --minify",
|
|
27
|
+
"build:webcrack": "tsc -p ./tsconfig.webcrack.json || :",
|
|
28
|
+
"check": "tsc; bun run lint",
|
|
29
|
+
"lint": "eslint .",
|
|
30
|
+
"lint:fix": "eslint . --fix",
|
|
31
|
+
"prebuild": "bun run build:webcrack",
|
|
32
|
+
"prepare": "bun run build",
|
|
33
|
+
"prepublishOnly": "rm -rf dist",
|
|
34
|
+
"start": "bun cli.ts"
|
|
35
|
+
},
|
|
23
36
|
"peerDependencies": {
|
|
24
37
|
"@babel/code-frame": "^7.26.2",
|
|
25
38
|
"@babel/helper-validator-identifier": "^7.25.9",
|
|
26
39
|
"debug": "^4.4.0"
|
|
27
40
|
},
|
|
28
41
|
"dependencies": {
|
|
29
|
-
"@babel/core": "^7.
|
|
30
|
-
"@babel/generator": "^7.
|
|
31
|
-
"@babel/parser": "^7.
|
|
32
|
-
"@babel/template": "^7.
|
|
33
|
-
"@babel/traverse": "^7.
|
|
34
|
-
"@babel/types": "^7.
|
|
42
|
+
"@babel/core": "^7.28.4",
|
|
43
|
+
"@babel/generator": "^7.28.3",
|
|
44
|
+
"@babel/parser": "^7.28.4",
|
|
45
|
+
"@babel/template": "^7.27.2",
|
|
46
|
+
"@babel/traverse": "^7.28.4",
|
|
47
|
+
"@babel/types": "^7.28.4",
|
|
35
48
|
"quickjs-emscripten": "^0.31.0"
|
|
36
49
|
},
|
|
37
50
|
"devDependencies": {
|
|
@@ -39,27 +52,22 @@
|
|
|
39
52
|
"@codemod/matchers": "npm:@codemod-esm/matchers@^1.7.2",
|
|
40
53
|
"@codemod/parser": "npm:@codemod-esm/parser@^1.4.3",
|
|
41
54
|
"@codemod/utils": "npm:@codemod-esm/utils@^1.1.2",
|
|
42
|
-
"@mochaa/eslintrc": "^0.1.
|
|
55
|
+
"@mochaa/eslintrc": "^0.1.13",
|
|
43
56
|
"@types/babel__core": "^7.20.5",
|
|
44
|
-
"@types/babel__generator": "^7.
|
|
57
|
+
"@types/babel__generator": "^7.27.0",
|
|
45
58
|
"@types/babel__helper-validator-identifier": "^7.15.2",
|
|
46
59
|
"@types/babel__template": "^7.4.4",
|
|
47
|
-
"@types/babel__traverse": "^7.
|
|
48
|
-
"@types/bun": "^1.2.
|
|
60
|
+
"@types/babel__traverse": "^7.28.0",
|
|
61
|
+
"@types/bun": "^1.2.21",
|
|
49
62
|
"@types/debug": "^4.1.12",
|
|
50
|
-
"bun": "^1.2.
|
|
51
|
-
"eslint": "^9.
|
|
52
|
-
"typescript": "^5.
|
|
63
|
+
"bun": "^1.2.21",
|
|
64
|
+
"eslint": "^9.35.0",
|
|
65
|
+
"typescript": "^5.9.2",
|
|
53
66
|
"webcrack": "github:j4k0xb/webcrack"
|
|
54
67
|
},
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"check": "tsc; bun run lint",
|
|
60
|
-
"lint": "eslint .",
|
|
61
|
-
"lint:fix": "eslint . --fix",
|
|
62
|
-
"prebuild": "bun run build:webcrack",
|
|
63
|
-
"start": "bun cli.ts"
|
|
68
|
+
"pnpm": {
|
|
69
|
+
"onlyBuiltDependencies": [
|
|
70
|
+
"bun"
|
|
71
|
+
]
|
|
64
72
|
}
|
|
65
|
-
}
|
|
73
|
+
}
|