@delance/builder 0.2.8 → 0.2.10
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 +13 -13
- package/dist/index.js +23 -21
- package/dist/transform/delance/stringaes.d.ts +1 -1
- package/package.json +6 -6
package/dist/cli.js
CHANGED
|
@@ -38,34 +38,34 @@ var bgBlack = formatter("\x1B[40m", "\x1B[49m");
|
|
|
38
38
|
var bgBlue = formatter("\x1B[44m", "\x1B[49m");
|
|
39
39
|
|
|
40
40
|
// cli.ts
|
|
41
|
-
var hl = function(...
|
|
41
|
+
var hl = function(..._arguments) {
|
|
42
42
|
return bgBlack(` ${dim(magenta("$"))} ${[...function* () {
|
|
43
|
-
for (let i = 0;i <
|
|
44
|
-
const
|
|
43
|
+
for (let i = 0;i < _arguments.length; i++) {
|
|
44
|
+
const argument = _arguments[i];
|
|
45
45
|
if (i === 0) {
|
|
46
|
-
yield yellow(
|
|
46
|
+
yield yellow(argument);
|
|
47
47
|
continue;
|
|
48
48
|
}
|
|
49
|
-
if (
|
|
49
|
+
if (argument === "|") {
|
|
50
50
|
yield green("|");
|
|
51
|
-
yield yellow(
|
|
51
|
+
yield yellow(_arguments[++i]);
|
|
52
52
|
continue;
|
|
53
53
|
}
|
|
54
|
-
if (
|
|
55
|
-
yield cyan(
|
|
54
|
+
if (argument.startsWith("-")) {
|
|
55
|
+
yield cyan(argument);
|
|
56
56
|
continue;
|
|
57
57
|
}
|
|
58
|
-
if (
|
|
59
|
-
yield dim(
|
|
58
|
+
if (argument.startsWith("#")) {
|
|
59
|
+
yield dim(_arguments.slice(i).join(" "));
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
62
|
if (true) {
|
|
63
|
-
if (
|
|
64
|
-
yield
|
|
63
|
+
if (argument.startsWith('"') && argument.endsWith('"') || argument.startsWith("\'") && argument.endsWith("\'")) {
|
|
64
|
+
yield argument[0] + magenta(argument.slice(1, -1)) + argument[0];
|
|
65
65
|
continue;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
yield
|
|
68
|
+
yield argument;
|
|
69
69
|
}
|
|
70
70
|
}()].join(" ")} `);
|
|
71
71
|
};
|
package/dist/index.js
CHANGED
|
@@ -3800,7 +3800,7 @@ async function transform2(ast2) {
|
|
|
3800
3800
|
const quickjs = await getQuickJS();
|
|
3801
3801
|
await applyTransformAsync(ast2, deobfuscate_default, async (code) => quickjs.evalCode(code, {
|
|
3802
3802
|
shouldInterrupt: shouldInterruptAfterDeadline(Date.now() + 2000),
|
|
3803
|
-
memoryLimitBytes:
|
|
3803
|
+
memoryLimitBytes: 2097152
|
|
3804
3804
|
}));
|
|
3805
3805
|
applyTransform(ast2, unminify_default);
|
|
3806
3806
|
applyTransform(ast2, merge_object_assignments_default);
|
|
@@ -4025,22 +4025,22 @@ var module_helper_default = {
|
|
|
4025
4025
|
const $chunks = $.get("properties");
|
|
4026
4026
|
for (const $chunk of $chunks) {
|
|
4027
4027
|
$chunk.assertObjectProperty();
|
|
4028
|
-
const $
|
|
4029
|
-
$
|
|
4030
|
-
const $p = $
|
|
4028
|
+
const $function = $chunk.get("value");
|
|
4029
|
+
$function.assertFunction();
|
|
4030
|
+
const $p = $function.get("params");
|
|
4031
4031
|
$p.forEach(($parameter, i) => {
|
|
4032
4032
|
$parameter.assertIdentifier();
|
|
4033
4033
|
switch (i) {
|
|
4034
4034
|
case 0: {
|
|
4035
|
-
$
|
|
4035
|
+
$function.scope.rename($parameter.node.name, "module");
|
|
4036
4036
|
break;
|
|
4037
4037
|
}
|
|
4038
4038
|
case 1: {
|
|
4039
|
-
$
|
|
4039
|
+
$function.scope.rename($parameter.node.name, "exports");
|
|
4040
4040
|
break;
|
|
4041
4041
|
}
|
|
4042
4042
|
case 2: {
|
|
4043
|
-
$
|
|
4043
|
+
$function.scope.rename($parameter.node.name, "require");
|
|
4044
4044
|
break;
|
|
4045
4045
|
}
|
|
4046
4046
|
default: {
|
|
@@ -4048,7 +4048,7 @@ var module_helper_default = {
|
|
|
4048
4048
|
}
|
|
4049
4049
|
}
|
|
4050
4050
|
});
|
|
4051
|
-
$
|
|
4051
|
+
$function.traverse({
|
|
4052
4052
|
VariableDeclaration: {
|
|
4053
4053
|
exit(p2) {
|
|
4054
4054
|
const $decl = p2.get("declarations.0");
|
|
@@ -4093,17 +4093,17 @@ var indirect_call_default = {
|
|
|
4093
4093
|
visitor: () => ({
|
|
4094
4094
|
CallExpression: {
|
|
4095
4095
|
exit($) {
|
|
4096
|
-
const { callee, arguments:
|
|
4096
|
+
const { callee, arguments: _arguments } = $.node;
|
|
4097
4097
|
if (!t37.isSequenceExpression(callee)) {
|
|
4098
4098
|
return;
|
|
4099
4099
|
}
|
|
4100
4100
|
const exprs = [...callee.expressions];
|
|
4101
|
-
const
|
|
4102
|
-
if (!t37.isMemberExpression(
|
|
4101
|
+
const _function = exprs.pop();
|
|
4102
|
+
if (!t37.isMemberExpression(_function)) {
|
|
4103
4103
|
return;
|
|
4104
4104
|
}
|
|
4105
4105
|
if (exprs.every((expr) => t37.isPureish(expr))) {
|
|
4106
|
-
$.replaceWith(t37.callExpression(
|
|
4106
|
+
$.replaceWith(t37.callExpression(_function, _arguments));
|
|
4107
4107
|
this.changes++;
|
|
4108
4108
|
}
|
|
4109
4109
|
}
|
|
@@ -4699,12 +4699,14 @@ var antifeature_default = {
|
|
|
4699
4699
|
const $callee = $.get("callee");
|
|
4700
4700
|
if ($callee.isMemberExpression()) {
|
|
4701
4701
|
const $main = $callee.get("object");
|
|
4702
|
-
$main
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4702
|
+
let $path = $main;
|
|
4703
|
+
if ($main.isIdentifier()) {
|
|
4704
|
+
const $binding = $.scope.getBinding($main.node.name);
|
|
4705
|
+
if (!$binding) {
|
|
4706
|
+
return;
|
|
4707
|
+
}
|
|
4708
|
+
$path = $binding.path;
|
|
4706
4709
|
}
|
|
4707
|
-
const $path = $binding.path;
|
|
4708
4710
|
$path.traverse({
|
|
4709
4711
|
CallExpression: {
|
|
4710
4712
|
exit($call) {
|
|
@@ -4735,7 +4737,7 @@ var antifeature_default = {
|
|
|
4735
4737
|
return;
|
|
4736
4738
|
}
|
|
4737
4739
|
const $value = $.get("right");
|
|
4738
|
-
let $
|
|
4740
|
+
let $function;
|
|
4739
4741
|
if ($value.isIdentifier()) {
|
|
4740
4742
|
const $binding = $.scope.getBinding($value.node.name);
|
|
4741
4743
|
if (!$binding) {
|
|
@@ -4745,15 +4747,15 @@ var antifeature_default = {
|
|
|
4745
4747
|
$path.assertFunction();
|
|
4746
4748
|
const $body = $path.get("body");
|
|
4747
4749
|
$body.assertBlockStatement();
|
|
4748
|
-
$
|
|
4750
|
+
$function = $body;
|
|
4749
4751
|
} else if ($value.isFunction()) {
|
|
4750
4752
|
const $body = $value.get("body");
|
|
4751
4753
|
$body.assertBlockStatement();
|
|
4752
|
-
$
|
|
4754
|
+
$function = $body;
|
|
4753
4755
|
} else {
|
|
4754
4756
|
return;
|
|
4755
4757
|
}
|
|
4756
|
-
$
|
|
4758
|
+
$function.replaceWith(tmpl6.statement.ast`{
|
|
4757
4759
|
return;
|
|
4758
4760
|
}`);
|
|
4759
4761
|
this.changes++;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@delance/builder",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"description": "A spear to the Python language server built with black magic",
|
|
5
5
|
"license": "0BSD",
|
|
6
6
|
"author": "mochaaP <npm@mochaa.ws>",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@babel/template": "esm",
|
|
67
67
|
"@babel/traverse": "esm",
|
|
68
68
|
"@babel/types": "esm",
|
|
69
|
-
"quickjs-emscripten": "^0.
|
|
69
|
+
"quickjs-emscripten": "^0.29.1"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@codemod/core": "https://gitpkg.vercel.app/api/pkg.tgz?url=codemod-js/codemod/packages/core&commit=c39500f305f11f7fa99e037c950a3c89017ed227&scripts.postinstall=rimraf tsconfig.json",
|
|
@@ -78,13 +78,13 @@
|
|
|
78
78
|
"@types/babel__helper-validator-identifier": "^7.15.2",
|
|
79
79
|
"@types/babel__template": "^7.4.4",
|
|
80
80
|
"@types/babel__traverse": "^7.20.5",
|
|
81
|
-
"@types/bun": "^1.0.
|
|
81
|
+
"@types/bun": "^1.0.11",
|
|
82
82
|
"@types/debug": "^4.1.12",
|
|
83
|
-
"bun": "^1.0.
|
|
83
|
+
"bun": "^1.0.35",
|
|
84
84
|
"rimraf": "^5.0.5",
|
|
85
|
-
"typescript": "^5.4.
|
|
85
|
+
"typescript": "^5.4.3",
|
|
86
86
|
"webcrack": "https://gitpkg.vercel.app/api/pkg.tgz?url=j4k0xb/webcrack/packages/webcrack&commit=1287443b72a6af593cf186771bd5b2d6afb7b9db&scripts.postinstall=rimraf tsconfig.json",
|
|
87
|
-
"xo": "^0.
|
|
87
|
+
"xo": "^0.58.0"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|
|
90
90
|
"debug": "^4"
|