Browse Source

Merge pull request #725 from javascript-obfuscator/preset-option

New `optionsPreset` option
Timofey Kachalov 4 years ago
parent
commit
8c91a254be

+ 4 - 0
CHANGELOG.md

@@ -1,5 +1,9 @@
 Change Log
 Change Log
 
 
+v1.12.0
+---
+* **New option:** `optionsPreset` allows to set options preset
+
 v1.11.0
 v1.11.0
 ---
 ---
 * Improved rename of `deadCodeInjection` dead code identifiers. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/708
 * Improved rename of `deadCodeInjection` dead code identifiers. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/708

+ 42 - 1
README.md

@@ -338,6 +338,7 @@ Following options are available for the JS Obfuscator:
     inputFileName: '',
     inputFileName: '',
     log: false,
     log: false,
     numbersToExpressions: false,
     numbersToExpressions: false,
+    optionsPreset: 'default',
     renameGlobals: false,
     renameGlobals: false,
     renameProperties: false,
     renameProperties: false,
     reservedNames: [],
     reservedNames: [],
@@ -385,6 +386,7 @@ Following options are available for the JS Obfuscator:
     --identifiers-prefix <string>
     --identifiers-prefix <string>
     --log <boolean>
     --log <boolean>
     --numbers-to-expressions <boolean>
     --numbers-to-expressions <boolean>
+    --options-preset <string> [default, low-obfuscation, medium-obfuscation, high-obfuscation]
     --rename-globals <boolean>
     --rename-globals <boolean>
     --rename-properties <boolean>
     --rename-properties <boolean>
     --reserved-names '<list>' (comma separated)
     --reserved-names '<list>' (comma separated)
@@ -688,6 +690,19 @@ const foo = 1234;
 const foo=-0xd93+-0x10b4+0x41*0x67+0x84e*0x3+-0xff8;
 const foo=-0xd93+-0x10b4+0x41*0x67+0x84e*0x3+-0xff8;
 ```
 ```
 
 
+### `optionsPreset`
+Type: `string` Default: `default`
+
+Allows to set [options preset](#preset-options).
+
+Available values: 
+* `default`;
+* `low-obfuscation`;
+* `medium-obfuscation`;
+* `high-obfuscation`.
+
+All addition options will be merged with selected options preset.
+
 ### `renameGlobals`
 ### `renameGlobals`
 Type: `boolean` Default: `false`
 Type: `boolean` Default: `false`
 
 
@@ -1038,7 +1053,7 @@ Performance will 30-35% slower than without obfuscation
     disableConsoleOutput: true,
     disableConsoleOutput: true,
     identifierNamesGenerator: 'hexadecimal',
     identifierNamesGenerator: 'hexadecimal',
     log: false,
     log: false,
-    numbersToExpressions: false,
+    numbersToExpressions: true,
     renameGlobals: false,
     renameGlobals: false,
     rotateStringArray: true,
     rotateStringArray: true,
     selfDefending: true,
     selfDefending: true,
@@ -1082,6 +1097,32 @@ Performance will slightly slower than without obfuscation
 }
 }
 ```
 ```
 
 
+### Default preset, High performance
+
+```javascript
+{
+    compact: true,
+    controlFlowFlattening: false,
+    deadCodeInjection: false,
+    debugProtection: false,
+    debugProtectionInterval: false,
+    disableConsoleOutput: false,
+    identifierNamesGenerator: 'hexadecimal',
+    log: false,
+    numbersToExpressions: false,
+    renameGlobals: false,
+    rotateStringArray: true,
+    selfDefending: false,
+    shuffleStringArray: true,
+    simplify: true,
+    splitStrings: false,
+    stringArray: true,
+    stringArrayEncoding: false,
+    stringArrayThreshold: 0.75,
+    unicodeEscapeSequence: false
+}
+```
+
 ## Frequently Asked Questions
 ## Frequently Asked Questions
 
 
 ### What javascript versions are supported?
 ### What javascript versions are supported?

File diff suppressed because it is too large
+ 0 - 0
dist/index.browser.js


File diff suppressed because it is too large
+ 0 - 0
dist/index.cli.js


File diff suppressed because it is too large
+ 0 - 0
dist/index.js


+ 7 - 6
package.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "javascript-obfuscator",
   "name": "javascript-obfuscator",
