@delance/builder 0.2.15 → 0.2.16
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 +34 -34
- package/dist/index.js +526 -503
- package/dist/transform/esmodule/module-helper.d.ts +1 -1
- package/package.json +14 -16
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __export = (target, all) => {
|
|
3
4
|
for (var name in all)
|
|
@@ -8,14 +9,15 @@ var __export = (target, all) => {
|
|
|
8
9
|
set: (newValue) => all[name] = () => newValue
|
|
9
10
|
});
|
|
10
11
|
};
|
|
12
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
11
13
|
|
|
12
14
|
// transform/webcrack/index.ts
|
|
13
|
-
import {getQuickJS, shouldInterruptAfterDeadline} from "quickjs-emscripten";
|
|
15
|
+
import { getQuickJS, shouldInterruptAfterDeadline } from "quickjs-emscripten";
|
|
14
16
|
|
|
15
17
|
// /home/mochaa/ghq/git.sr.ht/~self/delance-builder/node_modules/webcrack/src/deobfuscate/index.ts
|
|
16
18
|
import debug3 from "debug";
|
|
17
19
|
|
|
18
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
20
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/ast-utils/ast.ts
|
|
19
21
|
import * as t from "@babel/types";
|
|
20
22
|
function getPropName(node) {
|
|
21
23
|
if (t.isIdentifier(node)) {
|
|
@@ -28,8 +30,9 @@ function getPropName(node) {
|
|
|
28
30
|
return node.value.toString();
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
33
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/ast-utils/generator.ts
|
|
32
34
|
import babelGenerate from "@babel/generator";
|
|
35
|
+
var defaultOptions = { jsescOption: { minimal: true } };
|
|
33
36
|
function generate(ast, options = defaultOptions) {
|
|
34
37
|
return babelGenerate(ast, options).code;
|
|
35
38
|
}
|
|
@@ -44,9 +47,8 @@ function codePreview(node) {
|
|
|
44
47
|
}
|
|
45
48
|
return code;
|
|
46
49
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
import traverse4 from "@babel/traverse";
|
|
50
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/ast-utils/inline.ts
|
|
51
|
+
import traverse2 from "@babel/traverse";
|
|
50
52
|
import * as t13 from "@babel/types";
|
|
51
53
|
|
|
52
54
|
// node_modules/.pnpm/@codemod+matchers@https+++gitpkg.vercel.app+api+pkg.tgz+url=codemod-js+codemod+packages+match_y3mhqth3x437cu4u7tvyd2tjkm/node_modules/@codemod/matchers/src/matchers/anyExpression.ts
|
|
@@ -63,15 +65,14 @@ class Matcher {
|
|
|
63
65
|
}
|
|
64
66
|
|
|
65
67
|
// node_modules/.pnpm/@codemod+matchers@https+++gitpkg.vercel.app+api+pkg.tgz+url=codemod-js+codemod+packages+match_y3mhqth3x437cu4u7tvyd2tjkm/node_modules/@codemod/matchers/src/matchers/anyExpression.ts
|
|
66
|
-
function anyExpression() {
|
|
67
|
-
return new AnyExpressionMatcher;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
68
|
class AnyExpressionMatcher extends Matcher {
|
|
71
69
|
matchValue(value) {
|
|
72
70
|
return t2.isNode(value) && t2.isExpression(value);
|
|
73
71
|
}
|
|
74
72
|
}
|
|
73
|
+
function anyExpression() {
|
|
74
|
+
return new AnyExpressionMatcher;
|
|
75
|
+
}
|
|
75
76
|
// node_modules/.pnpm/@codemod+matchers@https+++gitpkg.vercel.app+api+pkg.tgz+url=codemod-js+codemod+packages+match_y3mhqth3x437cu4u7tvyd2tjkm/node_modules/@codemod/matchers/src/utils/distributeAcrossSlices.ts
|
|
76
77
|
function* distributeAcrossSlices(slices, available) {
|
|
77
78
|
if (slices.length === 0) {
|
|
@@ -93,17 +94,30 @@ function* distributeAcrossSlices(slices, available) {
|
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
// node_modules/.pnpm/@codemod+matchers@https+++gitpkg.vercel.app+api+pkg.tgz+url=codemod-js+codemod+packages+match_y3mhqth3x437cu4u7tvyd2tjkm/node_modules/@codemod/matchers/src/matchers/anything.ts
|
|
96
|
-
function anything() {
|
|
97
|
-
return new AnythingMatcher;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
97
|
class AnythingMatcher extends Matcher {
|
|
101
98
|
matchValue(value) {
|
|
102
99
|
return true;
|
|
103
100
|
}
|
|
104
101
|
}
|
|
102
|
+
function anything() {
|
|
103
|
+
return new AnythingMatcher;
|
|
104
|
+
}
|
|
105
105
|
|
|
106
106
|
// node_modules/.pnpm/@codemod+matchers@https+++gitpkg.vercel.app+api+pkg.tgz+url=codemod-js+codemod+packages+match_y3mhqth3x437cu4u7tvyd2tjkm/node_modules/@codemod/matchers/src/matchers/slice.ts
|
|
107
|
+
class SliceMatcher extends Matcher {
|
|
108
|
+
min;
|
|
109
|
+
max;
|
|
110
|
+
matcher;
|
|
111
|
+
constructor(min, max, matcher) {
|
|
112
|
+
super();
|
|
113
|
+
this.min = min;
|
|
114
|
+
this.max = max;
|
|
115
|
+
this.matcher = matcher;
|
|
116
|
+
}
|
|
117
|
+
matchValue(value, keys) {
|
|
118
|
+
return this.matcher.matchValue(value, keys);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
107
121
|
function zeroOrMore(matcher = anything()) {
|
|
108
122
|
return new SliceMatcher(0, Infinity, matcher);
|
|
109
123
|
}
|
|
@@ -127,26 +141,8 @@ function slice(optionsOrLength, matcherOrUndefined) {
|
|
|
127
141
|
}
|
|
128
142
|
return new SliceMatcher(min, max, matcher);
|
|
129
143
|
}
|
|
130
|
-
class SliceMatcher extends Matcher {
|
|
131
|
-
min;
|
|
132
|
-
max;
|
|
133
|
-
matcher;
|
|
134
|
-
constructor(min, max, matcher) {
|
|
135
|
-
super();
|
|
136
|
-
this.min = min;
|
|
137
|
-
this.max = max;
|
|
138
|
-
this.matcher = matcher;
|
|
139
|
-
}
|
|
140
|
-
matchValue(value, keys) {
|
|
141
|
-
return this.matcher.matchValue(value, keys);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
144
|
|
|
145
145
|
// node_modules/.pnpm/@codemod+matchers@https+++gitpkg.vercel.app+api+pkg.tgz+url=codemod-js+codemod+packages+match_y3mhqth3x437cu4u7tvyd2tjkm/node_modules/@codemod/matchers/src/matchers/anyList.ts
|
|
146
|
-
function anyList(...elements) {
|
|
147
|
-
return new AnyListMatcher(elements);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
146
|
class AnyListMatcher extends Matcher {
|
|
151
147
|
matchers;
|
|
152
148
|
sliceMatchers = [];
|
|
@@ -200,25 +196,23 @@ class AnyListMatcher extends Matcher {
|
|
|
200
196
|
return false;
|
|
201
197
|
}
|
|
202
198
|
}
|
|
199
|
+
function anyList(...elements) {
|
|
200
|
+
return new AnyListMatcher(elements);
|
|
201
|
+
}
|
|
203
202
|
// node_modules/.pnpm/@codemod+matchers@https+++gitpkg.vercel.app+api+pkg.tgz+url=codemod-js+codemod+packages+match_y3mhqth3x437cu4u7tvyd2tjkm/node_modules/@codemod/matchers/src/matchers/anyNode.ts
|
|
204
203
|
import * as t3 from "@babel/types";
|
|
205
204
|
// node_modules/.pnpm/@codemod+matchers@https+++gitpkg.vercel.app+api+pkg.tgz+url=codemod-js+codemod+packages+match_y3mhqth3x437cu4u7tvyd2tjkm/node_modules/@codemod/matchers/src/matchers/anyStatement.ts
|
|
206
205
|
import * as t4 from "@babel/types";
|
|
207
206
|
// node_modules/.pnpm/@codemod+matchers@https+++gitpkg.vercel.app+api+pkg.tgz+url=codemod-js+codemod+packages+match_y3mhqth3x437cu4u7tvyd2tjkm/node_modules/@codemod/matchers/src/matchers/anyString.ts
|
|
208
|
-
function anyString() {
|
|
209
|
-
return new StringMatcher;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
207
|
class StringMatcher extends Matcher {
|
|
213
208
|
matchValue(value) {
|
|
214
209
|
return typeof value === "string" || value instanceof String;
|
|
215
210
|
}
|
|
216
211
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
return new ArrayOfMatcher(elementMatcher);
|
|
212
|
+
function anyString() {
|
|
213
|
+
return new StringMatcher;
|
|
220
214
|
}
|
|
221
|
-
|
|
215
|
+
// node_modules/.pnpm/@codemod+matchers@https+++gitpkg.vercel.app+api+pkg.tgz+url=codemod-js+codemod+packages+match_y3mhqth3x437cu4u7tvyd2tjkm/node_modules/@codemod/matchers/src/matchers/arrayOf.ts
|
|
222
216
|
class ArrayOfMatcher extends Matcher {
|
|
223
217
|
elementMatcher;
|
|
224
218
|
constructor(elementMatcher) {
|
|
@@ -237,11 +231,10 @@ class ArrayOfMatcher extends Matcher {
|
|
|
237
231
|
return true;
|
|
238
232
|
}
|
|
239
233
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
return new CapturedMatcher(matcher);
|
|
234
|
+
function arrayOf(elementMatcher) {
|
|
235
|
+
return new ArrayOfMatcher(elementMatcher);
|
|
243
236
|
}
|
|
244
|
-
|
|
237
|
+
// node_modules/.pnpm/@codemod+matchers@https+++gitpkg.vercel.app+api+pkg.tgz+url=codemod-js+codemod+packages+match_y3mhqth3x437cu4u7tvyd2tjkm/node_modules/@codemod/matchers/src/matchers/capture.ts
|
|
245
238
|
class CapturedMatcher extends Matcher {
|
|
246
239
|
matcher;
|
|
247
240
|
_current;
|
|
@@ -269,12 +262,11 @@ class CapturedMatcher extends Matcher {
|
|
|
269
262
|
this._currentKeys = keys;
|
|
270
263
|
}
|
|
271
264
|
}
|
|
265
|
+
function capture(matcher) {
|
|
266
|
+
return new CapturedMatcher(matcher);
|
|
267
|
+
}
|
|
272
268
|
// node_modules/.pnpm/@codemod+matchers@https+++gitpkg.vercel.app+api+pkg.tgz+url=codemod-js+codemod+packages+match_y3mhqth3x437cu4u7tvyd2tjkm/node_modules/@codemod/matchers/src/matchers/containerOf.ts
|
|
273
269
|
import * as t5 from "@babel/types";
|
|
274
|
-
function containerOf(containedMatcher) {
|
|
275
|
-
return new ContainerOfMatcher(containedMatcher);
|
|
276
|
-
}
|
|
277
|
-
|
|
278
270
|
class ContainerOfMatcher extends CapturedMatcher {
|
|
279
271
|
containedMatcher;
|
|
280
272
|
constructor(containedMatcher) {
|
|
@@ -304,6 +296,9 @@ class ContainerOfMatcher extends CapturedMatcher {
|
|
|
304
296
|
return false;
|
|
305
297
|
}
|
|
306
298
|
}
|
|
299
|
+
function containerOf(containedMatcher) {
|
|
300
|
+
return new ContainerOfMatcher(containedMatcher);
|
|
301
|
+
}
|
|
307
302
|
// /home/mochaa/ghq/git.sr.ht/~self/delance-builder/node_modules/@codemod/utils/src/index.ts
|
|
308
303
|
import * as Babel from "@babel/core";
|
|
309
304
|
import * as t9 from "@babel/types";
|
|
@@ -312,12 +307,12 @@ import * as t9 from "@babel/types";
|
|
|
312
307
|
import * as t6 from "@babel/types";
|
|
313
308
|
var { BUILDER_KEYS, NODE_FIELDS } = t6;
|
|
314
309
|
// node_modules/.pnpm/@codemod+utils@https+++gitpkg.vercel.app+api+pkg.tgz+url=codemod-js+codemod+packages+utils&co_nwjtgzgerilv5helbn32zsr2ei/node_modules/@codemod/utils/src/builders.ts
|
|
315
|
-
import
|
|
310
|
+
import traverse from "@babel/traverse";
|
|
316
311
|
import * as t7 from "@babel/types";
|
|
317
312
|
|
|
318
313
|
// /home/mochaa/ghq/git.sr.ht/~self/delance-builder/node_modules/@codemod/parser/src/index.ts
|
|
319
314
|
import {
|
|
320
|
-
parse as babelParse
|
|
315
|
+
parse as babelParse
|
|
321
316
|
} from "@babel/parser";
|
|
322
317
|
|
|
323
318
|
// node_modules/.pnpm/@codemod+parser@https+++gitpkg.vercel.app+api+pkg.tgz+url=codemod-js+codemod+packages+parser&_ox3mjiaipayjwtjxtrryvsdtqu/node_modules/@codemod/parser/src/options.ts
|
|
@@ -397,10 +392,6 @@ function nodesEquivalent(a, b) {
|
|
|
397
392
|
return true;
|
|
398
393
|
}
|
|
399
394
|
// node_modules/.pnpm/@codemod+matchers@https+++gitpkg.vercel.app+api+pkg.tgz+url=codemod-js+codemod+packages+match_y3mhqth3x437cu4u7tvyd2tjkm/node_modules/@codemod/matchers/src/matchers/fromCapture.ts
|
|
400
|
-
function fromCapture(capturedMatcher) {
|
|
401
|
-
return new FromCaptureMatcher(capturedMatcher);
|
|
402
|
-
}
|
|
403
|
-
|
|
404
395
|
class FromCaptureMatcher extends Matcher {
|
|
405
396
|
capturedMatcher;
|
|
406
397
|
constructor(capturedMatcher) {
|
|
@@ -414,14 +405,13 @@ class FromCaptureMatcher extends Matcher {
|
|
|
414
405
|
return this.capturedMatcher.current === value;
|
|
415
406
|
}
|
|
416
407
|
}
|
|
408
|
+
function fromCapture(capturedMatcher) {
|
|
409
|
+
return new FromCaptureMatcher(capturedMatcher);
|
|
410
|
+
}
|
|
417
411
|
// node_modules/.pnpm/@codemod+matchers@https+++gitpkg.vercel.app+api+pkg.tgz+url=codemod-js+codemod+packages+match_y3mhqth3x437cu4u7tvyd2tjkm/node_modules/@codemod/matchers/src/matchers/function.ts
|
|
418
412
|
import * as t10 from "@babel/types";
|
|
419
413
|
|
|
420
414
|
// node_modules/.pnpm/@codemod+matchers@https+++gitpkg.vercel.app+api+pkg.tgz+url=codemod-js+codemod+packages+match_y3mhqth3x437cu4u7tvyd2tjkm/node_modules/@codemod/matchers/src/matchers/tupleOf.ts
|
|
421
|
-
function tupleOf(...matchers) {
|
|
422
|
-
return new TupleOfMatcher(...matchers);
|
|
423
|
-
}
|
|
424
|
-
|
|
425
415
|
class TupleOfMatcher extends Matcher {
|
|
426
416
|
matchers;
|
|
427
417
|
constructor(...matchers) {
|
|
@@ -445,140 +435,11 @@ class TupleOfMatcher extends Matcher {
|
|
|
445
435
|
return true;
|
|
446
436
|
}
|
|
447
437
|
}
|
|
438
|
+
function tupleOf(...matchers) {
|
|
439
|
+
return new TupleOfMatcher(...matchers);
|
|
440
|
+
}
|
|
448
441
|
// node_modules/.pnpm/@codemod+matchers@https+++gitpkg.vercel.app+api+pkg.tgz+url=codemod-js+codemod+packages+match_y3mhqth3x437cu4u7tvyd2tjkm/node_modules/@codemod/matchers/src/matchers/generated.ts
|
|
449
442
|
import * as t11 from "@babel/types";
|
|
450
|
-
function arrayExpression(elements) {
|
|
451
|
-
return new ArrayExpressionMatcher(elements);
|
|
452
|
-
}
|
|
453
|
-
function arrayPattern(elements) {
|
|
454
|
-
return new ArrayPatternMatcher(elements);
|
|
455
|
-
}
|
|
456
|
-
function arrowFunctionExpression(params, body, async) {
|
|
457
|
-
return new ArrowFunctionExpressionMatcher(params, body, async);
|
|
458
|
-
}
|
|
459
|
-
function assignmentExpression(operator, left, right) {
|
|
460
|
-
return new AssignmentExpressionMatcher(operator, left, right);
|
|
461
|
-
}
|
|
462
|
-
function binaryExpression(operator, left, right) {
|
|
463
|
-
return new BinaryExpressionMatcher(operator, left, right);
|
|
464
|
-
}
|
|
465
|
-
function blockStatement(body, directives) {
|
|
466
|
-
return new BlockStatementMatcher(body, directives);
|
|
467
|
-
}
|
|
468
|
-
function booleanLiteral(value) {
|
|
469
|
-
return new BooleanLiteralMatcher(value);
|
|
470
|
-
}
|
|
471
|
-
function breakStatement(label) {
|
|
472
|
-
return new BreakStatementMatcher(label);
|
|
473
|
-
}
|
|
474
|
-
function callExpression(callee, _arguments) {
|
|
475
|
-
return new CallExpressionMatcher(callee, _arguments);
|
|
476
|
-
}
|
|
477
|
-
function classMethod(kind, key, params, body, computed, _static, generator2, async) {
|
|
478
|
-
return new ClassMethodMatcher(kind, key, params, body, computed, _static, generator2, async);
|
|
479
|
-
}
|
|
480
|
-
function classProperty(key, value, typeAnnotation, decorators, computed, _static) {
|
|
481
|
-
return new ClassPropertyMatcher(key, value, typeAnnotation, decorators, computed, _static);
|
|
482
|
-
}
|
|
483
|
-
function conditionalExpression(test, consequent, alternate) {
|
|
484
|
-
return new ConditionalExpressionMatcher(test, consequent, alternate);
|
|
485
|
-
}
|
|
486
|
-
function continueStatement(label) {
|
|
487
|
-
return new ContinueStatementMatcher(label);
|
|
488
|
-
}
|
|
489
|
-
function expressionStatement(expression) {
|
|
490
|
-
return new ExpressionStatementMatcher(expression);
|
|
491
|
-
}
|
|
492
|
-
function forInStatement(left, right, body) {
|
|
493
|
-
return new ForInStatementMatcher(left, right, body);
|
|
494
|
-
}
|
|
495
|
-
function forStatement(init, test, update, body) {
|
|
496
|
-
return new ForStatementMatcher(init, test, update, body);
|
|
497
|
-
}
|
|
498
|
-
function functionDeclaration(id, params, body, generator2, async) {
|
|
499
|
-
return new FunctionDeclarationMatcher(id, params, body, generator2, async);
|
|
500
|
-
}
|
|
501
|
-
function functionExpression(id, params, body, generator2, async) {
|
|
502
|
-
return new FunctionExpressionMatcher(id, params, body, generator2, async);
|
|
503
|
-
}
|
|
504
|
-
function identifier(name) {
|
|
505
|
-
return new IdentifierMatcher(name);
|
|
506
|
-
}
|
|
507
|
-
function ifStatement(test, consequent, alternate) {
|
|
508
|
-
return new IfStatementMatcher(test, consequent, alternate);
|
|
509
|
-
}
|
|
510
|
-
function logicalExpression(operator, left, right) {
|
|
511
|
-
return new LogicalExpressionMatcher(operator, left, right);
|
|
512
|
-
}
|
|
513
|
-
function memberExpression(object, property, computed, optional) {
|
|
514
|
-
return new MemberExpressionMatcher(object, property, computed, optional);
|
|
515
|
-
}
|
|
516
|
-
function nullLiteral() {
|
|
517
|
-
return new NullLiteralMatcher;
|
|
518
|
-
}
|
|
519
|
-
function numericLiteral(value) {
|
|
520
|
-
return new NumericLiteralMatcher(value);
|
|
521
|
-
}
|
|
522
|
-
function objectExpression(properties) {
|
|
523
|
-
return new ObjectExpressionMatcher(properties);
|
|
524
|
-
}
|
|
525
|
-
function objectMethod(kind, key, params, body, computed, generator2, async) {
|
|
526
|
-
return new ObjectMethodMatcher(kind, key, params, body, computed, generator2, async);
|
|
527
|
-
}
|
|
528
|
-
function objectPattern(properties) {
|
|
529
|
-
return new ObjectPatternMatcher(properties);
|
|
530
|
-
}
|
|
531
|
-
function objectProperty(key, value, computed, shorthand, decorators) {
|
|
532
|
-
return new ObjectPropertyMatcher(key, value, computed, shorthand, decorators);
|
|
533
|
-
}
|
|
534
|
-
function optionalMemberExpression(object, property, computed, optional) {
|
|
535
|
-
return new OptionalMemberExpressionMatcher(object, property, computed, optional);
|
|
536
|
-
}
|
|
537
|
-
function restElement(argument) {
|
|
538
|
-
return new RestElementMatcher(argument);
|
|
539
|
-
}
|
|
540
|
-
function returnStatement(argument) {
|
|
541
|
-
return new ReturnStatementMatcher(argument);
|
|
542
|
-
}
|
|
543
|
-
function sequenceExpression(expressions) {
|
|
544
|
-
return new SequenceExpressionMatcher(expressions);
|
|
545
|
-
}
|
|
546
|
-
function spreadElement(argument) {
|
|
547
|
-
return new SpreadElementMatcher(argument);
|
|
548
|
-
}
|
|
549
|
-
function stringLiteral(value) {
|
|
550
|
-
return new StringLiteralMatcher(value);
|
|
551
|
-
}
|
|
552
|
-
function switchCase(test, consequent) {
|
|
553
|
-
return new SwitchCaseMatcher(test, consequent);
|
|
554
|
-
}
|
|
555
|
-
function switchStatement(discriminant, cases) {
|
|
556
|
-
return new SwitchStatementMatcher(discriminant, cases);
|
|
557
|
-
}
|
|
558
|
-
function templateLiteral(quasis, expressions) {
|
|
559
|
-
return new TemplateLiteralMatcher(quasis, expressions);
|
|
560
|
-
}
|
|
561
|
-
function thisExpression() {
|
|
562
|
-
return new ThisExpressionMatcher;
|
|
563
|
-
}
|
|
564
|
-
function tryStatement(block, handler, finalizer) {
|
|
565
|
-
return new TryStatementMatcher(block, handler, finalizer);
|
|
566
|
-
}
|
|
567
|
-
function unaryExpression(operator, argument, prefix) {
|
|
568
|
-
return new UnaryExpressionMatcher(operator, argument, prefix);
|
|
569
|
-
}
|
|
570
|
-
function updateExpression(operator, argument, prefix) {
|
|
571
|
-
return new UpdateExpressionMatcher(operator, argument, prefix);
|
|
572
|
-
}
|
|
573
|
-
function variableDeclaration(kind, declarations) {
|
|
574
|
-
return new VariableDeclarationMatcher(kind, declarations);
|
|
575
|
-
}
|
|
576
|
-
function variableDeclarator(id, init) {
|
|
577
|
-
return new VariableDeclaratorMatcher(id, init);
|
|
578
|
-
}
|
|
579
|
-
function whileStatement(test, body) {
|
|
580
|
-
return new WhileStatementMatcher(test, body);
|
|
581
|
-
}
|
|
582
443
|
class ArrayExpressionMatcher extends Matcher {
|
|
583
444
|
elements;
|
|
584
445
|
constructor(elements) {
|
|
@@ -603,6 +464,9 @@ class ArrayExpressionMatcher extends Matcher {
|
|
|
603
464
|
return true;
|
|
604
465
|
}
|
|
605
466
|
}
|
|
467
|
+
function arrayExpression(elements) {
|
|
468
|
+
return new ArrayExpressionMatcher(elements);
|
|
469
|
+
}
|
|
606
470
|
|
|
607
471
|
class ArrayPatternMatcher extends Matcher {
|
|
608
472
|
elements;
|
|
@@ -628,6 +492,9 @@ class ArrayPatternMatcher extends Matcher {
|
|
|
628
492
|
return true;
|
|
629
493
|
}
|
|
630
494
|
}
|
|
495
|
+
function arrayPattern(elements) {
|
|
496
|
+
return new ArrayPatternMatcher(elements);
|
|
497
|
+
}
|
|
631
498
|
class ArrowFunctionExpressionMatcher extends Matcher {
|
|
632
499
|
params;
|
|
633
500
|
body;
|
|
@@ -668,6 +535,9 @@ class ArrowFunctionExpressionMatcher extends Matcher {
|
|
|
668
535
|
return true;
|
|
669
536
|
}
|
|
670
537
|
}
|
|
538
|
+
function arrowFunctionExpression(params, body, async) {
|
|
539
|
+
return new ArrowFunctionExpressionMatcher(params, body, async);
|
|
540
|
+
}
|
|
671
541
|
|
|
672
542
|
class AssignmentExpressionMatcher extends Matcher {
|
|
673
543
|
operator;
|
|
@@ -702,6 +572,9 @@ class AssignmentExpressionMatcher extends Matcher {
|
|
|
702
572
|
return true;
|
|
703
573
|
}
|
|
704
574
|
}
|
|
575
|
+
function assignmentExpression(operator, left, right) {
|
|
576
|
+
return new AssignmentExpressionMatcher(operator, left, right);
|
|
577
|
+
}
|
|
705
578
|
class BinaryExpressionMatcher extends Matcher {
|
|
706
579
|
operator;
|
|
707
580
|
left;
|
|
@@ -735,6 +608,9 @@ class BinaryExpressionMatcher extends Matcher {
|
|
|
735
608
|
return true;
|
|
736
609
|
}
|
|
737
610
|
}
|
|
611
|
+
function binaryExpression(operator, left, right) {
|
|
612
|
+
return new BinaryExpressionMatcher(operator, left, right);
|
|
613
|
+
}
|
|
738
614
|
class BlockStatementMatcher extends Matcher {
|
|
739
615
|
body;
|
|
740
616
|
directives;
|
|
@@ -769,6 +645,9 @@ class BlockStatementMatcher extends Matcher {
|
|
|
769
645
|
return true;
|
|
770
646
|
}
|
|
771
647
|
}
|
|
648
|
+
function blockStatement(body, directives) {
|
|
649
|
+
return new BlockStatementMatcher(body, directives);
|
|
650
|
+
}
|
|
772
651
|
|
|
773
652
|
class BooleanLiteralMatcher extends Matcher {
|
|
774
653
|
value;
|
|
@@ -791,6 +670,9 @@ class BooleanLiteralMatcher extends Matcher {
|
|
|
791
670
|
return true;
|
|
792
671
|
}
|
|
793
672
|
}
|
|
673
|
+
function booleanLiteral(value) {
|
|
674
|
+
return new BooleanLiteralMatcher(value);
|
|
675
|
+
}
|
|
794
676
|
class BreakStatementMatcher extends Matcher {
|
|
795
677
|
label;
|
|
796
678
|
constructor(label) {
|
|
@@ -812,6 +694,9 @@ class BreakStatementMatcher extends Matcher {
|
|
|
812
694
|
return true;
|
|
813
695
|
}
|
|
814
696
|
}
|
|
697
|
+
function breakStatement(label) {
|
|
698
|
+
return new BreakStatementMatcher(label);
|
|
699
|
+
}
|
|
815
700
|
|
|
816
701
|
class CallExpressionMatcher extends Matcher {
|
|
817
702
|
callee;
|
|
@@ -843,6 +728,9 @@ class CallExpressionMatcher extends Matcher {
|
|
|
843
728
|
return true;
|
|
844
729
|
}
|
|
845
730
|
}
|
|
731
|
+
function callExpression(callee, _arguments) {
|
|
732
|
+
return new CallExpressionMatcher(callee, _arguments);
|
|
733
|
+
}
|
|
846
734
|
class ClassMethodMatcher extends Matcher {
|
|
847
735
|
kind;
|
|
848
736
|
key;
|
|
@@ -850,9 +738,9 @@ class ClassMethodMatcher extends Matcher {
|
|
|
850
738
|
body;
|
|
851
739
|
computed;
|
|
852
740
|
_static;
|
|
853
|
-
|
|
741
|
+
generator;
|
|
854
742
|
async;
|
|
855
|
-
constructor(kind, key, params, body, computed, _static,
|
|
743
|
+
constructor(kind, key, params, body, computed, _static, generator, async) {
|
|
856
744
|
super();
|
|
857
745
|
this.kind = kind;
|
|
858
746
|
this.key = key;
|
|
@@ -860,7 +748,7 @@ class ClassMethodMatcher extends Matcher {
|
|
|
860
748
|
this.body = body;
|
|
861
749
|
this.computed = computed;
|
|
862
750
|
this._static = _static;
|
|
863
|
-
this.generator =
|
|
751
|
+
this.generator = generator;
|
|
864
752
|
this.async = async;
|
|
865
753
|
}
|
|
866
754
|
matchValue(node, keys) {
|
|
@@ -929,6 +817,9 @@ class ClassMethodMatcher extends Matcher {
|
|
|
929
817
|
return true;
|
|
930
818
|
}
|
|
931
819
|
}
|
|
820
|
+
function classMethod(kind, key, params, body, computed, _static, generator, async) {
|
|
821
|
+
return new ClassMethodMatcher(kind, key, params, body, computed, _static, generator, async);
|
|
822
|
+
}
|
|
932
823
|
class ClassPropertyMatcher extends Matcher {
|
|
933
824
|
key;
|
|
934
825
|
value;
|
|
@@ -1006,6 +897,9 @@ class ClassPropertyMatcher extends Matcher {
|
|
|
1006
897
|
return true;
|
|
1007
898
|
}
|
|
1008
899
|
}
|
|
900
|
+
function classProperty(key, value, typeAnnotation, decorators, computed, _static) {
|
|
901
|
+
return new ClassPropertyMatcher(key, value, typeAnnotation, decorators, computed, _static);
|
|
902
|
+
}
|
|
1009
903
|
|
|
1010
904
|
class ConditionalExpressionMatcher extends Matcher {
|
|
1011
905
|
test;
|
|
@@ -1036,6 +930,9 @@ class ConditionalExpressionMatcher extends Matcher {
|
|
|
1036
930
|
return true;
|
|
1037
931
|
}
|
|
1038
932
|
}
|
|
933
|
+
function conditionalExpression(test, consequent, alternate) {
|
|
934
|
+
return new ConditionalExpressionMatcher(test, consequent, alternate);
|
|
935
|
+
}
|
|
1039
936
|
|
|
1040
937
|
class ContinueStatementMatcher extends Matcher {
|
|
1041
938
|
label;
|
|
@@ -1058,6 +955,9 @@ class ContinueStatementMatcher extends Matcher {
|
|
|
1058
955
|
return true;
|
|
1059
956
|
}
|
|
1060
957
|
}
|
|
958
|
+
function continueStatement(label) {
|
|
959
|
+
return new ContinueStatementMatcher(label);
|
|
960
|
+
}
|
|
1061
961
|
class ExpressionStatementMatcher extends Matcher {
|
|
1062
962
|
expression;
|
|
1063
963
|
constructor(expression) {
|
|
@@ -1075,6 +975,9 @@ class ExpressionStatementMatcher extends Matcher {
|
|
|
1075
975
|
return true;
|
|
1076
976
|
}
|
|
1077
977
|
}
|
|
978
|
+
function expressionStatement(expression) {
|
|
979
|
+
return new ExpressionStatementMatcher(expression);
|
|
980
|
+
}
|
|
1078
981
|
class ForInStatementMatcher extends Matcher {
|
|
1079
982
|
left;
|
|
1080
983
|
right;
|
|
@@ -1104,6 +1007,9 @@ class ForInStatementMatcher extends Matcher {
|
|
|
1104
1007
|
return true;
|
|
1105
1008
|
}
|
|
1106
1009
|
}
|
|
1010
|
+
function forInStatement(left, right, body) {
|
|
1011
|
+
return new ForInStatementMatcher(left, right, body);
|
|
1012
|
+
}
|
|
1107
1013
|
class ForStatementMatcher extends Matcher {
|
|
1108
1014
|
init;
|
|
1109
1015
|
test;
|
|
@@ -1151,19 +1057,22 @@ class ForStatementMatcher extends Matcher {
|
|
|
1151
1057
|
return true;
|
|
1152
1058
|
}
|
|
1153
1059
|
}
|
|
1060
|
+
function forStatement(init, test, update, body) {
|
|
1061
|
+
return new ForStatementMatcher(init, test, update, body);
|
|
1062
|
+
}
|
|
1154
1063
|
|
|
1155
1064
|
class FunctionDeclarationMatcher extends Matcher {
|
|
1156
1065
|
id;
|
|
1157
1066
|
params;
|
|
1158
1067
|
body;
|
|
1159
|
-
|
|
1068
|
+
generator;
|
|
1160
1069
|
async;
|
|
1161
|
-
constructor(id, params, body,
|
|
1070
|
+
constructor(id, params, body, generator, async) {
|
|
1162
1071
|
super();
|
|
1163
1072
|
this.id = id;
|
|
1164
1073
|
this.params = params;
|
|
1165
1074
|
this.body = body;
|
|
1166
|
-
this.generator =
|
|
1075
|
+
this.generator = generator;
|
|
1167
1076
|
this.async = async;
|
|
1168
1077
|
}
|
|
1169
1078
|
matchValue(node, keys) {
|
|
@@ -1212,19 +1121,22 @@ class FunctionDeclarationMatcher extends Matcher {
|
|
|
1212
1121
|
return true;
|
|
1213
1122
|
}
|
|
1214
1123
|
}
|
|
1124
|
+
function functionDeclaration(id, params, body, generator, async) {
|
|
1125
|
+
return new FunctionDeclarationMatcher(id, params, body, generator, async);
|
|
1126
|
+
}
|
|
1215
1127
|
|
|
1216
1128
|
class FunctionExpressionMatcher extends Matcher {
|
|
1217
1129
|
id;
|
|
1218
1130
|
params;
|
|
1219
1131
|
body;
|
|
1220
|
-
|
|
1132
|
+
generator;
|
|
1221
1133
|
async;
|
|
1222
|
-
constructor(id, params, body,
|
|
1134
|
+
constructor(id, params, body, generator, async) {
|
|
1223
1135
|
super();
|
|
1224
1136
|
this.id = id;
|
|
1225
1137
|
this.params = params;
|
|
1226
1138
|
this.body = body;
|
|
1227
|
-
this.generator =
|
|
1139
|
+
this.generator = generator;
|
|
1228
1140
|
this.async = async;
|
|
1229
1141
|
}
|
|
1230
1142
|
matchValue(node, keys) {
|
|
@@ -1273,6 +1185,9 @@ class FunctionExpressionMatcher extends Matcher {
|
|
|
1273
1185
|
return true;
|
|
1274
1186
|
}
|
|
1275
1187
|
}
|
|
1188
|
+
function functionExpression(id, params, body, generator, async) {
|
|
1189
|
+
return new FunctionExpressionMatcher(id, params, body, generator, async);
|
|
1190
|
+
}
|
|
1276
1191
|
class IdentifierMatcher extends Matcher {
|
|
1277
1192
|
name;
|
|
1278
1193
|
constructor(name) {
|
|
@@ -1294,6 +1209,9 @@ class IdentifierMatcher extends Matcher {
|
|
|
1294
1209
|
return true;
|
|
1295
1210
|
}
|
|
1296
1211
|
}
|
|
1212
|
+
function identifier(name) {
|
|
1213
|
+
return new IdentifierMatcher(name);
|
|
1214
|
+
}
|
|
1297
1215
|
|
|
1298
1216
|
class IfStatementMatcher extends Matcher {
|
|
1299
1217
|
test;
|
|
@@ -1328,6 +1246,9 @@ class IfStatementMatcher extends Matcher {
|
|
|
1328
1246
|
return true;
|
|
1329
1247
|
}
|
|
1330
1248
|
}
|
|
1249
|
+
function ifStatement(test, consequent, alternate) {
|
|
1250
|
+
return new IfStatementMatcher(test, consequent, alternate);
|
|
1251
|
+
}
|
|
1331
1252
|
class LogicalExpressionMatcher extends Matcher {
|
|
1332
1253
|
operator;
|
|
1333
1254
|
left;
|
|
@@ -1361,6 +1282,9 @@ class LogicalExpressionMatcher extends Matcher {
|
|
|
1361
1282
|
return true;
|
|
1362
1283
|
}
|
|
1363
1284
|
}
|
|
1285
|
+
function logicalExpression(operator, left, right) {
|
|
1286
|
+
return new LogicalExpressionMatcher(operator, left, right);
|
|
1287
|
+
}
|
|
1364
1288
|
|
|
1365
1289
|
class MemberExpressionMatcher extends Matcher {
|
|
1366
1290
|
object;
|
|
@@ -1409,6 +1333,9 @@ class MemberExpressionMatcher extends Matcher {
|
|
|
1409
1333
|
return true;
|
|
1410
1334
|
}
|
|
1411
1335
|
}
|
|
1336
|
+
function memberExpression(object, property, computed, optional) {
|
|
1337
|
+
return new MemberExpressionMatcher(object, property, computed, optional);
|
|
1338
|
+
}
|
|
1412
1339
|
class NullLiteralMatcher extends Matcher {
|
|
1413
1340
|
constructor() {
|
|
1414
1341
|
super();
|
|
@@ -1420,6 +1347,9 @@ class NullLiteralMatcher extends Matcher {
|
|
|
1420
1347
|
return true;
|
|
1421
1348
|
}
|
|
1422
1349
|
}
|
|
1350
|
+
function nullLiteral() {
|
|
1351
|
+
return new NullLiteralMatcher;
|
|
1352
|
+
}
|
|
1423
1353
|
class NumericLiteralMatcher extends Matcher {
|
|
1424
1354
|
value;
|
|
1425
1355
|
constructor(value) {
|
|
@@ -1441,6 +1371,9 @@ class NumericLiteralMatcher extends Matcher {
|
|
|
1441
1371
|
return true;
|
|
1442
1372
|
}
|
|
1443
1373
|
}
|
|
1374
|
+
function numericLiteral(value) {
|
|
1375
|
+
return new NumericLiteralMatcher(value);
|
|
1376
|
+
}
|
|
1444
1377
|
|
|
1445
1378
|
class ObjectExpressionMatcher extends Matcher {
|
|
1446
1379
|
properties;
|
|
@@ -1466,6 +1399,9 @@ class ObjectExpressionMatcher extends Matcher {
|
|
|
1466
1399
|
return true;
|
|
1467
1400
|
}
|
|
1468
1401
|
}
|
|
1402
|
+
function objectExpression(properties) {
|
|
1403
|
+
return new ObjectExpressionMatcher(properties);
|
|
1404
|
+
}
|
|
1469
1405
|
|
|
1470
1406
|
class ObjectMethodMatcher extends Matcher {
|
|
1471
1407
|
kind;
|
|
@@ -1473,16 +1409,16 @@ class ObjectMethodMatcher extends Matcher {
|
|
|
1473
1409
|
params;
|
|
1474
1410
|
body;
|
|
1475
1411
|
computed;
|
|
1476
|
-
|
|
1412
|
+
generator;
|
|
1477
1413
|
async;
|
|
1478
|
-
constructor(kind, key, params, body, computed,
|
|
1414
|
+
constructor(kind, key, params, body, computed, generator, async) {
|
|
1479
1415
|
super();
|
|
1480
1416
|
this.kind = kind;
|
|
1481
1417
|
this.key = key;
|
|
1482
1418
|
this.params = params;
|
|
1483
1419
|
this.body = body;
|
|
1484
1420
|
this.computed = computed;
|
|
1485
|
-
this.generator =
|
|
1421
|
+
this.generator = generator;
|
|
1486
1422
|
this.async = async;
|
|
1487
1423
|
}
|
|
1488
1424
|
matchValue(node, keys) {
|
|
@@ -1543,6 +1479,9 @@ class ObjectMethodMatcher extends Matcher {
|
|
|
1543
1479
|
return true;
|
|
1544
1480
|
}
|
|
1545
1481
|
}
|
|
1482
|
+
function objectMethod(kind, key, params, body, computed, generator, async) {
|
|
1483
|
+
return new ObjectMethodMatcher(kind, key, params, body, computed, generator, async);
|
|
1484
|
+
}
|
|
1546
1485
|
|
|
1547
1486
|
class ObjectPatternMatcher extends Matcher {
|
|
1548
1487
|
properties;
|
|
@@ -1568,6 +1507,9 @@ class ObjectPatternMatcher extends Matcher {
|
|
|
1568
1507
|
return true;
|
|
1569
1508
|
}
|
|
1570
1509
|
}
|
|
1510
|
+
function objectPattern(properties) {
|
|
1511
|
+
return new ObjectPatternMatcher(properties);
|
|
1512
|
+
}
|
|
1571
1513
|
|
|
1572
1514
|
class ObjectPropertyMatcher extends Matcher {
|
|
1573
1515
|
key;
|
|
@@ -1629,6 +1571,9 @@ class ObjectPropertyMatcher extends Matcher {
|
|
|
1629
1571
|
return true;
|
|
1630
1572
|
}
|
|
1631
1573
|
}
|
|
1574
|
+
function objectProperty(key, value, computed, shorthand, decorators) {
|
|
1575
|
+
return new ObjectPropertyMatcher(key, value, computed, shorthand, decorators);
|
|
1576
|
+
}
|
|
1632
1577
|
class OptionalMemberExpressionMatcher extends Matcher {
|
|
1633
1578
|
object;
|
|
1634
1579
|
property;
|
|
@@ -1672,6 +1617,9 @@ class OptionalMemberExpressionMatcher extends Matcher {
|
|
|
1672
1617
|
return true;
|
|
1673
1618
|
}
|
|
1674
1619
|
}
|
|
1620
|
+
function optionalMemberExpression(object, property, computed, optional) {
|
|
1621
|
+
return new OptionalMemberExpressionMatcher(object, property, computed, optional);
|
|
1622
|
+
}
|
|
1675
1623
|
class RestElementMatcher extends Matcher {
|
|
1676
1624
|
argument;
|
|
1677
1625
|
constructor(argument) {
|
|
@@ -1689,6 +1637,9 @@ class RestElementMatcher extends Matcher {
|
|
|
1689
1637
|
return true;
|
|
1690
1638
|
}
|
|
1691
1639
|
}
|
|
1640
|
+
function restElement(argument) {
|
|
1641
|
+
return new RestElementMatcher(argument);
|
|
1642
|
+
}
|
|
1692
1643
|
|
|
1693
1644
|
class ReturnStatementMatcher extends Matcher {
|
|
1694
1645
|
argument;
|
|
@@ -1711,6 +1662,9 @@ class ReturnStatementMatcher extends Matcher {
|
|
|
1711
1662
|
return true;
|
|
1712
1663
|
}
|
|
1713
1664
|
}
|
|
1665
|
+
function returnStatement(argument) {
|
|
1666
|
+
return new ReturnStatementMatcher(argument);
|
|
1667
|
+
}
|
|
1714
1668
|
|
|
1715
1669
|
class SequenceExpressionMatcher extends Matcher {
|
|
1716
1670
|
expressions;
|
|
@@ -1736,6 +1690,9 @@ class SequenceExpressionMatcher extends Matcher {
|
|
|
1736
1690
|
return true;
|
|
1737
1691
|
}
|
|
1738
1692
|
}
|
|
1693
|
+
function sequenceExpression(expressions) {
|
|
1694
|
+
return new SequenceExpressionMatcher(expressions);
|
|
1695
|
+
}
|
|
1739
1696
|
|
|
1740
1697
|
class SpreadElementMatcher extends Matcher {
|
|
1741
1698
|
argument;
|
|
@@ -1754,6 +1711,9 @@ class SpreadElementMatcher extends Matcher {
|
|
|
1754
1711
|
return true;
|
|
1755
1712
|
}
|
|
1756
1713
|
}
|
|
1714
|
+
function spreadElement(argument) {
|
|
1715
|
+
return new SpreadElementMatcher(argument);
|
|
1716
|
+
}
|
|
1757
1717
|
class StringLiteralMatcher extends Matcher {
|
|
1758
1718
|
value;
|
|
1759
1719
|
constructor(value) {
|
|
@@ -1775,6 +1735,9 @@ class StringLiteralMatcher extends Matcher {
|
|
|
1775
1735
|
return true;
|
|
1776
1736
|
}
|
|
1777
1737
|
}
|
|
1738
|
+
function stringLiteral(value) {
|
|
1739
|
+
return new StringLiteralMatcher(value);
|
|
1740
|
+
}
|
|
1778
1741
|
class SwitchCaseMatcher extends Matcher {
|
|
1779
1742
|
test;
|
|
1780
1743
|
consequent;
|
|
@@ -1809,6 +1772,9 @@ class SwitchCaseMatcher extends Matcher {
|
|
|
1809
1772
|
return true;
|
|
1810
1773
|
}
|
|
1811
1774
|
}
|
|
1775
|
+
function switchCase(test, consequent) {
|
|
1776
|
+
return new SwitchCaseMatcher(test, consequent);
|
|
1777
|
+
}
|
|
1812
1778
|
|
|
1813
1779
|
class SwitchStatementMatcher extends Matcher {
|
|
1814
1780
|
discriminant;
|
|
@@ -1843,6 +1809,9 @@ class SwitchStatementMatcher extends Matcher {
|
|
|
1843
1809
|
return true;
|
|
1844
1810
|
}
|
|
1845
1811
|
}
|
|
1812
|
+
function switchStatement(discriminant, cases) {
|
|
1813
|
+
return new SwitchStatementMatcher(discriminant, cases);
|
|
1814
|
+
}
|
|
1846
1815
|
class TemplateLiteralMatcher extends Matcher {
|
|
1847
1816
|
quasis;
|
|
1848
1817
|
expressions;
|
|
@@ -1880,6 +1849,9 @@ class TemplateLiteralMatcher extends Matcher {
|
|
|
1880
1849
|
return true;
|
|
1881
1850
|
}
|
|
1882
1851
|
}
|
|
1852
|
+
function templateLiteral(quasis, expressions) {
|
|
1853
|
+
return new TemplateLiteralMatcher(quasis, expressions);
|
|
1854
|
+
}
|
|
1883
1855
|
|
|
1884
1856
|
class ThisExpressionMatcher extends Matcher {
|
|
1885
1857
|
constructor() {
|
|
@@ -1892,6 +1864,9 @@ class ThisExpressionMatcher extends Matcher {
|
|
|
1892
1864
|
return true;
|
|
1893
1865
|
}
|
|
1894
1866
|
}
|
|
1867
|
+
function thisExpression() {
|
|
1868
|
+
return new ThisExpressionMatcher;
|
|
1869
|
+
}
|
|
1895
1870
|
class TryStatementMatcher extends Matcher {
|
|
1896
1871
|
block;
|
|
1897
1872
|
handler;
|
|
@@ -1929,6 +1904,9 @@ class TryStatementMatcher extends Matcher {
|
|
|
1929
1904
|
return true;
|
|
1930
1905
|
}
|
|
1931
1906
|
}
|
|
1907
|
+
function tryStatement(block, handler, finalizer) {
|
|
1908
|
+
return new TryStatementMatcher(block, handler, finalizer);
|
|
1909
|
+
}
|
|
1932
1910
|
class UnaryExpressionMatcher extends Matcher {
|
|
1933
1911
|
operator;
|
|
1934
1912
|
argument;
|
|
@@ -1966,6 +1944,9 @@ class UnaryExpressionMatcher extends Matcher {
|
|
|
1966
1944
|
return true;
|
|
1967
1945
|
}
|
|
1968
1946
|
}
|
|
1947
|
+
function unaryExpression(operator, argument, prefix) {
|
|
1948
|
+
return new UnaryExpressionMatcher(operator, argument, prefix);
|
|
1949
|
+
}
|
|
1969
1950
|
class UpdateExpressionMatcher extends Matcher {
|
|
1970
1951
|
operator;
|
|
1971
1952
|
argument;
|
|
@@ -2003,6 +1984,9 @@ class UpdateExpressionMatcher extends Matcher {
|
|
|
2003
1984
|
return true;
|
|
2004
1985
|
}
|
|
2005
1986
|
}
|
|
1987
|
+
function updateExpression(operator, argument, prefix) {
|
|
1988
|
+
return new UpdateExpressionMatcher(operator, argument, prefix);
|
|
1989
|
+
}
|
|
2006
1990
|
class VariableDeclarationMatcher extends Matcher {
|
|
2007
1991
|
kind;
|
|
2008
1992
|
declarations;
|
|
@@ -2040,6 +2024,9 @@ class VariableDeclarationMatcher extends Matcher {
|
|
|
2040
2024
|
return true;
|
|
2041
2025
|
}
|
|
2042
2026
|
}
|
|
2027
|
+
function variableDeclaration(kind, declarations) {
|
|
2028
|
+
return new VariableDeclarationMatcher(kind, declarations);
|
|
2029
|
+
}
|
|
2043
2030
|
|
|
2044
2031
|
class VariableDeclaratorMatcher extends Matcher {
|
|
2045
2032
|
id;
|
|
@@ -2068,6 +2055,9 @@ class VariableDeclaratorMatcher extends Matcher {
|
|
|
2068
2055
|
return true;
|
|
2069
2056
|
}
|
|
2070
2057
|
}
|
|
2058
|
+
function variableDeclarator(id, init) {
|
|
2059
|
+
return new VariableDeclaratorMatcher(id, init);
|
|
2060
|
+
}
|
|
2071
2061
|
class WhileStatementMatcher extends Matcher {
|
|
2072
2062
|
test;
|
|
2073
2063
|
body;
|
|
@@ -2091,11 +2081,10 @@ class WhileStatementMatcher extends Matcher {
|
|
|
2091
2081
|
return true;
|
|
2092
2082
|
}
|
|
2093
2083
|
}
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
return new OrMatcher(...matchersOrValues);
|
|
2084
|
+
function whileStatement(test, body) {
|
|
2085
|
+
return new WhileStatementMatcher(test, body);
|
|
2097
2086
|
}
|
|
2098
|
-
|
|
2087
|
+
// node_modules/.pnpm/@codemod+matchers@https+++gitpkg.vercel.app+api+pkg.tgz+url=codemod-js+codemod+packages+match_y3mhqth3x437cu4u7tvyd2tjkm/node_modules/@codemod/matchers/src/matchers/or.ts
|
|
2099
2088
|
class OrMatcher extends Matcher {
|
|
2100
2089
|
matchersOrValues;
|
|
2101
2090
|
constructor(...matchersOrValues) {
|
|
@@ -2115,23 +2104,26 @@ class OrMatcher extends Matcher {
|
|
|
2115
2104
|
return false;
|
|
2116
2105
|
}
|
|
2117
2106
|
}
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
return new PredicateMatcher(predicate2);
|
|
2107
|
+
function or(...matchersOrValues) {
|
|
2108
|
+
return new OrMatcher(...matchersOrValues);
|
|
2121
2109
|
}
|
|
2122
|
-
|
|
2110
|
+
// node_modules/.pnpm/@codemod+matchers@https+++gitpkg.vercel.app+api+pkg.tgz+url=codemod-js+codemod+packages+match_y3mhqth3x437cu4u7tvyd2tjkm/node_modules/@codemod/matchers/src/matchers/predicate.ts
|
|
2123
2111
|
class PredicateMatcher extends Matcher {
|
|
2124
|
-
|
|
2125
|
-
constructor(
|
|
2112
|
+
predicate;
|
|
2113
|
+
constructor(predicate) {
|
|
2126
2114
|
super();
|
|
2127
|
-
this.predicate =
|
|
2115
|
+
this.predicate = predicate;
|
|
2128
2116
|
}
|
|
2129
2117
|
matchValue(value) {
|
|
2130
2118
|
return this.predicate(value);
|
|
2131
2119
|
}
|
|
2132
2120
|
}
|
|
2133
|
-
|
|
2121
|
+
function predicate(predicate2) {
|
|
2122
|
+
return new PredicateMatcher(predicate2);
|
|
2123
|
+
}
|
|
2124
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/ast-utils/matcher.ts
|
|
2134
2125
|
import * as t12 from "@babel/types";
|
|
2126
|
+
var safeLiteral = predicate((node) => t12.isLiteral(node) && (!t12.isTemplateLiteral(node) || node.expressions.length === 0));
|
|
2135
2127
|
function infiniteLoop(body) {
|
|
2136
2128
|
return or(forStatement(undefined, null, undefined, body), forStatement(undefined, truthyMatcher, undefined, body), whileStatement(truthyMatcher, body));
|
|
2137
2129
|
}
|
|
@@ -2144,11 +2136,17 @@ function constObjectProperty(value) {
|
|
|
2144
2136
|
function matchIife(body) {
|
|
2145
2137
|
return callExpression(functionExpression(null, [], body ? blockStatement(body) : undefined), []);
|
|
2146
2138
|
}
|
|
2139
|
+
var iife = matchIife();
|
|
2140
|
+
var emptyIife = matchIife([]);
|
|
2147
2141
|
function constMemberExpression(object, property) {
|
|
2148
2142
|
if (typeof object === "string")
|
|
2149
2143
|
object = identifier(object);
|
|
2150
2144
|
return or(memberExpression(object, identifier(property), false), memberExpression(object, stringLiteral(property), true));
|
|
2151
2145
|
}
|
|
2146
|
+
var undefinedMatcher = or(identifier("undefined"), unaryExpression("void", numericLiteral(0)));
|
|
2147
|
+
var trueMatcher = or(booleanLiteral(true), unaryExpression("!", numericLiteral(0)), unaryExpression("!", unaryExpression("!", numericLiteral(1))), unaryExpression("!", unaryExpression("!", arrayExpression([]))));
|
|
2148
|
+
var falseMatcher = or(booleanLiteral(false), unaryExpression("!", arrayExpression([])));
|
|
2149
|
+
var truthyMatcher = or(trueMatcher, arrayExpression([]));
|
|
2152
2150
|
function findParent(path, matcher) {
|
|
2153
2151
|
return path.findParent((path2) => matcher.match(path2.node));
|
|
2154
2152
|
}
|
|
@@ -2174,15 +2172,8 @@ function isReadonlyObject(binding, memberAccess) {
|
|
|
2174
2172
|
function isTemporaryVariable(binding, references, kind = "var") {
|
|
2175
2173
|
return binding !== undefined && binding.references === references && binding.constantViolations.length === 1 && (kind === "var" ? binding.path.isVariableDeclarator() && binding.path.node.init === null : binding.path.listKey === "params" && binding.path.isIdentifier());
|
|
2176
2174
|
}
|
|
2177
|
-
var safeLiteral = predicate((node) => t12.isLiteral(node) && (!t12.isTemplateLiteral(node) || node.expressions.length === 0));
|
|
2178
|
-
var iife = matchIife();
|
|
2179
|
-
var emptyIife = matchIife([]);
|
|
2180
|
-
var undefinedMatcher = or(identifier("undefined"), unaryExpression("void", numericLiteral(0)));
|
|
2181
|
-
var trueMatcher = or(booleanLiteral(true), unaryExpression("!", numericLiteral(0)), unaryExpression("!", unaryExpression("!", numericLiteral(1))), unaryExpression("!", unaryExpression("!", arrayExpression([]))));
|
|
2182
|
-
var falseMatcher = or(booleanLiteral(false), unaryExpression("!", arrayExpression([])));
|
|
2183
|
-
var truthyMatcher = or(trueMatcher, arrayExpression([]));
|
|
2184
2175
|
|
|
2185
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
2176
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/ast-utils/inline.ts
|
|
2186
2177
|
function inlineVariable(binding, value = anyExpression(), unsafeAssignments = false) {
|
|
2187
2178
|
const varDeclarator = binding.path.node;
|
|
2188
2179
|
const varMatcher = variableDeclarator(identifier(binding.identifier.name), value);
|
|
@@ -2192,15 +2183,24 @@ function inlineVariable(binding, value = anyExpression(), unsafeAssignments = fa
|
|
|
2192
2183
|
ref.replaceWith(varDeclarator.init);
|
|
2193
2184
|
});
|
|
2194
2185
|
binding.path.remove();
|
|
2195
|
-
} else if (unsafeAssignments && binding.constantViolations.length
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
if (
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
assignment
|
|
2186
|
+
} else if (unsafeAssignments && binding.constantViolations.length >= 1) {
|
|
2187
|
+
let getNearestAssignment = function(location) {
|
|
2188
|
+
return assignments.findLast((assignment) => assignment.start < location);
|
|
2189
|
+
};
|
|
2190
|
+
const assignments = binding.constantViolations.map((path) => path.node).filter((node) => assignmentMatcher.match(node));
|
|
2191
|
+
if (!assignments.length)
|
|
2192
|
+
return;
|
|
2193
|
+
for (const ref of binding.referencePaths) {
|
|
2194
|
+
const assignment = getNearestAssignment(ref.node.start);
|
|
2195
|
+
if (assignment)
|
|
2196
|
+
ref.replaceWith(assignment.right);
|
|
2197
|
+
}
|
|
2198
|
+
for (const path of binding.constantViolations) {
|
|
2199
|
+
if (path.parentPath?.isExpressionStatement()) {
|
|
2200
|
+
path.remove();
|
|
2201
|
+
} else if (path.isAssignmentExpression()) {
|
|
2202
|
+
path.replaceWith(path.node.right);
|
|
2203
|
+
}
|
|
2204
2204
|
}
|
|
2205
2205
|
binding.path.remove();
|
|
2206
2206
|
}
|
|
@@ -2211,7 +2211,7 @@ function inlineArrayElements(array, references) {
|
|
|
2211
2211
|
const property = memberPath.node.property;
|
|
2212
2212
|
const index = property.value;
|
|
2213
2213
|
const replacement = array.elements[index];
|
|
2214
|
-
memberPath.replaceWith(replacement);
|
|
2214
|
+
memberPath.replaceWith(t13.cloneNode(replacement));
|
|
2215
2215
|
}
|
|
2216
2216
|
}
|
|
2217
2217
|
function inlineObjectProperties(binding, property = objectProperty()) {
|
|
@@ -2242,7 +2242,7 @@ function inlineFunction(fn, caller) {
|
|
|
2242
2242
|
}
|
|
2243
2243
|
const returnedValue = fn.body.body[0].argument;
|
|
2244
2244
|
const clone = t13.cloneNode(returnedValue, true);
|
|
2245
|
-
|
|
2245
|
+
traverse2(clone, {
|
|
2246
2246
|
Identifier(path) {
|
|
2247
2247
|
const paramIndex = fn.params.findIndex((p) => p.name === path.node.name);
|
|
2248
2248
|
if (paramIndex !== -1) {
|
|
@@ -2261,8 +2261,8 @@ function inlineFunctionAliases(binding) {
|
|
|
2261
2261
|
const fn = findParent(ref, functionDeclaration());
|
|
2262
2262
|
const fnName = capture(anyString());
|
|
2263
2263
|
const returnedCall = capture(callExpression(identifier(binding.identifier.name), anyList(slice({ min: 2 }))));
|
|
2264
|
-
const
|
|
2265
|
-
if (fn &&
|
|
2264
|
+
const matcher = functionDeclaration(identifier(fnName), anyList(slice({ min: 2 })), blockStatement([returnStatement(returnedCall)]));
|
|
2265
|
+
if (fn && matcher.match(fn.node)) {
|
|
2266
2266
|
const paramUsedInDecodeCall = fn.node.params.some((param) => {
|
|
2267
2267
|
const binding2 = fn.scope.getBinding(param.name);
|
|
2268
2268
|
return binding2?.referencePaths.some((ref2) => ref2.findParent((p) => p.node === returnedCall.current));
|
|
@@ -2290,9 +2290,9 @@ function inlineVariableAliases(binding, targetName = binding.identifier.name) {
|
|
|
2290
2290
|
const state = { changes: 0 };
|
|
2291
2291
|
const refs = [...binding.referencePaths];
|
|
2292
2292
|
const varName = capture(anyString());
|
|
2293
|
-
const
|
|
2293
|
+
const matcher = or(variableDeclarator(identifier(varName), identifier(binding.identifier.name)), assignmentExpression("=", identifier(varName), identifier(binding.identifier.name)));
|
|
2294
2294
|
for (const ref of refs) {
|
|
2295
|
-
if (
|
|
2295
|
+
if (matcher.match(ref.parent)) {
|
|
2296
2296
|
const varScope = ref.scope;
|
|
2297
2297
|
const varBinding = varScope.getBinding(varName.current);
|
|
2298
2298
|
if (!varBinding)
|
|
@@ -2305,7 +2305,7 @@ function inlineVariableAliases(binding, targetName = binding.identifier.name) {
|
|
|
2305
2305
|
if (t13.isExpressionStatement(ref.parentPath.parent)) {
|
|
2306
2306
|
ref.parentPath.remove();
|
|
2307
2307
|
} else {
|
|
2308
|
-
ref.parentPath.replaceWith(
|
|
2308
|
+
ref.parentPath.replaceWith(t13.identifier(targetName));
|
|
2309
2309
|
}
|
|
2310
2310
|
} else if (ref.parentPath?.isVariableDeclarator()) {
|
|
2311
2311
|
ref.parentPath.remove();
|
|
@@ -2318,11 +2318,13 @@ function inlineVariableAliases(binding, targetName = binding.identifier.name) {
|
|
|
2318
2318
|
}
|
|
2319
2319
|
return state;
|
|
2320
2320
|
}
|
|
2321
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
2322
|
-
import
|
|
2321
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/ast-utils/rename.ts
|
|
2322
|
+
import traverse3 from "@babel/traverse";
|
|
2323
2323
|
import * as t14 from "@babel/types";
|
|
2324
2324
|
function renameFast(binding, newName) {
|
|
2325
2325
|
binding.referencePaths.forEach((ref) => {
|
|
2326
|
+
if (ref.isExportDefaultDeclaration())
|
|
2327
|
+
return;
|
|
2326
2328
|
if (!ref.isIdentifier()) {
|
|
2327
2329
|
throw new Error(`Unexpected reference (${ref.type}): ${codePreview(ref.node)}`);
|
|
2328
2330
|
}
|
|
@@ -2338,10 +2340,19 @@ function renameFast(binding, newName) {
|
|
|
2338
2340
|
ref.node.left.name = newName;
|
|
2339
2341
|
} else if (ref.isUpdateExpression() && t14.isIdentifier(ref.node.argument)) {
|
|
2340
2342
|
ref.node.argument.name = newName;
|
|
2343
|
+
} else if (ref.isUnaryExpression({ operator: "delete" }) && t14.isIdentifier(ref.node.argument)) {
|
|
2344
|
+
ref.node.argument.name = newName;
|
|
2341
2345
|
} else if (ref.isVariableDeclarator() && t14.isIdentifier(ref.node.id)) {
|
|
2342
2346
|
ref.node.id.name = newName;
|
|
2347
|
+
} else if (ref.isVariableDeclarator() && t14.isArrayPattern(ref.node.id)) {
|
|
2348
|
+
const ids = ref.getBindingIdentifiers();
|
|
2349
|
+
for (const id in ids) {
|
|
2350
|
+
if (id === binding.identifier.name) {
|
|
2351
|
+
ids[id].name = newName;
|
|
2352
|
+
}
|
|
2353
|
+
}
|
|
2343
2354
|
} else if (ref.isFor() || patternMatcher.match(ref.node)) {
|
|
2344
|
-
|
|
2355
|
+
traverse3(ref.node, {
|
|
2345
2356
|
Identifier(path) {
|
|
2346
2357
|
if (path.scope !== ref.scope)
|
|
2347
2358
|
return path.skip();
|
|
@@ -2361,34 +2372,35 @@ function renameFast(binding, newName) {
|
|
|
2361
2372
|
binding.scope.bindings[newName] = binding;
|
|
2362
2373
|
binding.identifier.name = newName;
|
|
2363
2374
|
}
|
|
2364
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
2365
|
-
import
|
|
2375
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/ast-utils/transform.ts
|
|
2376
|
+
import traverse4, { visitors } from "@babel/traverse";
|
|
2366
2377
|
import debug from "debug";
|
|
2367
|
-
|
|
2378
|
+
var logger = debug("webcrack:transforms");
|
|
2379
|
+
async function applyTransformAsync(ast, transform, options) {
|
|
2368
2380
|
logger(`${transform.name}: started`);
|
|
2369
2381
|
const state = { changes: 0 };
|
|
2370
|
-
await transform.run?.(ast, state,
|
|
2382
|
+
await transform.run?.(ast, state, options);
|
|
2371
2383
|
if (transform.visitor)
|
|
2372
|
-
|
|
2384
|
+
traverse4(ast, transform.visitor(options), undefined, state);
|
|
2373
2385
|
logger(`${transform.name}: finished with ${state.changes} changes`);
|
|
2374
2386
|
return state;
|
|
2375
2387
|
}
|
|
2376
|
-
function applyTransform(ast, transform,
|
|
2388
|
+
function applyTransform(ast, transform, options) {
|
|
2377
2389
|
logger(`${transform.name}: started`);
|
|
2378
2390
|
const state = { changes: 0 };
|
|
2379
|
-
transform.run?.(ast, state,
|
|
2391
|
+
transform.run?.(ast, state, options);
|
|
2380
2392
|
if (transform.visitor) {
|
|
2381
|
-
const visitor = transform.visitor(
|
|
2393
|
+
const visitor = transform.visitor(options);
|
|
2382
2394
|
visitor.noScope = !transform.scope;
|
|
2383
|
-
|
|
2395
|
+
traverse4(ast, visitor, undefined, state);
|
|
2384
2396
|
}
|
|
2385
2397
|
logger(`${transform.name}: finished with ${state.changes} changes`);
|
|
2386
2398
|
return state;
|
|
2387
2399
|
}
|
|
2388
|
-
function applyTransforms(ast, transforms,
|
|
2389
|
-
|
|
2390
|
-
const name =
|
|
2391
|
-
if (
|
|
2400
|
+
function applyTransforms(ast, transforms, options = {}) {
|
|
2401
|
+
options.log ??= true;
|
|
2402
|
+
const name = options.name ?? transforms.map((t15) => t15.name).join(", ");
|
|
2403
|
+
if (options.log)
|
|
2392
2404
|
logger(`${name}: started`);
|
|
2393
2405
|
const state = { changes: 0 };
|
|
2394
2406
|
for (const transform of transforms) {
|
|
@@ -2397,36 +2409,35 @@ function applyTransforms(ast, transforms, options2 = {}) {
|
|
|
2397
2409
|
const traverseOptions = transforms.flatMap((t15) => t15.visitor?.() ?? []);
|
|
2398
2410
|
if (traverseOptions.length > 0) {
|
|
2399
2411
|
const visitor = visitors.merge(traverseOptions);
|
|
2400
|
-
visitor.noScope =
|
|
2401
|
-
|
|
2412
|
+
visitor.noScope = options.noScope || transforms.every((t15) => !t15.scope);
|
|
2413
|
+
traverse4(ast, visitor, undefined, state);
|
|
2402
2414
|
}
|
|
2403
|
-
if (
|
|
2415
|
+
if (options.log)
|
|
2404
2416
|
logger(`${name}: finished with ${state.changes} changes`);
|
|
2405
2417
|
return state;
|
|
2406
2418
|
}
|
|
2407
|
-
function mergeTransforms(
|
|
2419
|
+
function mergeTransforms(options) {
|
|
2408
2420
|
return {
|
|
2409
|
-
name:
|
|
2410
|
-
tags:
|
|
2411
|
-
scope:
|
|
2421
|
+
name: options.name,
|
|
2422
|
+
tags: options.tags,
|
|
2423
|
+
scope: options.transforms.some((t15) => t15.scope),
|
|
2412
2424
|
visitor() {
|
|
2413
|
-
return visitors.merge(
|
|
2425
|
+
return visitors.merge(options.transforms.flatMap((t15) => t15.visitor?.() ?? []));
|
|
2414
2426
|
}
|
|
2415
2427
|
};
|
|
2416
2428
|
}
|
|
2417
|
-
|
|
2418
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=9_e74mpmskrhkukmakoww36dl47m/node_modules/webcrack/src/unminify/transforms/merge-strings.ts
|
|
2429
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/unminify/transforms/merge-strings.ts
|
|
2419
2430
|
var merge_strings_default = {
|
|
2420
2431
|
name: "merge-strings",
|
|
2421
2432
|
tags: ["safe"],
|
|
2422
2433
|
visitor() {
|
|
2423
2434
|
const left = capture(stringLiteral());
|
|
2424
2435
|
const right = capture(stringLiteral());
|
|
2425
|
-
const
|
|
2436
|
+
const matcher2 = binaryExpression("+", or(left, binaryExpression("+", anything(), left)), right);
|
|
2426
2437
|
return {
|
|
2427
2438
|
BinaryExpression: {
|
|
2428
2439
|
exit(path) {
|
|
2429
|
-
if (!
|
|
2440
|
+
if (!matcher2.match(path.node))
|
|
2430
2441
|
return;
|
|
2431
2442
|
left.current.value += right.current.value;
|
|
2432
2443
|
right.current.value = "";
|
|
@@ -2439,7 +2450,7 @@ var merge_strings_default = {
|
|
|
2439
2450
|
}
|
|
2440
2451
|
};
|
|
2441
2452
|
|
|
2442
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
2453
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/deobfuscate/array-rotator.ts
|
|
2443
2454
|
function findArrayRotator(stringArray) {
|
|
2444
2455
|
const arrayIdentifier = capture(identifier());
|
|
2445
2456
|
const pushShift = callExpression(constMemberExpression(arrayIdentifier, "push"), [
|
|
@@ -2450,16 +2461,16 @@ function findArrayRotator(stringArray) {
|
|
|
2450
2461
|
tryStatement(containerOf(pushShift), containerOf(pushShift))
|
|
2451
2462
|
]).match(node);
|
|
2452
2463
|
}))))));
|
|
2453
|
-
const
|
|
2464
|
+
const matcher2 = expressionStatement(or(callMatcher, unaryExpression("!", callMatcher)));
|
|
2454
2465
|
for (const ref of stringArray.references) {
|
|
2455
|
-
const rotator = findParent(ref,
|
|
2466
|
+
const rotator = findParent(ref, matcher2);
|
|
2456
2467
|
if (rotator) {
|
|
2457
2468
|
return rotator;
|
|
2458
2469
|
}
|
|
2459
2470
|
}
|
|
2460
2471
|
}
|
|
2461
2472
|
|
|
2462
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
2473
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/deobfuscate/control-flow-object.ts
|
|
2463
2474
|
import * as t15 from "@babel/types";
|
|
2464
2475
|
var control_flow_object_default = {
|
|
2465
2476
|
name: "control-flow-object",
|
|
@@ -2602,7 +2613,7 @@ var control_flow_object_default = {
|
|
|
2602
2613
|
}
|
|
2603
2614
|
};
|
|
2604
2615
|
|
|
2605
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
2616
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/deobfuscate/control-flow-switch.ts
|
|
2606
2617
|
import * as t16 from "@babel/types";
|
|
2607
2618
|
var control_flow_switch_default = {
|
|
2608
2619
|
name: "control-flow-switch",
|
|
@@ -2612,7 +2623,7 @@ var control_flow_switch_default = {
|
|
|
2612
2623
|
const sequenceString = capture(predicate((s) => /^\d+(\|\d+)*$/.test(s)));
|
|
2613
2624
|
const iterator = capture(identifier());
|
|
2614
2625
|
const cases = capture(arrayOf(switchCase(stringLiteral(predicate((s) => /^\d+$/.test(s))), anyList(zeroOrMore(), or(continueStatement(), returnStatement())))));
|
|
2615
|
-
const
|
|
2626
|
+
const matcher2 = blockStatement(anyList(variableDeclaration(undefined, [
|
|
2616
2627
|
variableDeclarator(sequenceName, callExpression(constMemberExpression(stringLiteral(sequenceString), "split"), [stringLiteral("|")]))
|
|
2617
2628
|
]), variableDeclaration(undefined, [variableDeclarator(iterator)]), infiniteLoop(blockStatement([
|
|
2618
2629
|
switchStatement(memberExpression(fromCapture(sequenceName), updateExpression("++", fromCapture(iterator)), true), cases),
|
|
@@ -2621,7 +2632,7 @@ var control_flow_switch_default = {
|
|
|
2621
2632
|
return {
|
|
2622
2633
|
BlockStatement: {
|
|
2623
2634
|
exit(path) {
|
|
2624
|
-
if (!
|
|
2635
|
+
if (!matcher2.match(path.node))
|
|
2625
2636
|
return;
|
|
2626
2637
|
const caseStatements = new Map(cases.current.map((c) => [
|
|
2627
2638
|
c.test.value,
|
|
@@ -2637,24 +2648,8 @@ var control_flow_switch_default = {
|
|
|
2637
2648
|
}
|
|
2638
2649
|
};
|
|
2639
2650
|
|
|
2640
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
2651
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/deobfuscate/dead-code.ts
|
|
2641
2652
|
import * as t17 from "@babel/types";
|
|
2642
|
-
function replace(path, replacement) {
|
|
2643
|
-
if (t17.isBlockStatement(replacement.node)) {
|
|
2644
|
-
const childBindings = replacement.scope.bindings;
|
|
2645
|
-
for (const name in childBindings) {
|
|
2646
|
-
const binding = childBindings[name];
|
|
2647
|
-
if (path.scope.hasOwnBinding(name)) {
|
|
2648
|
-
renameFast(binding, path.scope.generateUid(name));
|
|
2649
|
-
}
|
|
2650
|
-
binding.scope = path.scope;
|
|
2651
|
-
path.scope.bindings[binding.identifier.name] = binding;
|
|
2652
|
-
}
|
|
2653
|
-
path.replaceWithMultiple(replacement.node.body);
|
|
2654
|
-
} else {
|
|
2655
|
-
path.replaceWith(replacement);
|
|
2656
|
-
}
|
|
2657
|
-
}
|
|
2658
2653
|
var dead_code_default = {
|
|
2659
2654
|
name: "dead-code",
|
|
2660
2655
|
tags: ["unsafe"],
|
|
@@ -2681,29 +2676,25 @@ var dead_code_default = {
|
|
|
2681
2676
|
};
|
|
2682
2677
|
}
|
|
2683
2678
|
};
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
for (const ref of stringArray.references) {
|
|
2695
|
-
const decoderFn = findParent(ref, matcher3);
|
|
2696
|
-
if (decoderFn) {
|
|
2697
|
-
const oldName = functionName.current;
|
|
2698
|
-
const newName = `__DECODE_${decoders.length}__`;
|
|
2699
|
-
const binding = decoderFn.scope.getBinding(oldName);
|
|
2700
|
-
renameFast(binding, newName);
|
|
2701
|
-
decoders.push(new Decoder(newName, decoderFn));
|
|
2679
|
+
function replace(path, replacement) {
|
|
2680
|
+
if (t17.isBlockStatement(replacement.node)) {
|
|
2681
|
+
const childBindings = replacement.scope.bindings;
|
|
2682
|
+
for (const name in childBindings) {
|
|
2683
|
+
const binding = childBindings[name];
|
|
2684
|
+
if (path.scope.hasOwnBinding(name)) {
|
|
2685
|
+
renameFast(binding, path.scope.generateUid(name));
|
|
2686
|
+
}
|
|
2687
|
+
binding.scope = path.scope;
|
|
2688
|
+
path.scope.bindings[binding.identifier.name] = binding;
|
|
2702
2689
|
}
|
|
2690
|
+
path.replaceWithMultiple(replacement.node.body);
|
|
2691
|
+
} else {
|
|
2692
|
+
path.replaceWith(replacement);
|
|
2703
2693
|
}
|
|
2704
|
-
return decoders;
|
|
2705
2694
|
}
|
|
2706
2695
|
|
|
2696
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/deobfuscate/decoder.ts
|
|
2697
|
+
import { expression } from "@babel/template";
|
|
2707
2698
|
class Decoder {
|
|
2708
2699
|
name;
|
|
2709
2700
|
path;
|
|
@@ -2745,23 +2736,44 @@ class Decoder {
|
|
|
2745
2736
|
if (literalCall.match(ref.parent)) {
|
|
2746
2737
|
calls.push(ref.parentPath);
|
|
2747
2738
|
}
|
|
2739
|
+
} else if (ref.parentPath?.isExpressionStatement()) {
|
|
2740
|
+
ref.parentPath.remove();
|
|
2748
2741
|
}
|
|
2749
2742
|
}
|
|
2750
2743
|
return calls;
|
|
2751
2744
|
}
|
|
2752
2745
|
}
|
|
2746
|
+
function findDecoders(stringArray) {
|
|
2747
|
+
const decoders = [];
|
|
2748
|
+
const functionName = capture(anyString());
|
|
2749
|
+
const arrayIdentifier = capture(identifier());
|
|
2750
|
+
const matcher2 = functionDeclaration(identifier(functionName), anything(), blockStatement(anyList(variableDeclaration(undefined, [
|
|
2751
|
+
variableDeclarator(arrayIdentifier, callExpression(identifier(stringArray.name)))
|
|
2752
|
+
]), zeroOrMore(), containerOf(memberExpression(fromCapture(arrayIdentifier), undefined, true)), zeroOrMore())));
|
|
2753
|
+
for (const ref of stringArray.references) {
|
|
2754
|
+
const decoderFn = findParent(ref, matcher2);
|
|
2755
|
+
if (decoderFn) {
|
|
2756
|
+
const oldName = functionName.current;
|
|
2757
|
+
const newName = `__DECODE_${decoders.length}__`;
|
|
2758
|
+
const binding = decoderFn.scope.getBinding(oldName);
|
|
2759
|
+
renameFast(binding, newName);
|
|
2760
|
+
decoders.push(new Decoder(newName, decoderFn));
|
|
2761
|
+
}
|
|
2762
|
+
}
|
|
2763
|
+
return decoders;
|
|
2764
|
+
}
|
|
2753
2765
|
|
|
2754
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
2766
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/deobfuscate/inline-decoded-strings.ts
|
|
2755
2767
|
import * as t18 from "@babel/types";
|
|
2756
2768
|
var inline_decoded_strings_default = {
|
|
2757
2769
|
name: "inline-decoded-strings",
|
|
2758
2770
|
tags: ["unsafe"],
|
|
2759
2771
|
scope: true,
|
|
2760
|
-
async run(ast2, state,
|
|
2761
|
-
if (!
|
|
2772
|
+
async run(ast2, state, options) {
|
|
2773
|
+
if (!options)
|
|
2762
2774
|
return;
|
|
2763
|
-
const calls =
|
|
2764
|
-
const decodedValues = await
|
|
2775
|
+
const calls = options.vm.decoders.flatMap((decoder) => decoder.collectCalls());
|
|
2776
|
+
const decodedValues = await options.vm.decode(calls);
|
|
2765
2777
|
for (let i = 0;i < calls.length; i++) {
|
|
2766
2778
|
const call = calls[i];
|
|
2767
2779
|
const value = decodedValues[i];
|
|
@@ -2773,7 +2785,7 @@ var inline_decoded_strings_default = {
|
|
|
2773
2785
|
}
|
|
2774
2786
|
};
|
|
2775
2787
|
|
|
2776
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
2788
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/deobfuscate/inline-decoder-wrappers.ts
|
|
2777
2789
|
var inline_decoder_wrappers_default = {
|
|
2778
2790
|
name: "inline-decoder-wrappers",
|
|
2779
2791
|
tags: ["unsafe"],
|
|
@@ -2790,7 +2802,7 @@ var inline_decoder_wrappers_default = {
|
|
|
2790
2802
|
}
|
|
2791
2803
|
};
|
|
2792
2804
|
|
|
2793
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
2805
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/deobfuscate/inline-object-props.ts
|
|
2794
2806
|
var inline_object_props_default = {
|
|
2795
2807
|
name: "inline-object-props",
|
|
2796
2808
|
tags: ["safe"],
|
|
@@ -2828,8 +2840,8 @@ var inline_object_props_default = {
|
|
|
2828
2840
|
}
|
|
2829
2841
|
};
|
|
2830
2842
|
|
|
2831
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
2832
|
-
import
|
|
2843
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/deobfuscate/string-array.ts
|
|
2844
|
+
import traverse5 from "@babel/traverse";
|
|
2833
2845
|
function findStringArray(ast2) {
|
|
2834
2846
|
let result;
|
|
2835
2847
|
const functionName = capture(anyString());
|
|
@@ -2839,7 +2851,7 @@ function findStringArray(ast2) {
|
|
|
2839
2851
|
const variableDeclaration2 = variableDeclaration(undefined, [
|
|
2840
2852
|
variableDeclarator(arrayIdentifier, arrayExpression2)
|
|
2841
2853
|
]);
|
|
2842
|
-
const
|
|
2854
|
+
const matcher2 = functionDeclaration(identifier(functionName), [], or(blockStatement([
|
|
2843
2855
|
variableDeclaration2,
|
|
2844
2856
|
returnStatement(callExpression(functionAssignment))
|
|
2845
2857
|
]), blockStatement([
|
|
@@ -2847,9 +2859,9 @@ function findStringArray(ast2) {
|
|
|
2847
2859
|
expressionStatement(functionAssignment),
|
|
2848
2860
|
returnStatement(callExpression(identifier(functionName)))
|
|
2849
2861
|
])));
|
|
2850
|
-
|
|
2862
|
+
traverse5(ast2, {
|
|
2851
2863
|
FunctionDeclaration(path) {
|
|
2852
|
-
if (
|
|
2864
|
+
if (matcher2.match(path.node)) {
|
|
2853
2865
|
const length = arrayExpression2.current.elements.length;
|
|
2854
2866
|
const name = functionName.current;
|
|
2855
2867
|
const binding = path.scope.getBinding(name);
|
|
@@ -2869,7 +2881,7 @@ function findStringArray(ast2) {
|
|
|
2869
2881
|
const length = arrayExpression2.current.elements.length;
|
|
2870
2882
|
const binding = path.scope.getBinding(arrayIdentifier.current.name);
|
|
2871
2883
|
const memberAccess = memberExpression(fromCapture(arrayIdentifier), numericLiteral(predicate((value) => value < length)));
|
|
2872
|
-
if (!isReadonlyObject(binding, memberAccess))
|
|
2884
|
+
if (!binding.referenced || !isReadonlyObject(binding, memberAccess))
|
|
2873
2885
|
return;
|
|
2874
2886
|
inlineArrayElements(arrayExpression2.current, binding.referencePaths);
|
|
2875
2887
|
path.remove();
|
|
@@ -2878,7 +2890,7 @@ function findStringArray(ast2) {
|
|
|
2878
2890
|
return result;
|
|
2879
2891
|
}
|
|
2880
2892
|
|
|
2881
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
2893
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/deobfuscate/vm.ts
|
|
2882
2894
|
import debug2 from "debug";
|
|
2883
2895
|
class VMDecoder {
|
|
2884
2896
|
decoders;
|
|
@@ -2932,15 +2944,15 @@ var deobfuscate_default = {
|
|
|
2932
2944
|
const decoders = findDecoders(stringArray);
|
|
2933
2945
|
logger2(`String Array Encodings: ${decoders.length}`);
|
|
2934
2946
|
state.changes += applyTransform(ast2, inline_object_props_default).changes;
|
|
2935
|
-
for (const
|
|
2936
|
-
state.changes += applyTransform(ast2, inline_decoder_wrappers_default,
|
|
2947
|
+
for (const decoder of decoders) {
|
|
2948
|
+
state.changes += applyTransform(ast2, inline_decoder_wrappers_default, decoder.path).changes;
|
|
2937
2949
|
}
|
|
2938
|
-
const
|
|
2939
|
-
state.changes += (await applyTransformAsync(ast2, inline_decoded_strings_default, { vm
|
|
2950
|
+
const vm = new VMDecoder(sandbox, stringArray, decoders, rotator);
|
|
2951
|
+
state.changes += (await applyTransformAsync(ast2, inline_decoded_strings_default, { vm })).changes;
|
|
2940
2952
|
if (decoders.length > 0) {
|
|
2941
2953
|
stringArray.path.remove();
|
|
2942
2954
|
rotator?.remove();
|
|
2943
|
-
decoders.forEach((
|
|
2955
|
+
decoders.forEach((decoder) => decoder.path.remove());
|
|
2944
2956
|
state.changes += 2 + decoders.length;
|
|
2945
2957
|
}
|
|
2946
2958
|
state.changes += applyTransforms(ast2, [merge_strings_default, dead_code_default, control_flow_object_default, control_flow_switch_default], { noScope: true }).changes;
|
|
@@ -2955,13 +2967,13 @@ var var_functions_default = {
|
|
|
2955
2967
|
visitor() {
|
|
2956
2968
|
const name = capture(identifier());
|
|
2957
2969
|
const fn = capture(functionExpression(null));
|
|
2958
|
-
const
|
|
2970
|
+
const matcher2 = variableDeclaration("var", [
|
|
2959
2971
|
variableDeclarator(name, fn)
|
|
2960
2972
|
]);
|
|
2961
2973
|
return {
|
|
2962
2974
|
VariableDeclaration: {
|
|
2963
2975
|
exit(path) {
|
|
2964
|
-
if (
|
|
2976
|
+
if (matcher2.match(path.node) && path.key !== "init") {
|
|
2965
2977
|
path.replaceWith(t19.functionDeclaration(name.current, fn.current.params, fn.current.body, fn.current.generator, fn.current.async));
|
|
2966
2978
|
}
|
|
2967
2979
|
}
|
|
@@ -2972,9 +2984,6 @@ var var_functions_default = {
|
|
|
2972
2984
|
|
|
2973
2985
|
// /home/mochaa/ghq/git.sr.ht/~self/delance-builder/node_modules/webcrack/src/deobfuscate/merge-object-assignments.ts
|
|
2974
2986
|
import * as t20 from "@babel/types";
|
|
2975
|
-
function hasCircularReference(node, binding) {
|
|
2976
|
-
return binding.referencePaths.some((path) => path.find((p) => p.node === node)) || containerOf(callExpression()).match(node);
|
|
2977
|
-
}
|
|
2978
2987
|
var merge_object_assignments_default = {
|
|
2979
2988
|
name: "merge-object-assignments",
|
|
2980
2989
|
tags: ["safe"],
|
|
@@ -3020,23 +3029,12 @@ var merge_object_assignments_default = {
|
|
|
3020
3029
|
};
|
|
3021
3030
|
}
|
|
3022
3031
|
};
|
|
3032
|
+
function hasCircularReference(node, binding) {
|
|
3033
|
+
return binding.referencePaths.some((path) => path.find((p) => p.node === node)) || containerOf(callExpression()).match(node);
|
|
3034
|
+
}
|
|
3023
3035
|
var inlineableObject = predicate((node) => or(safeLiteral, arrayExpression(arrayOf(inlineableObject)), objectExpression(arrayOf(constObjectProperty(inlineableObject)))).match(node));
|
|
3024
3036
|
|
|
3025
3037
|
// /home/mochaa/ghq/git.sr.ht/~self/delance-builder/node_modules/webcrack/src/deobfuscate/self-defending.ts
|
|
3026
|
-
function removeSelfDefendingRefs(path) {
|
|
3027
|
-
const varName = capture(anyString());
|
|
3028
|
-
const varMatcher = variableDeclarator(identifier(varName), callExpression(identifier(path.node.name)));
|
|
3029
|
-
const callMatcher = expressionStatement(callExpression(identifier(fromCapture(varName)), []));
|
|
3030
|
-
const varDecl = findParent(path, varMatcher);
|
|
3031
|
-
if (varDecl) {
|
|
3032
|
-
const binding = varDecl.scope.getBinding(varName.current);
|
|
3033
|
-
binding?.referencePaths.forEach((ref) => {
|
|
3034
|
-
if (callMatcher.match(ref.parentPath?.parent))
|
|
3035
|
-
ref.parentPath?.parentPath?.remove();
|
|
3036
|
-
});
|
|
3037
|
-
varDecl.remove();
|
|
3038
|
-
}
|
|
3039
|
-
}
|
|
3040
3038
|
var self_defending_default = {
|
|
3041
3039
|
name: "self-defending",
|
|
3042
3040
|
tags: ["safe"],
|
|
@@ -3048,7 +3046,7 @@ var self_defending_default = {
|
|
|
3048
3046
|
const context = capture(identifier());
|
|
3049
3047
|
const res = capture(identifier());
|
|
3050
3048
|
const fn = capture(identifier());
|
|
3051
|
-
const
|
|
3049
|
+
const matcher2 = variableDeclarator(identifier(callController), matchIife([
|
|
3052
3050
|
variableDeclaration(undefined, [
|
|
3053
3051
|
variableDeclarator(firstCall, trueMatcher)
|
|
3054
3052
|
]),
|
|
@@ -3073,7 +3071,7 @@ var self_defending_default = {
|
|
|
3073
3071
|
]));
|
|
3074
3072
|
return {
|
|
3075
3073
|
VariableDeclarator(path) {
|
|
3076
|
-
if (!
|
|
3074
|
+
if (!matcher2.match(path.node))
|
|
3077
3075
|
return;
|
|
3078
3076
|
const binding = path.scope.getBinding(callController.current);
|
|
3079
3077
|
if (!binding)
|
|
@@ -3093,6 +3091,20 @@ var self_defending_default = {
|
|
|
3093
3091
|
};
|
|
3094
3092
|
}
|
|
3095
3093
|
};
|
|
3094
|
+
function removeSelfDefendingRefs(path) {
|
|
3095
|
+
const varName = capture(anyString());
|
|
3096
|
+
const varMatcher = variableDeclarator(identifier(varName), callExpression(identifier(path.node.name)));
|
|
3097
|
+
const callMatcher = expressionStatement(callExpression(identifier(fromCapture(varName)), []));
|
|
3098
|
+
const varDecl = findParent(path, varMatcher);
|
|
3099
|
+
if (varDecl) {
|
|
3100
|
+
const binding = varDecl.scope.getBinding(varName.current);
|
|
3101
|
+
binding?.referencePaths.forEach((ref) => {
|
|
3102
|
+
if (callMatcher.match(ref.parentPath?.parent))
|
|
3103
|
+
ref.parentPath?.parentPath?.remove();
|
|
3104
|
+
});
|
|
3105
|
+
varDecl.remove();
|
|
3106
|
+
}
|
|
3107
|
+
}
|
|
3096
3108
|
|
|
3097
3109
|
// /home/mochaa/ghq/git.sr.ht/~self/delance-builder/node_modules/webcrack/src/unminify/transforms/index.ts
|
|
3098
3110
|
var exports_transforms = {};
|
|
@@ -3120,7 +3132,7 @@ __export(exports_transforms, {
|
|
|
3120
3132
|
blockStatements: () => block_statements_default
|
|
3121
3133
|
});
|
|
3122
3134
|
|
|
3123
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
3135
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/unminify/transforms/block-statements.ts
|
|
3124
3136
|
import * as t21 from "@babel/types";
|
|
3125
3137
|
var block_statements_default = {
|
|
3126
3138
|
name: "block-statements",
|
|
@@ -3158,8 +3170,8 @@ var block_statements_default = {
|
|
|
3158
3170
|
}
|
|
3159
3171
|
})
|
|
3160
3172
|
};
|
|
3161
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
3162
|
-
import {isIdentifierName} from "@babel/helper-validator-identifier";
|
|
3173
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/unminify/transforms/computed-properties.ts
|
|
3174
|
+
import { isIdentifierName } from "@babel/helper-validator-identifier";
|
|
3163
3175
|
import * as t22 from "@babel/types";
|
|
3164
3176
|
var computed_properties_default = {
|
|
3165
3177
|
name: "computed-properties",
|
|
@@ -3192,7 +3204,7 @@ var computed_properties_default = {
|
|
|
3192
3204
|
};
|
|
3193
3205
|
}
|
|
3194
3206
|
};
|
|
3195
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
3207
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/unminify/transforms/for-to-while.ts
|
|
3196
3208
|
import * as t23 from "@babel/types";
|
|
3197
3209
|
var for_to_while_default = {
|
|
3198
3210
|
name: "for-to-while",
|
|
@@ -3211,7 +3223,7 @@ var for_to_while_default = {
|
|
|
3211
3223
|
};
|
|
3212
3224
|
}
|
|
3213
3225
|
};
|
|
3214
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
3226
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/unminify/transforms/infinity.ts
|
|
3215
3227
|
import * as t24 from "@babel/types";
|
|
3216
3228
|
var infinity_default = {
|
|
3217
3229
|
name: "infinity",
|
|
@@ -3237,7 +3249,7 @@ var infinity_default = {
|
|
|
3237
3249
|
};
|
|
3238
3250
|
}
|
|
3239
3251
|
};
|
|
3240
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
3252
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/unminify/transforms/invert-boolean-logic.ts
|
|
3241
3253
|
import * as t25 from "@babel/types";
|
|
3242
3254
|
var INVERTED_BINARY_OPERATORS = {
|
|
3243
3255
|
"==": "!=",
|
|
@@ -3283,21 +3295,21 @@ var invert_boolean_logic_default = {
|
|
|
3283
3295
|
};
|
|
3284
3296
|
}
|
|
3285
3297
|
};
|
|
3286
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
3287
|
-
import {parseExpression} from "@babel/parser";
|
|
3298
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/unminify/transforms/json-parse.ts
|
|
3299
|
+
import { parseExpression } from "@babel/parser";
|
|
3288
3300
|
var json_parse_default = {
|
|
3289
3301
|
name: "json-parse",
|
|
3290
3302
|
tags: ["safe"],
|
|
3291
3303
|
scope: true,
|
|
3292
3304
|
visitor: () => {
|
|
3293
3305
|
const string = capture(anyString());
|
|
3294
|
-
const
|
|
3306
|
+
const matcher2 = callExpression(constMemberExpression("JSON", "parse"), [
|
|
3295
3307
|
stringLiteral(string)
|
|
3296
3308
|
]);
|
|
3297
3309
|
return {
|
|
3298
3310
|
CallExpression: {
|
|
3299
3311
|
exit(path) {
|
|
3300
|
-
if (
|
|
3312
|
+
if (matcher2.match(path.node) && !path.scope.hasBinding("JSON", { noGlobals: true })) {
|
|
3301
3313
|
try {
|
|
3302
3314
|
JSON.parse(string.current);
|
|
3303
3315
|
const parsed = parseExpression(string.current);
|
|
@@ -3311,8 +3323,8 @@ var json_parse_default = {
|
|
|
3311
3323
|
};
|
|
3312
3324
|
}
|
|
3313
3325
|
};
|
|
3314
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
3315
|
-
import {statement} from "@babel/template";
|
|
3326
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/unminify/transforms/logical-to-if.ts
|
|
3327
|
+
import { statement } from "@babel/template";
|
|
3316
3328
|
import * as t26 from "@babel/types";
|
|
3317
3329
|
var logical_to_if_default = {
|
|
3318
3330
|
name: "logical-to-if",
|
|
@@ -3344,17 +3356,17 @@ var logical_to_if_default = {
|
|
|
3344
3356
|
};
|
|
3345
3357
|
}
|
|
3346
3358
|
};
|
|
3347
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
3359
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/unminify/transforms/merge-else-if.ts
|
|
3348
3360
|
var merge_else_if_default = {
|
|
3349
3361
|
name: "merge-else-if",
|
|
3350
3362
|
tags: ["safe"],
|
|
3351
3363
|
visitor() {
|
|
3352
3364
|
const nestedIf = capture(ifStatement());
|
|
3353
|
-
const
|
|
3365
|
+
const matcher2 = ifStatement(anything(), anything(), blockStatement([nestedIf]));
|
|
3354
3366
|
return {
|
|
3355
3367
|
IfStatement: {
|
|
3356
3368
|
exit(path) {
|
|
3357
|
-
if (
|
|
3369
|
+
if (matcher2.match(path.node)) {
|
|
3358
3370
|
path.node.alternate = nestedIf.current;
|
|
3359
3371
|
this.changes++;
|
|
3360
3372
|
}
|
|
@@ -3363,7 +3375,7 @@ var merge_else_if_default = {
|
|
|
3363
3375
|
};
|
|
3364
3376
|
}
|
|
3365
3377
|
};
|
|
3366
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
3378
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/unminify/transforms/number-expressions.ts
|
|
3367
3379
|
import * as t27 from "@babel/types";
|
|
3368
3380
|
var number_expressions_default = {
|
|
3369
3381
|
name: "number-expressions",
|
|
@@ -3371,7 +3383,7 @@ var number_expressions_default = {
|
|
|
3371
3383
|
visitor: () => ({
|
|
3372
3384
|
"BinaryExpression|UnaryExpression": {
|
|
3373
3385
|
exit(path) {
|
|
3374
|
-
if (!
|
|
3386
|
+
if (!matcher2.match(path.node))
|
|
3375
3387
|
return;
|
|
3376
3388
|
const evaluated = path.evaluate();
|
|
3377
3389
|
if (t27.isBinaryExpression(path.node, { operator: "/" }) && !Number.isInteger(evaluated.value)) {
|
|
@@ -3384,8 +3396,8 @@ var number_expressions_default = {
|
|
|
3384
3396
|
}
|
|
3385
3397
|
})
|
|
3386
3398
|
};
|
|
3387
|
-
var
|
|
3388
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
3399
|
+
var matcher2 = or(unaryExpression("-", or(stringLiteral(), numericLiteral())), binaryExpression(or("+", "-", "/", "%", "*", "**", "&", "|", ">>", ">>>", "<<", "^"), or(stringLiteral(), numericLiteral(), unaryExpression("-", numericLiteral())), or(stringLiteral(), numericLiteral(), unaryExpression("-", numericLiteral()))));
|
|
3400
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/unminify/transforms/raw-literals.ts
|
|
3389
3401
|
var raw_literals_default = {
|
|
3390
3402
|
name: "raw-literals",
|
|
3391
3403
|
tags: ["safe"],
|
|
@@ -3404,7 +3416,7 @@ var raw_literals_default = {
|
|
|
3404
3416
|
}
|
|
3405
3417
|
})
|
|
3406
3418
|
};
|
|
3407
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
3419
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/unminify/transforms/remove-double-not.ts
|
|
3408
3420
|
import * as t28 from "@babel/types";
|
|
3409
3421
|
var remove_double_not_default = {
|
|
3410
3422
|
name: "remove-double-not",
|
|
@@ -3442,7 +3454,7 @@ var remove_double_not_default = {
|
|
|
3442
3454
|
};
|
|
3443
3455
|
}
|
|
3444
3456
|
};
|
|
3445
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
3457
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/unminify/transforms/sequence.ts
|
|
3446
3458
|
import * as t29 from "@babel/types";
|
|
3447
3459
|
var sequence_default = {
|
|
3448
3460
|
name: "sequence",
|
|
@@ -3558,10 +3570,10 @@ var sequence_default = {
|
|
|
3558
3570
|
VariableDeclaration: {
|
|
3559
3571
|
exit(path) {
|
|
3560
3572
|
const sequence = capture(sequenceExpression());
|
|
3561
|
-
const
|
|
3573
|
+
const matcher3 = variableDeclaration(undefined, [
|
|
3562
3574
|
variableDeclarator(undefined, sequence)
|
|
3563
3575
|
]);
|
|
3564
|
-
if (!
|
|
3576
|
+
if (!matcher3.match(path.node))
|
|
3565
3577
|
return;
|
|
3566
3578
|
const { expressions } = sequence.current;
|
|
3567
3579
|
path.node.declarations[0].init = expressions.pop();
|
|
@@ -3582,9 +3594,9 @@ var sequence_default = {
|
|
|
3582
3594
|
};
|
|
3583
3595
|
}
|
|
3584
3596
|
};
|
|
3585
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
3597
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/unminify/transforms/split-for-loop-vars.ts
|
|
3586
3598
|
import * as t30 from "@babel/types";
|
|
3587
|
-
var
|
|
3599
|
+
var matcher3 = forStatement(variableDeclaration("var", arrayOf(variableDeclarator(identifier()))));
|
|
3588
3600
|
var split_for_loop_vars_default = {
|
|
3589
3601
|
name: "split-for-loop-vars",
|
|
3590
3602
|
tags: ["safe"],
|
|
@@ -3592,7 +3604,7 @@ var split_for_loop_vars_default = {
|
|
|
3592
3604
|
visitor: () => ({
|
|
3593
3605
|
ForStatement: {
|
|
3594
3606
|
exit(path) {
|
|
3595
|
-
if (!
|
|
3607
|
+
if (!matcher3.match(path.node))
|
|
3596
3608
|
return;
|
|
3597
3609
|
const { init, test, update } = path.node;
|
|
3598
3610
|
const { declarations } = init;
|
|
@@ -3615,7 +3627,7 @@ var split_for_loop_vars_default = {
|
|
|
3615
3627
|
}
|
|
3616
3628
|
})
|
|
3617
3629
|
};
|
|
3618
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
3630
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/unminify/transforms/split-variable-declarations.ts
|
|
3619
3631
|
import * as t31 from "@babel/types";
|
|
3620
3632
|
var split_variable_declarations_default = {
|
|
3621
3633
|
name: "split-variable-declarations",
|
|
@@ -3643,8 +3655,8 @@ var split_variable_declarations_default = {
|
|
|
3643
3655
|
}
|
|
3644
3656
|
})
|
|
3645
3657
|
};
|
|
3646
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
3647
|
-
import {statement as statement2} from "@babel/template";
|
|
3658
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/unminify/transforms/ternary-to-if.ts
|
|
3659
|
+
import { statement as statement2 } from "@babel/template";
|
|
3648
3660
|
var ternary_to_if_default = {
|
|
3649
3661
|
name: "ternary-to-if",
|
|
3650
3662
|
tags: ["safe"],
|
|
@@ -3683,7 +3695,7 @@ var ternary_to_if_default = {
|
|
|
3683
3695
|
};
|
|
3684
3696
|
}
|
|
3685
3697
|
};
|
|
3686
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
3698
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/unminify/transforms/typeof-undefined.ts
|
|
3687
3699
|
import * as t32 from "@babel/types";
|
|
3688
3700
|
var OPERATOR_MAP = {
|
|
3689
3701
|
">": "===",
|
|
@@ -3695,11 +3707,11 @@ var typeof_undefined_default = {
|
|
|
3695
3707
|
visitor() {
|
|
3696
3708
|
const operator = capture(or(">", "<"));
|
|
3697
3709
|
const argument = capture(anyExpression());
|
|
3698
|
-
const
|
|
3710
|
+
const matcher4 = binaryExpression(operator, unaryExpression("typeof", argument), stringLiteral("u"));
|
|
3699
3711
|
return {
|
|
3700
3712
|
BinaryExpression: {
|
|
3701
3713
|
exit(path) {
|
|
3702
|
-
if (!
|
|
3714
|
+
if (!matcher4.match(path.node))
|
|
3703
3715
|
return;
|
|
3704
3716
|
path.replaceWith(t32.binaryExpression(OPERATOR_MAP[operator.current], t32.unaryExpression("typeof", argument.current), t32.stringLiteral("undefined")));
|
|
3705
3717
|
this.changes++;
|
|
@@ -3708,19 +3720,19 @@ var typeof_undefined_default = {
|
|
|
3708
3720
|
};
|
|
3709
3721
|
}
|
|
3710
3722
|
};
|
|
3711
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
3723
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/unminify/transforms/unary-expressions.ts
|
|
3712
3724
|
import * as t33 from "@babel/types";
|
|
3713
3725
|
var unary_expressions_default = {
|
|
3714
3726
|
name: "unary-expressions",
|
|
3715
3727
|
tags: ["safe"],
|
|
3716
3728
|
visitor() {
|
|
3717
3729
|
const argument = capture(anyExpression());
|
|
3718
|
-
const
|
|
3730
|
+
const matcher4 = expressionStatement(unaryExpression(or("void", "!", "typeof"), argument));
|
|
3719
3731
|
const returnVoid = returnStatement(unaryExpression("void", argument));
|
|
3720
3732
|
return {
|
|
3721
3733
|
ExpressionStatement: {
|
|
3722
3734
|
exit(path) {
|
|
3723
|
-
if (!
|
|
3735
|
+
if (!matcher4.match(path.node))
|
|
3724
3736
|
return;
|
|
3725
3737
|
path.replaceWith(argument.current);
|
|
3726
3738
|
this.changes++;
|
|
@@ -3738,7 +3750,7 @@ var unary_expressions_default = {
|
|
|
3738
3750
|
};
|
|
3739
3751
|
}
|
|
3740
3752
|
};
|
|
3741
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
3753
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/unminify/transforms/unminify-booleans.ts
|
|
3742
3754
|
import * as t34 from "@babel/types";
|
|
3743
3755
|
var unminify_booleans_default = {
|
|
3744
3756
|
name: "unminify-booleans",
|
|
@@ -3757,18 +3769,18 @@ var unminify_booleans_default = {
|
|
|
3757
3769
|
};
|
|
3758
3770
|
var trueMatcher2 = or(unaryExpression("!", numericLiteral(0)), unaryExpression("!", unaryExpression("!", numericLiteral(1))), unaryExpression("!", unaryExpression("!", arrayExpression([]))));
|
|
3759
3771
|
var falseMatcher2 = or(unaryExpression("!", numericLiteral(1)), unaryExpression("!", arrayExpression([])));
|
|
3760
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
3772
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/unminify/transforms/void-to-undefined.ts
|
|
3761
3773
|
import * as t35 from "@babel/types";
|
|
3762
3774
|
var void_to_undefined_default = {
|
|
3763
3775
|
name: "void-to-undefined",
|
|
3764
3776
|
tags: ["safe"],
|
|
3765
3777
|
scope: true,
|
|
3766
3778
|
visitor: () => {
|
|
3767
|
-
const
|
|
3779
|
+
const matcher4 = unaryExpression("void", numericLiteral(0));
|
|
3768
3780
|
return {
|
|
3769
3781
|
UnaryExpression: {
|
|
3770
3782
|
exit(path) {
|
|
3771
|
-
if (
|
|
3783
|
+
if (matcher4.match(path.node) && !path.scope.hasBinding("undefined", { noGlobals: true })) {
|
|
3772
3784
|
path.replaceWith(t35.identifier("undefined"));
|
|
3773
3785
|
this.changes++;
|
|
3774
3786
|
}
|
|
@@ -3777,7 +3789,7 @@ var void_to_undefined_default = {
|
|
|
3777
3789
|
};
|
|
3778
3790
|
}
|
|
3779
3791
|
};
|
|
3780
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
3792
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/unminify/transforms/yoda.ts
|
|
3781
3793
|
import * as t36 from "@babel/types";
|
|
3782
3794
|
var FLIPPED_OPERATORS = {
|
|
3783
3795
|
"==": "==",
|
|
@@ -3797,11 +3809,12 @@ var yoda_default = {
|
|
|
3797
3809
|
name: "yoda",
|
|
3798
3810
|
tags: ["safe"],
|
|
3799
3811
|
visitor: () => {
|
|
3800
|
-
const
|
|
3812
|
+
const pureValue = or(stringLiteral(), numericLiteral(), unaryExpression("-", or(numericLiteral(), identifier("Infinity"))), booleanLiteral(), nullLiteral(), identifier("undefined"), identifier("NaN"), identifier("Infinity"));
|
|
3813
|
+
const matcher4 = binaryExpression(or(...Object.values(FLIPPED_OPERATORS)), pureValue, predicate((node) => !pureValue.match(node)));
|
|
3801
3814
|
return {
|
|
3802
3815
|
BinaryExpression: {
|
|
3803
3816
|
exit(path) {
|
|
3804
|
-
if (
|
|
3817
|
+
if (matcher4.match(path.node)) {
|
|
3805
3818
|
path.replaceWith(t36.binaryExpression(FLIPPED_OPERATORS[path.node.operator], path.node.right, path.node.left));
|
|
3806
3819
|
this.changes++;
|
|
3807
3820
|
}
|
|
@@ -3837,13 +3850,13 @@ async function transform2(ast2) {
|
|
|
3837
3850
|
import * as t37 from "@babel/types";
|
|
3838
3851
|
|
|
3839
3852
|
// utils/matchers/chunk.ts
|
|
3840
|
-
function chunk(id) {
|
|
3841
|
-
return objectProperty(numericLiteral(id), or(functionExpr([]), functionExpr([mod]), functionExpr([mod, exp]), functionExpr([mod, exp, req])));
|
|
3842
|
-
}
|
|
3843
3853
|
var mod = capture(identifier());
|
|
3844
3854
|
var exp = capture(identifier());
|
|
3845
3855
|
var req = capture(identifier());
|
|
3846
3856
|
var functionExpr = (args) => or(functionExpression(null, args, blockStatement(), false, false), arrowFunctionExpression(args, blockStatement(), false));
|
|
3857
|
+
function chunk(id) {
|
|
3858
|
+
return objectProperty(numericLiteral(id), or(functionExpr([]), functionExpr([mod]), functionExpr([mod, exp]), functionExpr([mod, exp, req])));
|
|
3859
|
+
}
|
|
3847
3860
|
var chunks = objectExpression(anyList(oneOrMore(chunk())));
|
|
3848
3861
|
var chunk_default = chunk();
|
|
3849
3862
|
|
|
@@ -4042,73 +4055,83 @@ var module_helper_default = {
|
|
|
4042
4055
|
name: "module-helper",
|
|
4043
4056
|
tags: ["safe"],
|
|
4044
4057
|
scope: true,
|
|
4045
|
-
visitor
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
const
|
|
4055
|
-
$
|
|
4056
|
-
const $
|
|
4057
|
-
|
|
4058
|
-
$
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
}
|
|
4072
|
-
default: {
|
|
4073
|
-
throw new Error("Unexpected param");
|
|
4074
|
-
}
|
|
4075
|
-
}
|
|
4076
|
-
});
|
|
4077
|
-
$function.traverse({
|
|
4078
|
-
VariableDeclaration: {
|
|
4079
|
-
exit(p2) {
|
|
4080
|
-
const $decl = p2.get("declarations.0");
|
|
4081
|
-
$decl.assertVariableDeclarator();
|
|
4082
|
-
const $id = $decl.get("id");
|
|
4083
|
-
if (!$id.isIdentifier()) {
|
|
4084
|
-
return;
|
|
4058
|
+
visitor() {
|
|
4059
|
+
let level = 0;
|
|
4060
|
+
return {
|
|
4061
|
+
ObjectExpression: {
|
|
4062
|
+
enter($) {
|
|
4063
|
+
if (!chunks.match($.node)) {
|
|
4064
|
+
return;
|
|
4065
|
+
}
|
|
4066
|
+
level++;
|
|
4067
|
+
const unders = "_".repeat(level - 1);
|
|
4068
|
+
const $chunks = $.get("properties");
|
|
4069
|
+
for (const $chunk of $chunks) {
|
|
4070
|
+
$chunk.assertObjectProperty();
|
|
4071
|
+
const $function = $chunk.get("value");
|
|
4072
|
+
$function.assertFunction();
|
|
4073
|
+
const $p = $function.get("params");
|
|
4074
|
+
$p.forEach(($parameter, i) => {
|
|
4075
|
+
$parameter.assertIdentifier();
|
|
4076
|
+
switch (i) {
|
|
4077
|
+
case 0: {
|
|
4078
|
+
$function.scope.rename($parameter.node.name, unders + "module");
|
|
4079
|
+
break;
|
|
4080
|
+
}
|
|
4081
|
+
case 1: {
|
|
4082
|
+
$function.scope.rename($parameter.node.name, unders + "exports");
|
|
4083
|
+
break;
|
|
4085
4084
|
}
|
|
4086
|
-
|
|
4087
|
-
$
|
|
4088
|
-
|
|
4089
|
-
}
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
} else if (importDefault_default.match(t37.cloneNode(p2.node))) {
|
|
4093
|
-
$id.scope.rename($id.node.name, "__importDefault");
|
|
4094
|
-
$decl.get("init").replaceWith(__importDefault);
|
|
4095
|
-
} else if (createBinding_default.match(t37.cloneNode(p2.node))) {
|
|
4096
|
-
$id.scope.rename($id.node.name, "__createBinding");
|
|
4097
|
-
$decl.get("init").replaceWith(__createBinding);
|
|
4098
|
-
} else if (exportStar_default.match(t37.cloneNode(p2.node))) {
|
|
4099
|
-
$id.scope.rename($id.node.name, "__exportStar");
|
|
4100
|
-
$decl.get("init").replaceWith(__exportStar);
|
|
4101
|
-
} else {
|
|
4102
|
-
return;
|
|
4085
|
+
case 2: {
|
|
4086
|
+
$function.scope.rename($parameter.node.name, unders + "require");
|
|
4087
|
+
break;
|
|
4088
|
+
}
|
|
4089
|
+
default: {
|
|
4090
|
+
throw new Error("Unexpected param");
|
|
4103
4091
|
}
|
|
4104
|
-
this.changes++;
|
|
4105
4092
|
}
|
|
4106
|
-
}
|
|
4107
|
-
|
|
4093
|
+
});
|
|
4094
|
+
$function.traverse({
|
|
4095
|
+
VariableDeclaration: {
|
|
4096
|
+
exit(p2) {
|
|
4097
|
+
const $decl = p2.get("declarations.0");
|
|
4098
|
+
$decl.assertVariableDeclarator();
|
|
4099
|
+
const $id = $decl.get("id");
|
|
4100
|
+
if (!$id.isIdentifier()) {
|
|
4101
|
+
return;
|
|
4102
|
+
}
|
|
4103
|
+
if (importStar_default.match(t37.cloneNode(p2.node))) {
|
|
4104
|
+
$id.scope.rename($id.node.name, "__importStar");
|
|
4105
|
+
$decl.get("init").replaceWith(__importStar);
|
|
4106
|
+
} else if (setModuleDefault_default.match(t37.cloneNode(p2.node))) {
|
|
4107
|
+
$id.scope.rename($id.node.name, "__setModuleDefault");
|
|
4108
|
+
$decl.get("init").replaceWith(__setModuleDefault);
|
|
4109
|
+
} else if (importDefault_default.match(t37.cloneNode(p2.node))) {
|
|
4110
|
+
$id.scope.rename($id.node.name, "__importDefault");
|
|
4111
|
+
$decl.get("init").replaceWith(__importDefault);
|
|
4112
|
+
} else if (createBinding_default.match(t37.cloneNode(p2.node))) {
|
|
4113
|
+
$id.scope.rename($id.node.name, "__createBinding");
|
|
4114
|
+
$decl.get("init").replaceWith(__createBinding);
|
|
4115
|
+
} else if (exportStar_default.match(t37.cloneNode(p2.node))) {
|
|
4116
|
+
$id.scope.rename($id.node.name, "__exportStar");
|
|
4117
|
+
$decl.get("init").replaceWith(__exportStar);
|
|
4118
|
+
} else {
|
|
4119
|
+
return;
|
|
4120
|
+
}
|
|
4121
|
+
this.changes++;
|
|
4122
|
+
}
|
|
4123
|
+
}
|
|
4124
|
+
}, this);
|
|
4125
|
+
}
|
|
4126
|
+
},
|
|
4127
|
+
exit($) {
|
|
4128
|
+
if (chunks.match($.node)) {
|
|
4129
|
+
level--;
|
|
4130
|
+
}
|
|
4108
4131
|
}
|
|
4109
4132
|
}
|
|
4110
|
-
}
|
|
4111
|
-
}
|
|
4133
|
+
};
|
|
4134
|
+
}
|
|
4112
4135
|
};
|
|
4113
4136
|
|
|
4114
4137
|
// transform/esmodule/indirect-call.ts
|
|
@@ -4138,10 +4161,11 @@ var indirect_call_default = {
|
|
|
4138
4161
|
};
|
|
4139
4162
|
|
|
4140
4163
|
// utils/ast.ts
|
|
4141
|
-
import {parse as babelParse2} from "@babel/parser";
|
|
4164
|
+
import { parse as babelParse2 } from "@babel/parser";
|
|
4142
4165
|
import babelGenerate2 from "@babel/generator";
|
|
4143
4166
|
import debug4 from "debug";
|
|
4144
|
-
import
|
|
4167
|
+
import traverse6, { visitors as visitors2 } from "@babel/traverse";
|
|
4168
|
+
var logger2 = debug4("delance:transforms");
|
|
4145
4169
|
function parse2(code) {
|
|
4146
4170
|
return babelParse2(code, {
|
|
4147
4171
|
sourceType: "script",
|
|
@@ -4151,19 +4175,18 @@ function parse2(code) {
|
|
|
4151
4175
|
function generate2(ast2) {
|
|
4152
4176
|
return babelGenerate2(ast2, { jsescOption: { minimal: true, quotes: "single" } }).code;
|
|
4153
4177
|
}
|
|
4154
|
-
function applyTransform2(ast2, transform3,
|
|
4178
|
+
function applyTransform2(ast2, transform3, options, noScopeOverride) {
|
|
4155
4179
|
logger2(`${transform3.name}: started`);
|
|
4156
4180
|
const state = { changes: 0 };
|
|
4157
|
-
transform3.run?.(ast2, state,
|
|
4181
|
+
transform3.run?.(ast2, state, options);
|
|
4158
4182
|
if (transform3.visitor) {
|
|
4159
|
-
const visitor = transform3.visitor(
|
|
4183
|
+
const visitor = transform3.visitor(options);
|
|
4160
4184
|
visitor.noScope = noScopeOverride ?? !transform3.scope;
|
|
4161
|
-
|
|
4185
|
+
traverse6(ast2, visitor, undefined, state);
|
|
4162
4186
|
}
|
|
4163
4187
|
logger2(`${transform3.name}: finished with ${state.changes} changes`);
|
|
4164
4188
|
return state;
|
|
4165
4189
|
}
|
|
4166
|
-
var logger2 = debug4("delance:transforms");
|
|
4167
4190
|
|
|
4168
4191
|
// transform/esmodule/index.ts
|
|
4169
4192
|
function transform3(ast2) {
|
|
@@ -4255,7 +4278,7 @@ function transform4(ast2) {
|
|
|
4255
4278
|
return ast2;
|
|
4256
4279
|
}
|
|
4257
4280
|
|
|
4258
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
4281
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/transpile/transforms/index.ts
|
|
4259
4282
|
var exports_transforms2 = {};
|
|
4260
4283
|
__export(exports_transforms2, {
|
|
4261
4284
|
templateLiterals: () => template_literals_default,
|
|
@@ -4266,7 +4289,7 @@ __export(exports_transforms2, {
|
|
|
4266
4289
|
defaultParameters: () => default_parameters_default
|
|
4267
4290
|
});
|
|
4268
4291
|
|
|
4269
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
4292
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/transpile/transforms/default-parameters.ts
|
|
4270
4293
|
import * as t40 from "@babel/types";
|
|
4271
4294
|
var default_parameters_default = {
|
|
4272
4295
|
name: "default-parameters",
|
|
@@ -4332,7 +4355,7 @@ var default_parameters_default = {
|
|
|
4332
4355
|
};
|
|
4333
4356
|
}
|
|
4334
4357
|
};
|
|
4335
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
4358
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/transpile/transforms/logical-assignments.ts
|
|
4336
4359
|
import * as t41 from "@babel/types";
|
|
4337
4360
|
var logical_assignments_default = {
|
|
4338
4361
|
name: "logical-assignments",
|
|
@@ -4387,7 +4410,7 @@ var logical_assignments_default = {
|
|
|
4387
4410
|
};
|
|
4388
4411
|
}
|
|
4389
4412
|
};
|
|
4390
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
4413
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/transpile/transforms/nullish-coalescing.ts
|
|
4391
4414
|
import * as t42 from "@babel/types";
|
|
4392
4415
|
var nullish_coalescing_default = {
|
|
4393
4416
|
name: "nullish-coalescing",
|
|
@@ -4430,7 +4453,7 @@ var nullish_coalescing_default = {
|
|
|
4430
4453
|
};
|
|
4431
4454
|
}
|
|
4432
4455
|
};
|
|
4433
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
4456
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/transpile/transforms/nullish-coalescing-assignment.ts
|
|
4434
4457
|
import * as t43 from "@babel/types";
|
|
4435
4458
|
var nullish_coalescing_assignment_default = {
|
|
4436
4459
|
name: "nullish-coalescing-assignment",
|
|
@@ -4464,7 +4487,7 @@ var nullish_coalescing_assignment_default = {
|
|
|
4464
4487
|
};
|
|
4465
4488
|
}
|
|
4466
4489
|
};
|
|
4467
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
4490
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/transpile/transforms/optional-chaining.ts
|
|
4468
4491
|
import * as t44 from "@babel/types";
|
|
4469
4492
|
var optional_chaining_default = {
|
|
4470
4493
|
name: "optional-chaining",
|
|
@@ -4498,33 +4521,33 @@ var optional_chaining_default = {
|
|
|
4498
4521
|
};
|
|
4499
4522
|
}
|
|
4500
4523
|
};
|
|
4501
|
-
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=
|
|
4524
|
+
// node_modules/.pnpm/webcrack@https+++gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages+webcrack&commit=f_c5bbn3al5xpen7fhtzx3y6fad4/node_modules/webcrack/src/transpile/transforms/template-literals.ts
|
|
4502
4525
|
import * as t45 from "@babel/types";
|
|
4503
4526
|
function escape2(str) {
|
|
4504
4527
|
return str.replaceAll("\\", "\\\\").replaceAll("`", "\\`").replaceAll("$", "\\$").replaceAll("\0", "\\0").replaceAll("\b", "\\b").replaceAll("\f", "\\f").replaceAll("\r", "\\r").replaceAll("\t", "\\t").replaceAll("\v", "\\v");
|
|
4505
4528
|
}
|
|
4506
|
-
function push(
|
|
4529
|
+
function push(template, value) {
|
|
4507
4530
|
if (value.type === "StringLiteral") {
|
|
4508
|
-
const lastQuasi =
|
|
4531
|
+
const lastQuasi = template.quasis.at(-1);
|
|
4509
4532
|
lastQuasi.value.raw += escape2(value.value);
|
|
4510
4533
|
} else if (value.type === "TemplateLiteral") {
|
|
4511
|
-
const lastQuasi =
|
|
4534
|
+
const lastQuasi = template.quasis.at(-1);
|
|
4512
4535
|
const firstQuasi = value.quasis[0];
|
|
4513
4536
|
lastQuasi.value.raw += firstQuasi.value.raw;
|
|
4514
|
-
|
|
4515
|
-
|
|
4537
|
+
template.expressions.push(...value.expressions);
|
|
4538
|
+
template.quasis.push(...value.quasis.slice(1));
|
|
4516
4539
|
} else {
|
|
4517
|
-
|
|
4518
|
-
|
|
4540
|
+
template.expressions.push(value);
|
|
4541
|
+
template.quasis.push(t45.templateElement({ raw: "" }));
|
|
4519
4542
|
}
|
|
4520
4543
|
}
|
|
4521
|
-
function unshift(
|
|
4544
|
+
function unshift(template, value) {
|
|
4522
4545
|
if (value.type === "StringLiteral") {
|
|
4523
|
-
const firstQuasi =
|
|
4546
|
+
const firstQuasi = template.quasis[0];
|
|
4524
4547
|
firstQuasi.value.raw = escape2(value.value) + firstQuasi.value.raw;
|
|
4525
4548
|
} else {
|
|
4526
|
-
|
|
4527
|
-
|
|
4549
|
+
template.expressions.unshift(value);
|
|
4550
|
+
template.quasis.unshift(t45.templateElement({ raw: "" }));
|
|
4528
4551
|
}
|
|
4529
4552
|
}
|
|
4530
4553
|
var template_literals_default = {
|
|
@@ -4552,12 +4575,12 @@ var template_literals_default = {
|
|
|
4552
4575
|
CallExpression: {
|
|
4553
4576
|
exit(path) {
|
|
4554
4577
|
if (concatMatcher.match(path.node)) {
|
|
4555
|
-
const
|
|
4556
|
-
push(
|
|
4578
|
+
const template = t45.templateLiteral([t45.templateElement({ raw: "" })], []);
|
|
4579
|
+
push(template, string.current);
|
|
4557
4580
|
for (const arg of path.node.arguments) {
|
|
4558
|
-
push(
|
|
4581
|
+
push(template, arg);
|
|
4559
4582
|
}
|
|
4560
|
-
path.replaceWith(
|
|
4583
|
+
path.replaceWith(template);
|
|
4561
4584
|
this.changes++;
|
|
4562
4585
|
}
|
|
4563
4586
|
}
|
|
@@ -4573,26 +4596,12 @@ var transpile_default = mergeTransforms({
|
|
|
4573
4596
|
});
|
|
4574
4597
|
|
|
4575
4598
|
// transform/delance/stringaes.ts
|
|
4576
|
-
import
|
|
4599
|
+
import traverse7 from "@babel/traverse";
|
|
4577
4600
|
import * as t46 from "@babel/types";
|
|
4578
4601
|
|
|
4579
4602
|
// utils/crypto.ts
|
|
4580
4603
|
import crypto from "node:crypto";
|
|
4581
|
-
import {Buffer} from "node:buffer";
|
|
4582
|
-
function salt(x = _salt) {
|
|
4583
|
-
_salt = x;
|
|
4584
|
-
return _salt;
|
|
4585
|
-
}
|
|
4586
|
-
function lic(x = _lic) {
|
|
4587
|
-
_lic = x;
|
|
4588
|
-
return _lic;
|
|
4589
|
-
}
|
|
4590
|
-
function decrypt(m) {
|
|
4591
|
-
const c = crypto.createDecipheriv("aes-192-cbc", scrypt(), iv());
|
|
4592
|
-
let a = c.update(m, "hex", "utf8");
|
|
4593
|
-
a += c.final("utf8");
|
|
4594
|
-
return a;
|
|
4595
|
-
}
|
|
4604
|
+
import { Buffer } from "node:buffer";
|
|
4596
4605
|
var _salt = "SEE LICENSE.txt";
|
|
4597
4606
|
var _lic = [
|
|
4598
4607
|
",oidutS lausiV tfosorciM htiw ylno erawtfos eht fo seipoc fo rebmun yna esu dna llatsni yam uoY",
|
|
@@ -4608,8 +4617,22 @@ var _lic = [
|
|
|
4608
4617
|
",)evoba smret eht ot tcejbus ,edoc elbatubirtsid yna rof tpecxe( erawtfos eht esael ro ,etubirtsid ,hsilbup ,erahs",
|
|
4609
4618
|
".ytrap driht yna ot tnemeerga siht ro erawtfos eht refsnart ro ,esu ot srehto rof gnireffo enola-dnats a sa erawtfos eht edivorp"
|
|
4610
4619
|
].map((x) => [...x].reverse().join("")).join(" ");
|
|
4620
|
+
function salt(x = _salt) {
|
|
4621
|
+
_salt = x;
|
|
4622
|
+
return _salt;
|
|
4623
|
+
}
|
|
4624
|
+
function lic(x = _lic) {
|
|
4625
|
+
_lic = x;
|
|
4626
|
+
return _lic;
|
|
4627
|
+
}
|
|
4611
4628
|
var scrypt = () => crypto.scryptSync(lic(), salt(), 24);
|
|
4612
4629
|
var iv = () => Buffer.from(salt());
|
|
4630
|
+
function decrypt(m) {
|
|
4631
|
+
const c = crypto.createDecipheriv("aes-192-cbc", scrypt(), iv());
|
|
4632
|
+
let a = c.update(m, "hex", "utf8");
|
|
4633
|
+
a += c.final("utf8");
|
|
4634
|
+
return a;
|
|
4635
|
+
}
|
|
4613
4636
|
|
|
4614
4637
|
// transform/delance/stringaes.ts
|
|
4615
4638
|
var scrypt2 = callExpression(memberExpression(identifier(), identifier("scryptSync"), false), [
|
|
@@ -4624,7 +4647,7 @@ var stringaes_default = {
|
|
|
4624
4647
|
name: "string-aes",
|
|
4625
4648
|
tags: ["safe"],
|
|
4626
4649
|
run(ast2) {
|
|
4627
|
-
|
|
4650
|
+
traverse7(ast2, {
|
|
4628
4651
|
CallExpression: {
|
|
4629
4652
|
exit($) {
|
|
4630
4653
|
if (newSalt || !scrypt2.match($.node)) {
|
|
@@ -4805,4 +4828,4 @@ export {
|
|
|
4805
4828
|
delance_builder_default as default
|
|
4806
4829
|
};
|
|
4807
4830
|
|
|
4808
|
-
export { delance_builder_default };
|
|
4831
|
+
export { __require, delance_builder_default };
|