javascript-obfuscator 4.2.0 → 4.2.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "javascript-obfuscator",
3
- "version": "4.2.0",
3
+ "version": "4.2.2",
4
4
  "description": "JavaScript obfuscator",
5
5
  "keywords": [
6
6
  "obfuscator",
@@ -29,6 +29,7 @@
29
29
  "chance": "1.1.13",
30
30
  "class-validator": "0.14.3",
31
31
  "commander": "12.1.0",
32
+ "conf": "15.0.2",
32
33
  "eslint-scope": "8.4.0",
33
34
  "eslint-visitor-keys": "4.2.1",
34
35
  "fast-deep-equal": "3.1.3",
@@ -36,8 +37,7 @@
36
37
  "js-string-escape": "1.0.1",
37
38
  "md5": "2.3.0",
38
39
  "mkdirp": "3.0.1",
39
- "multimatch": "7.0.0",
40
- "opencollective-postinstall": "2.0.3",
40
+ "multimatch": "5.0.0",
41
41
  "process": "0.11.10",
42
42
  "reflect-metadata": "0.2.2",
43
43
  "source-map-support": "0.5.21",
@@ -71,10 +71,12 @@
71
71
  "chai-exclude": "3.0.1",
72
72
  "cross-env": "10.1.0",
73
73
  "eslint": "8.57.1",
74
+ "eslint-config-prettier": "10.1.8",
74
75
  "eslint-plugin-import": "2.32.0",
75
76
  "eslint-plugin-jsdoc": "50.6.3",
76
77
  "eslint-plugin-no-null": "1.0.2",
77
78
  "eslint-plugin-prefer-arrow": "1.2.3",
79
+ "eslint-plugin-prettier": "5.5.4",
78
80
  "eslint-plugin-unicorn": "56.0.1",
79
81
  "eslint-webpack-plugin": "4.2.0",
80
82
  "fork-ts-checker-notifier-webpack-plugin": "9.0.0",
@@ -84,6 +86,7 @@
84
86
  "mocha": "11.7.4",
85
87
  "nyc": "17.1.0",
86
88
  "pjson": "1.0.9",
89
+ "prettier": "3.6.2",
87
90
  "rimraf": "6.0.1",
88
91
  "sinon": "19.0.2",
89
92
  "source-map-resolve": "0.6.0",
@@ -104,7 +107,7 @@
104
107
  "scripts": {
105
108
  "start": "yarn run watch",
106
109
  "webpack:prod": "webpack --config ./webpack/webpack.node.config.js --config ./webpack/webpack.browser.config.js --mode production",
107
- "build": "yarn run webpack:prod && yarn run eslint && yarn test",
110
+ "build": "yarn run webpack:prod && yarn run eslint",
108
111
  "build:typings": "rm -rf ./typings && tsc --project src/tsconfig.typings.json",
109
112
  "watch": "webpack --config ./webpack/webpack.node.config.js --mode development --watch",
110
113
  "test:dev": "ts-node --type-check test/dev/dev.ts",
@@ -117,10 +120,12 @@
117
120
  "test:mocha-memory-performance": "cross-env NODE_OPTIONS=--max-old-space-size=280 mocha --require ts-node/register test/performance-tests/JavaScriptObfuscatorMemory.spec.ts",
118
121
  "test": "yarn run test:full",
119
122
  "eslint": "eslint src/**/*.ts",
123
+ "prettier": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
124
+ "prettier:check": "prettier --check \"src/**/*.ts\" \"test/**/*.ts\"",
125
+ "format": "yarn run prettier && yarn run eslint --fix",
120
126
  "git:addFiles": "git add .",
121
- "postinstall": "opencollective-postinstall",
122
- "precommit": "npm run build",
123
- "prepublishOnly": "npm run build && npm run build:typings",
127
+ "precommit": "yarn run eslint",
128
+ "prepublishOnly": "yarn run build && yarn run build:typings",
124
129
  "prepare": "husky install"
125
130
  },
126
131
  "author": {
@@ -131,11 +136,5 @@
131
136
  "Dmitry Zamotkin (https://github.com/zamotkin)"
132
137
  ],
133
138
  "license": "BSD-2-Clause",
134
- "funding": {
135
- "type": "opencollective",
136
- "url": "https://opencollective.com/javascript-obfuscator"
137
- },
138
- "collective": {
139
- "url": "https://opencollective.com/javascript-obfuscator"
140
- }
139
+ "packageManager": "yarn@1.22.21+sha512.ca75da26c00327d26267ce33536e5790f18ebd53266796fbb664d2a4a5116308042dd8ee7003b276a20eace7d3c5561c3577bdd71bcb67071187af124779620a"
141
140
  }