-  "version": "1.11.0",
+  "version": "1.12.0",
   "description": "JavaScript obfuscator",
   "description": "JavaScript obfuscator",
   "keywords": [
   "keywords": [
     "obfuscator",
     "obfuscator",
@@ -27,11 +27,11 @@
     "chalk": "4.1.0",
     "chalk": "4.1.0",
     "chance": "1.1.7",
     "chance": "1.1.7",
     "class-validator": "0.12.2",
     "class-validator": "0.12.2",
-    "commander": "6.0.0",
+    "commander": "6.1.0",
     "escodegen": "2.0.0",
     "escodegen": "2.0.0",
     "eslint-scope": "5.1.0",
     "eslint-scope": "5.1.0",
     "estraverse": "5.2.0",
     "estraverse": "5.2.0",
-    "eventemitter3": "4.0.6",
+    "eventemitter3": "4.0.7",
     "fast-deep-equal": "3.1.3",
     "fast-deep-equal": "3.1.3",
     "inversify": "5.0.1",
     "inversify": "5.0.1",
     "js-string-escape": "1.0.1",
     "js-string-escape": "1.0.1",
@@ -57,7 +57,7 @@
     "@types/mkdirp": "1.0.1",
     "@types/mkdirp": "1.0.1",
     "@types/mocha": "8.0.3",
     "@types/mocha": "8.0.3",
     "@types/multimatch": "4.0.0",
     "@types/multimatch": "4.0.0",
-    "@types/node": "14.6.0",
+    "@types/node": "14.6.2",
     "@types/rimraf": "3.0.0",
     "@types/rimraf": "3.0.0",
     "@types/sinon": "9.0.5",
     "@types/sinon": "9.0.5",
     "@types/string-template": "1.0.2",
     "@types/string-template": "1.0.2",
@@ -65,16 +65,17 @@
     "@typescript-eslint/eslint-plugin": "3.10.1",
     "@typescript-eslint/eslint-plugin": "3.10.1",
     "@typescript-eslint/parser": "3.10.1",
     "@typescript-eslint/parser": "3.10.1",
     "chai": "4.2.0",
     "chai": "4.2.0",
+    "chai-exclude": "2.0.2",
     "coveralls": "3.1.0",
     "coveralls": "3.1.0",
     "eslint": "7.7.0",
     "eslint": "7.7.0",
     "eslint-plugin-import": "2.22.0",
     "eslint-plugin-import": "2.22.0",
-    "eslint-plugin-jsdoc": "30.2.4",
+    "eslint-plugin-jsdoc": "30.3.0",
     "eslint-plugin-no-null": "1.0.2",
     "eslint-plugin-no-null": "1.0.2",
     "eslint-plugin-prefer-arrow": "1.2.2",
     "eslint-plugin-prefer-arrow": "1.2.2",
     "eslint-plugin-unicorn": "21.0.0",
     "eslint-plugin-unicorn": "21.0.0",
     "fork-ts-checker-notifier-webpack-plugin": "3.0.0",
     "fork-ts-checker-notifier-webpack-plugin": "3.0.0",
     "fork-ts-checker-webpack-plugin": "5.1.0",
     "fork-ts-checker-webpack-plugin": "5.1.0",
-    "mocha": "8.1.1",
+    "mocha": "8.1.3",
     "nyc": "15.1.0",
     "nyc": "15.1.0",
     "pjson": "1.0.9",
     "pjson": "1.0.9",
     "pre-commit": "1.2.2",
     "pre-commit": "1.2.2",

+ 8 - 0
src/cli/JavaScriptObfuscatorCLI.ts

@@ -19,6 +19,7 @@ import { ArraySanitizer } from './sanitizers/ArraySanitizer';
 import { BooleanSanitizer } from './sanitizers/BooleanSanitizer';
 import { BooleanSanitizer } from './sanitizers/BooleanSanitizer';
 import { IdentifierNamesGeneratorSanitizer } from './sanitizers/IdentifierNamesGeneratorSanitizer';
 import { IdentifierNamesGeneratorSanitizer } from './sanitizers/IdentifierNamesGeneratorSanitizer';
 import { ObfuscationTargetSanitizer } from './sanitizers/ObfuscatingTargetSanitizer';
 import { ObfuscationTargetSanitizer } from './sanitizers/ObfuscatingTargetSanitizer';
+import { OptionsPresetSanitizer } from './sanitizers/OptionsPresetSanitizer';
 import { SourceMapModeSanitizer } from './sanitizers/SourceMapModeSanitizer';
 import { SourceMapModeSanitizer } from './sanitizers/SourceMapModeSanitizer';
 import { StringArrayEncodingSanitizer } from './sanitizers/StringArrayEncodingSanitizer';
 import { StringArrayEncodingSanitizer } from './sanitizers/StringArrayEncodingSanitizer';
 
 
@@ -253,6 +254,13 @@ export class JavaScriptObfuscatorCLI implements IInitializable {
                 '--numbers-to-expressions <boolean>', 'Enables numbers conversion to expressions',
                 '--numbers-to-expressions <boolean>', 'Enables numbers conversion to expressions',
                 BooleanSanitizer
                 BooleanSanitizer
             )
             )
+            .option(
+                '--options-preset <string>',
+                'Allows to set options preset. ' +
+                'Values: default, low-obfuscation, medium-obfuscation, high-obfuscation. ' +
+                'Default: default',
+                OptionsPresetSanitizer
+            )
             .option(
             .option(
                 '--reserved-names <list> (comma separated, without whitespaces)',
                 '--reserved-names <list> (comma separated, without whitespaces)',
                 'Disables obfuscation and generation of identifiers, which being matched by passed RegExp patterns (comma separated)',
                 'Disables obfuscation and generation of identifiers, which being matched by passed RegExp patterns (comma separated)',

+ 21 - 0
src/cli/sanitizers/OptionsPresetSanitizer.ts

@@ -0,0 +1,21 @@
+import { TCLISanitizer } from '../../types/cli/TCLISanitizer';
+
+import { OptionsPreset } from '../../enums/options/presets/OptionsPreset';
+
+/**
+ * @param {string} value
+ * @returns {string}
+ */
+export const OptionsPresetSanitizer: TCLISanitizer <string> = (value: string): string => {
+    const isCorrectOptionsPreset: boolean = Object
+        .keys(OptionsPreset)
+        .some((key: string): boolean => {
+            return OptionsPreset[<keyof typeof OptionsPreset>key] === value;
+        });
+
+    if (!isCorrectOptionsPreset) {
+        throw new ReferenceError('Invalid value of `--options-preset` option');
+    }
+
+    return value;
+};

+ 13 - 0
src/enums/options/presets/OptionsPreset.ts

@@ -0,0 +1,13 @@
+import { MakeEnum } from '@gradecam/tsenum';
+
+export const OptionsPreset: Readonly<{
+    Default: 'default';
+    LowObfuscation: 'low-obfuscation';
+    MediumObfuscation: 'medium-obfuscation';
+    HighObfuscation: 'high-obfuscation';
+}> = MakeEnum({
+    Default: 'default',
+    LowObfuscation: 'low-obfuscation',
+    MediumObfuscation: 'medium-obfuscation',
+    HighObfuscation: 'high-obfuscation'
+});

+ 2 - 0
src/interfaces/options/IOptions.ts

@@ -4,6 +4,7 @@ import { TStringArrayEncoding } from '../../types/options/TStringArrayEncoding';
 
 
 import { IdentifierNamesGenerator } from '../../enums/generators/identifier-names-generators/IdentifierNamesGenerator';
 import { IdentifierNamesGenerator } from '../../enums/generators/identifier-names-generators/IdentifierNamesGenerator';
 import { ObfuscationTarget } from '../../enums/ObfuscationTarget';
 import { ObfuscationTarget } from '../../enums/ObfuscationTarget';
+import { OptionsPreset } from '../../enums/options/presets/OptionsPreset';
 import { SourceMapMode } from '../../enums/source-map/SourceMapMode';
 import { SourceMapMode } from '../../enums/source-map/SourceMapMode';
 
 
 export interface IOptions {
 export interface IOptions {
@@ -22,6 +23,7 @@ export interface IOptions {
     readonly inputFileName: string;
     readonly inputFileName: string;
     readonly log: boolean;
     readonly log: boolean;
     readonly numbersToExpressions: boolean;
     readonly numbersToExpressions: boolean;
+    readonly optionsPreset: TypeFromEnum<typeof OptionsPreset>;
     readonly renameGlobals: boolean;
     readonly renameGlobals: boolean;
     readonly renameProperties: boolean;
     readonly renameProperties: boolean;
     readonly reservedNames: string[];
     readonly reservedNames: string[];

+ 30 - 1
src/options/Options.ts

@@ -28,16 +28,30 @@ import { IOptionsNormalizer } from '../interfaces/options/IOptionsNormalizer';
 
 
 import { IdentifierNamesGenerator } from '../enums/generators/identifier-names-generators/IdentifierNamesGenerator';
 import { IdentifierNamesGenerator } from '../enums/generators/identifier-names-generators/IdentifierNamesGenerator';
 import { ObfuscationTarget } from '../enums/ObfuscationTarget';
 import { ObfuscationTarget } from '../enums/ObfuscationTarget';
+import { OptionsPreset } from '../enums/options/presets/OptionsPreset';
 import { SourceMapMode } from '../enums/source-map/SourceMapMode';
 import { SourceMapMode } from '../enums/source-map/SourceMapMode';
 import { StringArrayEncoding } from '../enums/StringArrayEncoding';
 import { StringArrayEncoding } from '../enums/StringArrayEncoding';
 
 
 import { DEFAULT_PRESET } from './presets/Default';
 import { DEFAULT_PRESET } from './presets/Default';
+import { LOW_OBFUSCATION_PRESET } from './presets/LowObfuscation';
+import { MEDIUM_OBFUSCATION_PRESET } from './presets/MediumObfuscation';
+import { HIGH_OBFUSCATION_PRESET } from './presets/HighObfuscation';
 
 
 import { ValidationErrorsFormatter } from './ValidationErrorsFormatter';
 import { ValidationErrorsFormatter } from './ValidationErrorsFormatter';
 import { IsAllowedForObfuscationTargets } from './validators/IsAllowedForObfuscationTargets';
 import { IsAllowedForObfuscationTargets } from './validators/IsAllowedForObfuscationTargets';
 
 
 @injectable()
 @injectable()
 export class Options implements IOptions {
 export class Options implements IOptions {
+    /**
+     * @type {Map<TypeFromEnum<typeof OptionsPreset>, TInputOptions>}
+     */
+    private static readonly optionPresetsMap: Map<TypeFromEnum<typeof OptionsPreset>, TInputOptions> = new Map([
+        [OptionsPreset.Default, DEFAULT_PRESET],
+        [OptionsPreset.LowObfuscation, LOW_OBFUSCATION_PRESET],
+        [OptionsPreset.MediumObfuscation, MEDIUM_OBFUSCATION_PRESET],
+        [OptionsPreset.HighObfuscation, HIGH_OBFUSCATION_PRESET]
+    ]);
+
     /**
     /**
      * @type {ValidatorOptions}
      * @type {ValidatorOptions}
      */
      */
@@ -157,6 +171,17 @@ export class Options implements IOptions {
     @IsBoolean()
     @IsBoolean()
     public readonly numbersToExpressions!: boolean;
     public readonly numbersToExpressions!: boolean;
 
 
+    /**
+     * @type {OptionsPreset}
+     */
+    @IsIn([
+        OptionsPreset.Default,
+        OptionsPreset.LowObfuscation,
+        OptionsPreset.MediumObfuscation,
+        OptionsPreset.HighObfuscation
+    ])
+    public readonly optionsPreset!: TypeFromEnum<typeof OptionsPreset>;
+
     /**
     /**
      * @type {boolean}
      * @type {boolean}
      */
      */
@@ -308,7 +333,11 @@ export class Options implements IOptions {
         @inject(ServiceIdentifiers.TInputOptions) inputOptions: TInputOptions,
         @inject(ServiceIdentifiers.TInputOptions) inputOptions: TInputOptions,
         @inject(ServiceIdentifiers.IOptionsNormalizer) optionsNormalizer: IOptionsNormalizer
         @inject(ServiceIdentifiers.IOptionsNormalizer) optionsNormalizer: IOptionsNormalizer
     ) {
     ) {
-        Object.assign(this, DEFAULT_PRESET, inputOptions);
+        const optionsPreset: TInputOptions = Options.optionPresetsMap
+            .get(inputOptions.optionsPreset ?? OptionsPreset.Default)
+            ?? DEFAULT_PRESET;
+
+        Object.assign(this, optionsPreset, inputOptions);
 
 
         const errors: ValidationError[] = validateSync(this, Options.validatorOptions);
         const errors: ValidationError[] = validateSync(this, Options.validatorOptions);
 
 

+ 2 - 0
src/options/presets/Default.ts

@@ -2,6 +2,7 @@ import { TInputOptions } from '../../types/options/TInputOptions';
 
 
 import { IdentifierNamesGenerator } from '../../enums/generators/identifier-names-generators/IdentifierNamesGenerator';
 import { IdentifierNamesGenerator } from '../../enums/generators/identifier-names-generators/IdentifierNamesGenerator';
 import { ObfuscationTarget } from '../../enums/ObfuscationTarget';
 import { ObfuscationTarget } from '../../enums/ObfuscationTarget';
+import { OptionsPreset } from '../../enums/options/presets/OptionsPreset';
 import { SourceMapMode } from '../../enums/source-map/SourceMapMode';
 import { SourceMapMode } from '../../enums/source-map/SourceMapMode';
 
 
 export const DEFAULT_PRESET: TInputOptions = Object.freeze({
 export const DEFAULT_PRESET: TInputOptions = Object.freeze({
@@ -22,6 +23,7 @@ export const DEFAULT_PRESET: TInputOptions = Object.freeze({
     inputFileName: '',
     inputFileName: '',
     log: false,
     log: false,
     numbersToExpressions: false,
     numbersToExpressions: false,
+    optionsPreset: OptionsPreset.Default,
     renameGlobals: false,
     renameGlobals: false,
     renameProperties: false,
     renameProperties: false,
     reservedNames: [],
     reservedNames: [],

+ 18 - 0
src/options/presets/HighObfuscation.ts

@@ -0,0 +1,18 @@
+import { TInputOptions } from '../../types/options/TInputOptions';
+
+import { OptionsPreset } from '../../enums/options/presets/OptionsPreset';
+import { StringArrayEncoding } from '../../enums/StringArrayEncoding';
+
+import { MEDIUM_OBFUSCATION_PRESET } from './MediumObfuscation';
+
+export const HIGH_OBFUSCATION_PRESET: TInputOptions = Object.freeze({
+    ...MEDIUM_OBFUSCATION_PRESET,
+    controlFlowFlatteningThreshold: 1,
+    deadCodeInjectionThreshold: 1,
+    debugProtection: true,
+    debugProtectionInterval: true,
+    optionsPreset: OptionsPreset.HighObfuscation,
+    splitStringsChunkLength: 5,
+    stringArrayEncoding: StringArrayEncoding.Rc4,
+    stringArrayThreshold: 1
+});

+ 15 - 0
src/options/presets/LowObfuscation.ts

@@ -0,0 +1,15 @@
+import { TInputOptions } from '../../types/options/TInputOptions';
+
+import { OptionsPreset } from '../../enums/options/presets/OptionsPreset';
+
+import { DEFAULT_PRESET } from './Default';
+
+export const LOW_OBFUSCATION_PRESET: TInputOptions = Object.freeze({
+    ...DEFAULT_PRESET,
+    disableConsoleOutput: true,
+    optionsPreset: OptionsPreset.LowObfuscation,
+    rotateStringArray: true,
+    selfDefending: true,
+    shuffleStringArray: true,
+    simplify: true
+});

+ 18 - 0
src/options/presets/MediumObfuscation.ts

@@ -0,0 +1,18 @@
+import { TInputOptions } from '../../types/options/TInputOptions';
+
+import { OptionsPreset } from '../../enums/options/presets/OptionsPreset';
+import { StringArrayEncoding } from '../../enums/StringArrayEncoding';
+
+import { LOW_OBFUSCATION_PRESET } from './LowObfuscation';
+
+export const MEDIUM_OBFUSCATION_PRESET: TInputOptions = Object.freeze({
+    ...LOW_OBFUSCATION_PRESET,
+    controlFlowFlattening: true,
+    deadCodeInjection: true,
+    numbersToExpressions: true,
+    optionsPreset: OptionsPreset.MediumObfuscation,
+    splitStrings: true,
+    splitStringsChunkLength: 10,
+    stringArrayEncoding: StringArrayEncoding.Base64,
+    transformObjectKeys: true
+});

+ 1 - 1
test/functional-tests/node-transformers/converting-transformers/numbers-to-numerical-expressions-transformer/NumbersToNumericalExpressionsTransformer.spec.ts

@@ -6,7 +6,7 @@ import { JavaScriptObfuscator } from '../../../../../src/JavaScriptObfuscatorFac
 import { readFileAsString } from '../../../../helpers/readFileAsString';
 import { readFileAsString } from '../../../../helpers/readFileAsString';
 
 
 describe('NumbersToNumericalExpressionsTransformer', function () {
 describe('NumbersToNumericalExpressionsTransformer', function () {
-    this.timeout(60000);
+    this.timeout(90000);
 
 
     describe('Variant #1: base', () => {
     describe('Variant #1: base', () => {
         const initialNumber: number = -50;
         const initialNumber: number = -50;

+ 117 - 0
test/functional-tests/options/Options.spec.ts

@@ -0,0 +1,117 @@
+import 'reflect-metadata';
+
+import { ServiceIdentifiers } from '../../../src/container/ServiceIdentifiers';
+
+import { assert, use } from 'chai';
+import chaiExclude from 'chai-exclude';
+
+import { TInputOptions } from '../../../src/types/options/TInputOptions';
+
+import { IInversifyContainerFacade } from '../../../src/interfaces/container/IInversifyContainerFacade';
+import { IOptions } from '../../../src/interfaces/options/IOptions';
+
+import { OptionsPreset } from '../../../src/enums/options/presets/OptionsPreset';
+
+import { DEFAULT_PRESET } from '../../../src/options/presets/Default';
+import { LOW_OBFUSCATION_PRESET } from '../../../src/options/presets/LowObfuscation';
+import { MEDIUM_OBFUSCATION_PRESET } from '../../../src/options/presets/MediumObfuscation';
+import { HIGH_OBFUSCATION_PRESET } from '../../../src/options/presets/HighObfuscation';
+
+import { InversifyContainerFacade } from '../../../src/container/InversifyContainerFacade';
+
+use(chaiExclude);
+
+/**
+ * @param {TInputOptions} inputOptions
+ */
+function getOptions (inputOptions: TInputOptions): IOptions {
+    const inversifyContainerFacade: IInversifyContainerFacade = new InversifyContainerFacade();
+
+    inversifyContainerFacade.load('', '', inputOptions);
+
+    return inversifyContainerFacade
+        .get<IOptions>(ServiceIdentifiers.IOptions);
+}
+
+describe('Options', () => {
+    describe('Options preset', () => {
+        let options: IOptions,
+            expectedOptions: TInputOptions;
+
+        describe('Preset selection', () => {
+            describe('Default preset', () => {
+                before(() => {
+                    options = getOptions({
+                        optionsPreset: OptionsPreset.Default
+                    });
+
+                    expectedOptions = DEFAULT_PRESET;
+                });
+
+                it('should return correct options preset', () => {
+                    assert.deepEqualExcluding<IOptions | TInputOptions>(options, expectedOptions, 'seed');
+                });
+            });
+
+            describe('Low obfuscation preset', () => {
+                before(() => {
+                    options = getOptions({
+                        optionsPreset: OptionsPreset.LowObfuscation
+                    });
+
+                    expectedOptions = LOW_OBFUSCATION_PRESET;
+                });
+
+                it('should return correct options preset', () => {
+                    assert.deepEqualExcluding<IOptions | TInputOptions>(options, expectedOptions, 'seed');
+                });
+            });
+
+            describe('Medium obfuscation preset', () => {
+                before(() => {
+                    options = getOptions({
+                        optionsPreset: OptionsPreset.MediumObfuscation
+                    });
+
+                    expectedOptions = MEDIUM_OBFUSCATION_PRESET;
+                });
+
+                it('should return correct options preset', () => {
+                    assert.deepEqualExcluding<IOptions | TInputOptions>(options, expectedOptions, 'seed');
+                });
+            });
+
+            describe('High obfuscation preset', () => {
+                before(() => {
+                    options = getOptions({
+                        optionsPreset: OptionsPreset.HighObfuscation
+                    });
+
+                    expectedOptions = HIGH_OBFUSCATION_PRESET;
+                });
+
+                it('should return correct options preset', () => {
+                    assert.deepEqualExcluding<IOptions | TInputOptions>(options, expectedOptions, 'seed');
+                });
+            });
+        });
+
+        describe('Input options merge with preset', () => {
+            before(() => {
+                options = getOptions({
+                    optionsPreset: OptionsPreset.HighObfuscation,
+                    numbersToExpressions: false
+                });
+
+                expectedOptions = {
+                    ...HIGH_OBFUSCATION_PRESET,
+                    numbersToExpressions: false
+                };
+            });
+
+            it('should return merge input options with options preset', () => {
+                assert.deepEqualExcluding<IOptions | TInputOptions>(options, expectedOptions, 'seed');
+            });
+        });
+    });
+});

+ 1 - 0
test/index.spec.ts

@@ -14,6 +14,7 @@ import './unit-tests/cli/sanitizers/ArraySanitizer.spec';
 import './unit-tests/cli/sanitizers/BooleanSanitizer.spec';
 import './unit-tests/cli/sanitizers/BooleanSanitizer.spec';
 import './unit-tests/cli/sanitizers/IdentifierNamesGeneratorSanitizer.spec';
 import './unit-tests/cli/sanitizers/IdentifierNamesGeneratorSanitizer.spec';
 import './unit-tests/cli/sanitizers/ObfuscationTargetSanitizer.spec';
 import './unit-tests/cli/sanitizers/ObfuscationTargetSanitizer.spec';
+import './unit-tests/cli/sanitizers/OptionsPresetSanitizer.spec';
 import './unit-tests/cli/sanitizers/SourceMapModeSanitizer.spec';
 import './unit-tests/cli/sanitizers/SourceMapModeSanitizer.spec';
 import './unit-tests/cli/sanitizers/StringArrayEncodingSanitizer.spec';
 import './unit-tests/cli/sanitizers/StringArrayEncodingSanitizer.spec';
 import './unit-tests/cli/utils/CLIUtils.spec';
 import './unit-tests/cli/utils/CLIUtils.spec';

+ 34 - 0
test/unit-tests/cli/sanitizers/OptionsPresetSanitizer.spec.ts

@@ -0,0 +1,34 @@
+import { assert } from 'chai';
+
+import { OptionsPresetSanitizer } from '../../../../src/cli/sanitizers/OptionsPresetSanitizer';
+
+describe('OptionsPresetSanitizer', () => {
+    describe('Variant #1: valid options preset', () => {
+        const inputValue: string = 'low-obfuscation';
+        const expectedValue: string = inputValue;
+
+        let value: string;
+
+        before(() => {
+            value = OptionsPresetSanitizer(inputValue);
+        });
+
+        it('should sanitize value', () => {
+            assert.equal(value, expectedValue);
+        });
+    });
+
+    describe('Variant #2: invalid options preset', () => {
+        const inputValue: string = 'foo';
+
+        let testFunc: () => void;
+
+        before(() => {
+            testFunc = () => OptionsPresetSanitizer(inputValue);
+        });
+
+        it('should throw error', () => {
+            assert.throw(testFunc, ReferenceError);
+        });
+    });
+});

+ 102 - 62
yarn.lock

@@ -383,10 +383,10 @@
   resolved "https://registry.yarnpkg.com/@types/node/-/node-13.9.3.tgz#6356df2647de9eac569f9a52eda3480fa9e70b4d"
   resolved "https://registry.yarnpkg.com/@types/node/-/node-13.9.3.tgz#6356df2647de9eac569f9a52eda3480fa9e70b4d"
   integrity sha512-01s+ac4qerwd6RHD+mVbOEsraDHSgUaefQlEdBbUolnQFjKwCr7luvAlEwW1RFojh67u0z4OUTjPn9LEl4zIkA==
   integrity sha512-01s+ac4qerwd6RHD+mVbOEsraDHSgUaefQlEdBbUolnQFjKwCr7luvAlEwW1RFojh67u0z4OUTjPn9LEl4zIkA==
 
 
-"@types/[email protected].0":
-  version "14.6.0"
-  resolved "https://registry.yarnpkg.com/@types/node/-/node-14.6.0.tgz#7d4411bf5157339337d7cff864d9ff45f177b499"
-  integrity sha512-mikldZQitV94akrc4sCcSjtJfsTKt4p+e/s0AGscVA6XArQ9kFclP+ZiYUMnq987rc6QlYxXv/EivqlfSLxpKA==
+"@types/[email protected].2":
+  version "14.6.2"
+  resolved "https://registry.yarnpkg.com/@types/node/-/node-14.6.2.tgz#264b44c5a28dfa80198fc2f7b6d3c8a054b9491f"
+  integrity sha512-onlIwbaeqvZyniGPfdw/TEhKIh79pz66L1q06WUQqJLnAb6wbjvOtepLYTGHTqzdXgBYIE3ZdmqHDGsRsbBz7A==
 
 
 "@types/normalize-package-data@^2.4.0":
 "@types/normalize-package-data@^2.4.0":
   version "2.4.0"
   version "2.4.0"
@@ -1179,6 +1179,13 @@ caseless@~0.12.0:
   resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
   resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
   integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=
   integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=
 
 
[email protected]:
+  version "2.0.2"
+  resolved "https://registry.yarnpkg.com/chai-exclude/-/chai-exclude-2.0.2.tgz#8f2f2881ee8f3ddf4c5af0f949c063503eee30f8"
+  integrity sha512-QmNVnvdSw8Huccdjm49mKu3HtoHxvjdavgYkY0KPQ5MI5UWfbc9sX1YqRgaMPf2GGtDXPoF2ram3AeNS4945Xw==
+  dependencies:
+    fclone "^1.0.11"
+
 [email protected]:
 [email protected]:
   version "4.2.0"
   version "4.2.0"
   resolved "https://registry.yarnpkg.com/chai/-/chai-4.2.0.tgz#760aa72cf20e3795e84b12877ce0e83737aa29e5"
   resolved "https://registry.yarnpkg.com/chai/-/chai-4.2.0.tgz#760aa72cf20e3795e84b12877ce0e83737aa29e5"
@@ -1231,10 +1238,10 @@ check-error@^1.0.2:
   resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82"
   resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82"
   integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=
   integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=
 
 
-chokidar@3.3.1:
-  version "3.3.1"
-  resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.3.1.tgz#c84e5b3d18d9a4d77558fef466b1bf16bbeb3450"
-  integrity sha512-4QYCEWOcK3OJrxwvyyAOxFuhpvOVCYkr33LPfFNBjAD/w3sEzWsp2BUOkI4l9bHvWioAd0rc6NlHUOEaWkTeqg==
+chokidar@3.4.2:
+  version "3.4.2"
+  resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.4.2.tgz#38dc8e658dec3809741eb3ef7bb0a47fe424232d"
+  integrity sha512-IZHaDeBeI+sZJRX7lGcXsdzgvZqKv6sECqsbErJA4mHWfpRrD8B97kSFN4cQz6nGBGiuFia1MKR4d6c1o8Cv7A==
   dependencies:
   dependencies:
     anymatch "~3.1.1"
     anymatch "~3.1.1"
     braces "~3.0.2"
     braces "~3.0.2"
@@ -1242,7 +1249,7 @@ [email protected]:
     is-binary-path "~2.1.0"
     is-binary-path "~2.1.0"
     is-glob "~4.0.1"
     is-glob "~4.0.1"
     normalize-path "~3.0.0"
     normalize-path "~3.0.0"
-    readdirp "~3.3.0"
+    readdirp "~3.4.0"
   optionalDependencies:
   optionalDependencies:
     fsevents "~2.1.2"
     fsevents "~2.1.2"
 
 
@@ -1394,10 +1401,10 @@ combined-stream@^1.0.6, combined-stream@~1.0.6:
   dependencies:
   dependencies:
     delayed-stream "~1.0.0"
     delayed-stream "~1.0.0"
 
 
-commander@6.0.0:
-  version "6.0.0"
-  resolved "https://registry.yarnpkg.com/commander/-/commander-6.0.0.tgz#2b270da94f8fb9014455312f829a1129dbf8887e"
-  integrity sha512-s7EA+hDtTYNhuXkTlhqew4txMZVdszBmKWSPEMxGr8ru8JXR7bLUFIAtPhcSuFdJQ0ILMxnJi8GkQL0yvDy/YA==
+commander@6.1.0:
+  version "6.1.0"
+  resolved "https://registry.yarnpkg.com/commander/-/commander-6.1.0.tgz#f8d722b78103141006b66f4c7ba1e97315ba75bc"
+  integrity sha512-wl7PNrYWd2y5mp1OK/LhTlv8Ff4kQJQRXXAvF+uU/TPNiVJUxZLRYGj/B0y/lPGAVcSbJqH2Za/cvHmrPMC8mA==
 
 
 commander@^2.20.0:
 commander@^2.20.0:
   version "2.20.3"
   version "2.20.3"
@@ -1608,10 +1615,10 @@ dashdash@^1.12.0:
   dependencies:
   dependencies:
     assert-plus "^1.0.0"
     assert-plus "^1.0.0"
 
 
-debug@3.2.6:
-  version "3.2.6"
-  resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b"
-  integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==
+debug@4.1.1, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1:
+  version "4.1.1"
+  resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
+  integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==
   dependencies:
   dependencies:
     ms "^2.1.1"
     ms "^2.1.1"
 
 
@@ -1622,13 +1629,6 @@ debug@^2.2.0, debug@^2.3.3, debug@^2.6.9:
   dependencies:
   dependencies:
     ms "2.0.0"
     ms "2.0.0"
 
 
-debug@^4.0.1, debug@^4.1.0, debug@^4.1.1:
-  version "4.1.1"
-  resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
-  integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==
-  dependencies:
-    ms "^2.1.1"
-
 decamelize@^1.2.0:
 decamelize@^1.2.0:
   version "1.2.0"
   version "1.2.0"
   resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
   resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
@@ -1911,7 +1911,12 @@ es6-error@^4.0.1:
   resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d"
   resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d"
   integrity sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==
   integrity sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==
 
 
[email protected], escape-string-regexp@^1.0.5:
[email protected]:
+  version "4.0.0"
+  resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
+  integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
+
+escape-string-regexp@^1.0.5:
   version "1.0.5"
   version "1.0.5"
   resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
   resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
   integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
   integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
@@ -1971,10 +1976,10 @@ [email protected]:
     resolve "^1.17.0"
     resolve "^1.17.0"
     tsconfig-paths "^3.9.0"
     tsconfig-paths "^3.9.0"
 
 
-eslint-plugin-jsdoc@30.2.4:
-  version "30.2.4"
-  resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-30.2.4.tgz#fab63c612d10f7f622ed6ebdd6d9919fc6cc4e0e"
-  integrity sha512-7TLp+1EK/ufnzlBUuzgDiPz5k2UUIa01cFkZTvvbJr8PE0iWVDqENg0yLhqGUYaZfYRFhHpqCML8SQR94omfrg==
+eslint-plugin-jsdoc@30.3.0:
+  version "30.3.0"
+  resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-30.3.0.tgz#11f169d6ab52c56c77aa68d1458f268655e16db4"
+  integrity sha512-RvDLH26ILwX2J60P7tlNdz5IlTFeC52TEFgAC12+nz/lOx4a7n3/hP8fBPFZrQP07WA1t9ZOO8H/i7cEs2BTnA==
   dependencies:
   dependencies:
     comment-parser "^0.7.6"
     comment-parser "^0.7.6"
     debug "^4.1.1"
     debug "^4.1.1"
@@ -2174,10 +2179,10 @@ esutils@^2.0.2:
   resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64"
   resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64"
   integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==
   integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==
 
 
[email protected].6:
-  version "4.0.6"
-  resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.6.tgz#1258f6fa51b4908aadc2cd624fcd6e64f99f49d6"
-  integrity sha512-s3GJL04SQoM+gn2c14oyqxvZ3Pcq7cduSDqy3sBFXx6UPSUmgVYwQM9zwkTn9je0lrfg0gHEwR42pF3Q2dCQkQ==
[email protected].7:
+  version "4.0.7"
+  resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f"
+  integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==
 
 
 events@^3.0.0:
 events@^3.0.0:
   version "3.1.0"
   version "3.1.0"
@@ -2276,6 +2281,11 @@ fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6:
   resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
   resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
   integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=
   integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=
 
 
+fclone@^1.0.11:
+  version "1.0.11"
+  resolved "https://registry.yarnpkg.com/fclone/-/fclone-1.0.11.tgz#10e85da38bfea7fc599341c296ee1d77266ee640"
+  integrity sha1-EOhdo4v+p/xZk0HClu4ddyZu5kA=
+
 figgy-pudding@^3.5.1:
 figgy-pudding@^3.5.1:
   version "3.5.1"
   version "3.5.1"
   resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.1.tgz#862470112901c727a0e495a80744bd5baa1d6790"
   resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.1.tgz#862470112901c727a0e495a80744bd5baa1d6790"
@@ -2328,12 +2338,12 @@ find-cache-dir@^3.2.0:
     make-dir "^3.0.2"
     make-dir "^3.0.2"
     pkg-dir "^4.1.0"
     pkg-dir "^4.1.0"
 
 
-find-up@4.1.0, find-up@^4.0.0, find-up@^4.1.0:
-  version "4.1.0"
-  resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19"
-  integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==
+find-up@5.0.0:
+  version "5.0.0"
+  resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc"
+  integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==
   dependencies:
   dependencies:
-    locate-path "^5.0.0"
+    locate-path "^6.0.0"
     path-exists "^4.0.0"
     path-exists "^4.0.0"
 
 
 find-up@^2.0.0, find-up@^2.1.0:
 find-up@^2.0.0, find-up@^2.1.0:
@@ -2350,6 +2360,14 @@ find-up@^3.0.0:
   dependencies:
   dependencies:
     locate-path "^3.0.0"
     locate-path "^3.0.0"
 
 
+find-up@^4.0.0, find-up@^4.1.0:
+  version "4.1.0"
+  resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19"
+  integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==
+  dependencies:
+    locate-path "^5.0.0"
+    path-exists "^4.0.0"
+
 findup-sync@^3.0.0:
 findup-sync@^3.0.0:
   version "3.0.0"
   version "3.0.0"
   resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-3.0.0.tgz#17b108f9ee512dfb7a5c7f3c8b27ea9e1a9c08d1"
   resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-3.0.0.tgz#17b108f9ee512dfb7a5c7f3c8b27ea9e1a9c08d1"
@@ -3209,7 +3227,15 @@ js-tokens@^4.0.0:
   resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
   resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
   integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
   integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
 
 
[email protected], js-yaml@^3.13.1:
[email protected]:
+  version "3.14.0"
+  resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.0.tgz#a7a34170f26a21bb162424d8adacb4113a69e482"
+  integrity sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==
+  dependencies:
+    argparse "^1.0.7"
+    esprima "^4.0.0"
+
+js-yaml@^3.13.1:
   version "3.13.1"
   version "3.13.1"
   resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847"
   resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847"
   integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==
   integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==
@@ -3392,6 +3418,13 @@ locate-path@^5.0.0:
   dependencies:
   dependencies:
     p-locate "^4.1.0"
     p-locate "^4.1.0"
 
 
+locate-path@^6.0.0:
+  version "6.0.0"
+  resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286"
+  integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==
+  dependencies:
+    p-locate "^5.0.0"
+
 lodash.flattendeep@^4.4.0:
 lodash.flattendeep@^4.4.0:
   version "4.4.0"
   version "4.4.0"
   resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2"
   resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2"
@@ -3422,12 +3455,12 @@ log-driver@^1.2.7:
   resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8"
   resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8"
   integrity sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==
   integrity sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==
 
 
-log-symbols@3.0.0:
-  version "3.0.0"
-  resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-3.0.0.tgz#f3a08516a5dea893336a7dee14d18a1cfdab77c4"
-  integrity sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==
+log-symbols@4.0.0:
+  version "4.0.0"
+  resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.0.0.tgz#69b3cc46d20f448eccdb75ea1fa733d9e821c920"
+  integrity sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==
   dependencies:
   dependencies:
-    chalk "^2.4.2"
+    chalk "^4.0.0"
 
 
 lru-cache@^4.0.1:
 lru-cache@^4.0.1:
   version "4.1.5"
   version "4.1.5"
@@ -3629,23 +3662,23 @@ mkdirp@^0.5.3:
   dependencies:
   dependencies:
     minimist "^1.2.5"
     minimist "^1.2.5"
 
 
[email protected].1:
-  version "8.1.1"
-  resolved "https://registry.yarnpkg.com/mocha/-/mocha-8.1.1.tgz#1de1ba4e9a2c955d96b84e469d7540848223592d"
-  integrity sha512-p7FuGlYH8t7gaiodlFreseLxEmxTgvyG9RgPHODFPySNhwUehu8NIb0vdSt3WFckSneswZ0Un5typYcWElk7HQ==
[email protected].3:
+  version "8.1.3"
+  resolved "https://registry.yarnpkg.com/mocha/-/mocha-8.1.3.tgz#5e93f873e35dfdd69617ea75f9c68c2ca61c2ac5"
+  integrity sha512-ZbaYib4hT4PpF4bdSO2DohooKXIn4lDeiYqB+vTmCdr6l2woW0b6H3pf5x4sM5nwQMru9RvjjHYWVGltR50ZBw==
   dependencies:
   dependencies:
     ansi-colors "4.1.1"
     ansi-colors "4.1.1"
     browser-stdout "1.3.1"
     browser-stdout "1.3.1"
-    chokidar "3.3.1"
-    debug "3.2.6"
+    chokidar "3.4.2"
+    debug "4.1.1"
     diff "4.0.2"
     diff "4.0.2"
-    escape-string-regexp "1.0.5"
-    find-up "4.1.0"
+    escape-string-regexp "4.0.0"
+    find-up "5.0.0"
     glob "7.1.6"
     glob "7.1.6"
     growl "1.10.5"
     growl "1.10.5"
     he "1.2.0"
     he "1.2.0"
-    js-yaml "3.13.1"
-    log-symbols "3.0.0"
+    js-yaml "3.14.0"
+    log-symbols "4.0.0"
     minimatch "3.0.4"
     minimatch "3.0.4"
     ms "2.1.2"
     ms "2.1.2"
     object.assign "4.1.0"
     object.assign "4.1.0"
@@ -3976,6 +4009,13 @@ p-limit@^2.0.0, p-limit@^2.2.0:
   dependencies:
   dependencies:
     p-try "^2.0.0"
     p-try "^2.0.0"
 
 
+p-limit@^3.0.2:
+  version "3.0.2"
+  resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.0.2.tgz#1664e010af3cadc681baafd3e2a437be7b0fb5fe"
+  integrity sha512-iwqZSOoWIW+Ew4kAGUlN16J4M7OB3ysMLSZtnhmqx7njIHFPlxWBX8xo3lVTyFVq6mI/lL9qt2IsN1sHwaxJkg==
+  dependencies:
+    p-try "^2.0.0"
+
 p-locate@^2.0.0:
 p-locate@^2.0.0:
   version "2.0.0"
   version "2.0.0"
   resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43"
   resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43"
@@ -3997,6 +4037,13 @@ p-locate@^4.1.0:
   dependencies:
   dependencies:
     p-limit "^2.2.0"
     p-limit "^2.2.0"
 
 
+p-locate@^5.0.0:
+  version "5.0.0"
+  resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834"
+  integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==
+  dependencies:
+    p-limit "^3.0.2"
+
 p-map@^3.0.0:
 p-map@^3.0.0:
   version "3.0.0"
   version "3.0.0"
   resolved "https://registry.yarnpkg.com/p-map/-/p-map-3.0.0.tgz#d704d9af8a2ba684e2600d9a215983d4141a979d"
   resolved "https://registry.yarnpkg.com/p-map/-/p-map-3.0.0.tgz#d704d9af8a2ba684e2600d9a215983d4141a979d"
@@ -4164,7 +4211,7 @@ performance-now@^2.1.0:
   resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
   resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
   integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=
   integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=
 
 
-picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.0.7, picomatch@^2.2.1:
+picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.2.1:
   version "2.2.2"
   version "2.2.2"
   resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad"
   resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad"
   integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==
   integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==
@@ -4427,13 +4474,6 @@ readdirp@^2.2.1:
     micromatch "^3.1.10"
     micromatch "^3.1.10"
     readable-stream "^2.0.2"
     readable-stream "^2.0.2"
 
 
-readdirp@~3.3.0:
-  version "3.3.0"
-  resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.3.0.tgz#984458d13a1e42e2e9f5841b129e162f369aff17"
-  integrity sha512-zz0pAkSPOXXm1viEwygWIPSPkcBYjW1xU5j/JBh5t9bGCJwa6f9+BJa6VaB2g+b55yVrmXzqkyLf4xaWYM0IkQ==
-  dependencies:
-    picomatch "^2.0.7"
-
 readdirp@~3.4.0:
 readdirp@~3.4.0:
   version "3.4.0"
   version "3.4.0"
   resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.4.0.tgz#9fdccdf9e9155805449221ac645e8303ab5b9ada"
   resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.4.0.tgz#9fdccdf9e9155805449221ac645e8303ab5b9ada"

Some files were not shown because too many files changed in this diff