From 5cd063fe92b46a0d3b219ebc3e065313eca57bb8 Mon Sep 17 00:00:00 2001 From: sanex3339 Date: Sun, 7 Jun 2020 00:36:30 +0300 Subject: [PATCH] Added `mangleProperties` to the runtime tests. Readme update --- CHANGELOG.md | 5 +++++ README.md | 6 +++--- package.json | 2 +- test/runtime-tests/JavaScriptObfuscatorRuntime.spec.ts | 10 +++++++--- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3d2bf58..e6c11046 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ Change Log +v1.1.0 +--- +* **New option:** `mangleProperties` enables mangling property names + + v1.0.1 --- * Fixed .d.ts typings. https://github.com/javascript-obfuscator/javascript-obfuscator/issues/623 diff --git a/README.md b/README.md index 1ae7055b..9f3c4e47 100644 --- a/README.md +++ b/README.md @@ -667,13 +667,13 @@ Enables logging of the information to the console. ### `mangleProperties` Type: `boolean` Default: `false` -##### :warning: this option will break your code in most cases. Enable it only if you know what it does! +##### :warning: this option **WILL** break your code in most cases. Enable it only if you know what it does! Enables mangling property names. -Generated names are being controlled by [`identifierNamesGenerator`](#identifierNamesGenerator) option. +To set format of renamed property names use [`identifierNamesGenerator`](#identifierNamesGenerator) option. -It is possible to control which properties will be mangled with [`reservedNames`](#reservedNames) option. +To control which properties will be renamed use [`reservedNames`](#reservedNames) option. ### `renameGlobals` Type: `boolean` Default: `false` diff --git a/package.json b/package.json index b03cb11c..fc3ea6ad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "javascript-obfuscator", - "version": "1.0.1", + "version": "1.1.0", "description": "JavaScript obfuscator", "keywords": [ "obfuscator", diff --git a/test/runtime-tests/JavaScriptObfuscatorRuntime.spec.ts b/test/runtime-tests/JavaScriptObfuscatorRuntime.spec.ts index 8e575e19..28d2d709 100644 --- a/test/runtime-tests/JavaScriptObfuscatorRuntime.spec.ts +++ b/test/runtime-tests/JavaScriptObfuscatorRuntime.spec.ts @@ -25,6 +25,7 @@ describe('JavaScriptObfuscator runtime eval', function () { debugProtection: true, disableConsoleOutput: true, domainLock: ['obfuscator.io'], + mangleProperties: true, reservedNames: ['generate', 'sha256'], rotateStringArray: true, selfDefending: true, @@ -67,7 +68,8 @@ describe('JavaScriptObfuscator runtime eval', function () { code, { ...baseOptions, - ...options + ...options, + mangleProperties: false } ).getObfuscatedCode(); @@ -178,7 +180,8 @@ describe('JavaScriptObfuscator runtime eval', function () { code, { ...baseOptions, - ...options + ...options, + mangleProperties: false } ).getObfuscatedCode(); @@ -248,7 +251,8 @@ describe('JavaScriptObfuscator runtime eval', function () { { ...baseOptions, ...options, - ...webpackBootstrapOptions + ...webpackBootstrapOptions, + reservedNames: ['^foo$'] } ).getObfuscatedCode();