@@ -0,0 +1,2 @@
1
+ export declare const proAdvertiseMessageFirstPart = "\uD83D\uDEE1\uFE0F JavaScript Obfuscator Pro is now available \u2014 with powerful Virtual Machine-based obfuscation\n(bytecode virtualization, anti-decompilation, unique opcode and VM structure each compilation, and more).";
2
+ export declare const proAdvertiseMessageSecondPart = "\uD83D\uDC49\uFE0F Get your API key at https://obfuscator.io and start using Virtual Machine obfuscation with javascript-obfuscator package.";
@@ -5,5 +5,7 @@ export declare enum LoggingMessage {
5
5
  RandomGeneratorSeed = "Random generator seed: %s...",
6
6
  CodeTransformationStage = "Code transformation stage: %s...",
7
7
  NodeTransformationStage = "AST transformation stage: %s...",
8
- Version = "Version: %s"
8
+ Version = "Version: %s",
9
+ JavaScriptObfuscatorProAdFirstPart = "\uD83D\uDEE1\uFE0F JavaScript Obfuscator Pro is now available \u2014 with powerful Virtual Machine-based obfuscation\n(bytecode virtualization, anti-decompilation, unique opcode and VM structure each compilation, and more).",
10
+ JavaScriptObfuscatorProAdSecondPart = "\uD83D\uDC49\uFE0F Get your API key at https://obfuscator.io and start using Virtual Machine obfuscation with javascript-obfuscator package."
9
11
  }
@@ -3,4 +3,5 @@ export interface ILogger {
3
3
  info(loggingMessage: LoggingMessage, value?: string | number): void;
4
4
  success(loggingMessage: LoggingMessage, value?: string | number): void;
5
5
  warn(loggingMessage: LoggingMessage, value?: string | number): void;
6
+ advertise(loggingMessage: LoggingMessage): void;
6
7
  }
@@ -13,4 +13,5 @@ export declare class Logger implements ILogger {
13
13
  info(loggingMessage: LoggingMessage, value?: string | number): void;
14
14
  success(loggingMessage: LoggingMessage, value?: string | number): void;
15
15
  warn(loggingMessage: LoggingMessage, value?: string | number): void;
16
+ advertise(loggingMessage: LoggingMessage): void;
16
17
  }
@@ -1,7 +1,7 @@
1
1
  import * as ESTree from 'estree';
2
- export type TNodeWithSingleStatementBody = (ESTree.LabeledStatement | ESTree.WithStatement | ESTree.WhileStatement | ESTree.DoWhileStatement | ESTree.ForStatement | ESTree.ForInStatement | ESTree.ForOfStatement & {
2
+ export type TNodeWithSingleStatementBody = (ESTree.LabeledStatement | ESTree.WithStatement | ESTree.WhileStatement | ESTree.DoWhileStatement | ESTree.ForStatement | ESTree.ForInStatement | (ESTree.ForOfStatement & {
3
3
  body: Exclude<ESTree.Statement, ESTree.BlockStatement>;
4
- }) | (ESTree.IfStatement & {
4
+ })) | (ESTree.IfStatement & {
5
5
  consequent: Exclude<ESTree.Statement, ESTree.BlockStatement>;
6
6
  alternate?: Exclude<ESTree.Statement, ESTree.BlockStatement> | null;
7
7
  });
@@ -1 +1 @@
1
- export type TTypeFromEnum<T extends object> = (T)[keyof T];
1
+ export type TTypeFromEnum<T extends object> = T[keyof T];
@@ -0,0 +1,17 @@
1
+ export declare class AdvertisementUtils {
2
+ private static readonly maxDisplayCount;
3
+ private static readonly storageKey;
4
+ private static readonly timestampKey;
5
+ private static readonly resetPeriodMs;
6
+ private static readonly ciEnvVars;
7
+ private static config;
8
+ static isCI(): boolean;
9
+ static shouldShowAdvertisement(): boolean;
10
+ private static isNodeEnvironment;
11
+ private static getConfig;
12
+ private static getDisplayCount;
13
+ private static setDisplayCount;
14
+ private static getFirstDisplayTime;
15
+ private static setFirstDisplayTime;
16
+ private static resetDisplayData;
17
+ }