Code coverage report for src/JavaScriptObfuscator.ts

# All files / src JavaScriptObfuscator.ts

100% Statements 8/8
100% Branches 4/4
100% Functions 0/0
100% Lines 8/8

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31

    1x
    1x

    1x

    2619x
    2619x

    2619x

    2619x

    10x

     import { IObfuscationResult } from './interfaces/IObfuscationResult';
    import { IObfuscatorOptions } from './interfaces/IObfuscatorOptions';

    import { JavaScriptObfuscatorCLI } from './cli/JavaScriptObfuscatorCLI';
    import { JavaScriptObfuscatorInternal } from './JavaScriptObfuscatorInternal';

    export class JavaScriptObfuscator {
        /**
         * @param sourceCode
         * @param obfuscatorOptions
         * @returns {string}
         */
        public static obfuscate (sourceCode: string, obfuscatorOptions: IObfuscatorOptions = {}): IObfuscationResult {
            let javaScriptObfuscator: JavaScriptObfuscatorInternal = new JavaScriptObfuscatorInternal(
                sourceCode,
                obfuscatorOptions
            );

            javaScriptObfuscator.obfuscate();

            return javaScriptObfuscator.getObfuscationResult();
        }

        /**
         * @param argv
         */
        public static runCLI (argv: string[]): void {
            new JavaScriptObfuscatorCLI(argv).run();
        }
    }