Skip to content

Commit

Permalink
Dependencies update, acorn update
Browse files Browse the repository at this point in the history
  • Loading branch information
sanex3339 committed May 9, 2020
1 parent fa1616e commit d0d4bc0
Show file tree
Hide file tree
Showing 21 changed files with 258 additions and 204 deletions.
14 changes: 7 additions & 7 deletions dist/index.browser.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.cli.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
"dependencies": {
"@gradecam/tsenum": "1.2.0",
"@nuxtjs/opencollective": "0.2.2",
"acorn": "7.1.1",
"acorn-import-meta": "1.1.0",
"acorn": "7.2.0",
"chalk": "4.0.0",
"chance": "1.1.4",
"class-validator": "0.12.2",
Expand All @@ -42,7 +41,7 @@
"reflect-metadata": "0.1.13",
"source-map-support": "0.5.19",
"string-template": "1.0.0",
"tslib": "1.11.1"
"tslib": "1.11.2"
},
"devDependencies": {
"@types/chai": "4.2.11",
Expand All @@ -55,18 +54,18 @@
"@types/mkdirp": "1.0.0",
"@types/mocha": "7.0.2",
"@types/multimatch": "4.0.0",
"@types/node": "13.13.4",
"@types/node": "13.13.5",
"@types/rimraf": "3.0.0",
"@types/sinon": "9.0.0",
"@types/string-template": "1.0.2",
"@types/webpack-env": "1.15.2",
"@typescript-eslint/eslint-plugin": "2.30.0",
"@typescript-eslint/parser": "2.30.0",
"@typescript-eslint/eslint-plugin": "2.31.0",
"@typescript-eslint/parser": "2.31.0",
"chai": "4.2.0",
"coveralls": "3.1.0",
"eslint": "6.8.0",
"eslint": "7.0.0",
"eslint-plugin-import": "2.20.2",
"eslint-plugin-jsdoc": "24.0.2",
"eslint-plugin-jsdoc": "25.0.1",
"eslint-plugin-no-null": "1.0.2",
"eslint-plugin-prefer-arrow": "1.2.1",
"eslint-plugin-unicorn": "19.0.1",
Expand All @@ -79,7 +78,7 @@
"rimraf": "3.0.2",
"sinon": "9.0.2",
"threads": "1.4.1",
"ts-loader": "7.0.2",
"ts-loader": "7.0.3",
"ts-node": "6.1.0",
"typescript": "3.8.3",
"webpack": "4.43.0",
Expand Down
2 changes: 0 additions & 2 deletions src/ASTParserFacade.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as acorn from 'acorn';
import acornImportMeta from 'acorn-import-meta';
import * as ESTree from 'estree';
import chalk, { Chalk } from 'chalk';

Expand Down Expand Up @@ -71,7 +70,6 @@ export class ASTParserFacade {
};

const program: ESTree.Program = <any>acorn
.Parser.extend(acornImportMeta)
.parse(sourceCode, config);

if (comments.length) {
Expand Down
20 changes: 10 additions & 10 deletions src/cli/JavaScriptObfuscatorCLI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,6 @@ export class JavaScriptObfuscatorCLI implements IInitializable {
*/
public static readonly obfuscatedFilePrefix: string = '-obfuscated';

/**
* @type {string[]}
*/
private readonly arguments: string[];

/**
* @type {string[]}
*/
private readonly rawArguments: string[];

/**
* @type {commander.CommanderStatic}
*/
Expand Down Expand Up @@ -87,6 +77,16 @@ export class JavaScriptObfuscatorCLI implements IInitializable {
@initializable()
private obfuscatedCodeWriter!: ObfuscatedCodeWriter;

/**
* @type {string[]}
*/
private readonly arguments: string[];

/**
* @type {string[]}
*/
private readonly rawArguments: string[];

/**
* @param {string[]} argv
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ import { NodeGuards } from '../../../node/NodeGuards';

@injectable()
export class ConsoleOutputCodeHelperGroup extends AbstractCustomCodeHelperGroup {
/**
* @type {ObfuscationEvent}
*/
protected readonly appendEvent: ObfuscationEvent = ObfuscationEvent.BeforeObfuscation;

/**
* @type {Map<CustomCodeHelper, ICustomCodeHelper>}
*/
@initializable()
protected customCodeHelpers!: Map <CustomCodeHelper, ICustomCodeHelper>;

/**
* @type {ObfuscationEvent}
*/
protected readonly appendEvent: ObfuscationEvent = ObfuscationEvent.BeforeObfuscation;

/**
* @type {TCustomCodeHelperFactory}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ import { NodeLexicalScopeUtils } from '../../../node/NodeLexicalScopeUtils';

@injectable()
export class DebugProtectionCodeHelperGroup extends AbstractCustomCodeHelperGroup {
/**
* @type {ObfuscationEvent}
*/
protected readonly appendEvent: ObfuscationEvent = ObfuscationEvent.BeforeObfuscation;

/**
* @type {Map<CustomCodeHelper, ICustomCodeHelper>}
*/
@initializable()
protected customCodeHelpers!: Map <CustomCodeHelper, ICustomCodeHelper>;

/**
* @type {ObfuscationEvent}
*/
protected readonly appendEvent: ObfuscationEvent = ObfuscationEvent.BeforeObfuscation;

/**
* @type {TCustomCodeHelperFactory}
*/
Expand Down
10 changes: 5 additions & 5 deletions src/custom-code-helpers/domain-lock/DomainLockCodeHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ export class DomainLockCodeHelper extends AbstractCustomCodeHelper {
@initializable()
private callsControllerFunctionName!: string;

/**
* @type {ICryptUtils}
*/
private readonly cryptUtils: ICryptUtils;

/**
* @type {string}
*/
@initializable()
private domainLockFunctionName!: string;

/**
* @type {ICryptUtils}
*/
private readonly cryptUtils: ICryptUtils;

/**
* @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory
* @param {ICustomCodeHelperFormatter} customCodeHelperFormatter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ import { NodeGuards } from '../../../node/NodeGuards';

@injectable()
export class DomainLockCustomCodeHelperGroup extends AbstractCustomCodeHelperGroup {
/**
* @type {ObfuscationEvent}
*/
protected readonly appendEvent: ObfuscationEvent = ObfuscationEvent.BeforeObfuscation;

/**
* @type {Map<CustomCodeHelper, ICustomCodeHelper>}
*/
@initializable()
protected customCodeHelpers!: Map <CustomCodeHelper, ICustomCodeHelper>;

/**
* @type {ObfuscationEvent}
*/
protected readonly appendEvent: ObfuscationEvent = ObfuscationEvent.BeforeObfuscation;

/**
* @type {TCustomCodeHelperFactory}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ import { NodeUtils } from '../../node/NodeUtils';

@injectable()
export class SelfDefendingUnicodeCodeHelper extends AbstractCustomCodeHelper {
/**
* @type {IEscapeSequenceEncoder}
*/
private readonly escapeSequenceEncoder: IEscapeSequenceEncoder;

/**
* @type {string}
*/
Expand All @@ -36,6 +31,11 @@ export class SelfDefendingUnicodeCodeHelper extends AbstractCustomCodeHelper {
@initializable()
private selfDefendingFunctionName!: string;

/**
* @type {IEscapeSequenceEncoder}
*/
private readonly escapeSequenceEncoder: IEscapeSequenceEncoder;

/**
* @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory
* @param {ICustomCodeHelperFormatter} customCodeHelperFormatter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ import { SelfDefendingUnicodeCodeHelper } from '../SelfDefendingUnicodeCodeHelpe

@injectable()
export class SelfDefendingCodeHelperGroup extends AbstractCustomCodeHelperGroup {
/**
* @type {ObfuscationEvent}
*/
protected appendEvent: ObfuscationEvent = ObfuscationEvent.BeforeObfuscation;

/**
* @type {Map<CustomCodeHelper, ICustomCodeHelper>}
*/
@initializable()
protected customCodeHelpers!: Map <CustomCodeHelper, ICustomCodeHelper>;

/**
* @type {ObfuscationEvent}
*/
protected appendEvent: ObfuscationEvent = ObfuscationEvent.BeforeObfuscation;

/**
* @type {TCustomCodeHelperFactory}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ import { NodeUtils } from '../../node/NodeUtils';

@injectable()
export class StringArrayCallsWrapperCodeHelper extends AbstractCustomCodeHelper {
/**
* @type {IEscapeSequenceEncoder}
*/
private readonly escapeSequenceEncoder: IEscapeSequenceEncoder;

/**
* @type {string}
*/
Expand All @@ -45,6 +40,11 @@ export class StringArrayCallsWrapperCodeHelper extends AbstractCustomCodeHelper
@initializable()
private stringArrayCallsWrapperName!: string;

/**
* @type {IEscapeSequenceEncoder}
*/
private readonly escapeSequenceEncoder: IEscapeSequenceEncoder;

/**
* @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory
* @param {ICustomCodeHelperFormatter} customCodeHelperFormatter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ import { NumberUtils } from '../../utils/NumberUtils';

@injectable()
export class StringArrayRotateFunctionCodeHelper extends AbstractCustomCodeHelper {
/**
* @type {IEscapeSequenceEncoder}
*/
private readonly escapeSequenceEncoder: IEscapeSequenceEncoder;

/**
* @type {string}
*/
Expand All @@ -38,6 +33,11 @@ export class StringArrayRotateFunctionCodeHelper extends AbstractCustomCodeHelpe
@initializable()
private stringArrayRotationAmount!: number;

/**
* @type {IEscapeSequenceEncoder}
*/
private readonly escapeSequenceEncoder: IEscapeSequenceEncoder;

/**
* @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory
* @param {ICustomCodeHelperFormatter} customCodeHelperFormatter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ import { StringArrayRotateFunctionCodeHelper } from '../StringArrayRotateFunctio

@injectable()
export class StringArrayCodeHelperGroup extends AbstractCustomCodeHelperGroup {
/**
* @type {ObfuscationEvent}
*/
protected appendEvent: ObfuscationEvent = ObfuscationEvent.AfterObfuscation;

/**
* @type {Map<CustomCodeHelper, ICustomCodeHelper>}
*/
@initializable()
protected customCodeHelpers!: Map <CustomCodeHelper, ICustomCodeHelper>;

/**
* @type {ObfuscationEvent}
*/
protected appendEvent: ObfuscationEvent = ObfuscationEvent.AfterObfuscation;

/**
* @type {TCustomCodeHelperFactory}
*/
Expand Down
10 changes: 5 additions & 5 deletions src/options/Options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,6 @@ export class Options implements IOptions {
@IsBoolean()
public readonly rotateStringArray!: boolean;

/**
* @type {string | number}
*/
public readonly seed!: string | number;

/**
* @type {boolean}
*/
Expand Down Expand Up @@ -281,6 +276,11 @@ export class Options implements IOptions {
@IsBoolean()
public readonly unicodeEscapeSequence!: boolean;

/**
* @type {string | number}
*/
public readonly seed!: string | number;

/**
* @param {TInputOptions} inputOptions
* @param {IOptionsNormalizer} optionsNormalizer
Expand Down
16 changes: 8 additions & 8 deletions src/source-code/ObfuscatedCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@ import { IOptions } from '../interfaces/options/IOptions';
@injectable()
export class ObfuscatedCode implements IObfuscatedCode {
/**
* @type {ICryptUtils}
* @type {string}
*/
private readonly cryptUtils: ICryptUtils;
@initializable()
private obfuscatedCode!: string;

/**
* @type {string}
*/
@initializable()
private obfuscatedCode!: string;
private sourceMap!: string;

/**
* @type {IOptions}
* @type {ICryptUtils}
*/
private readonly options: IOptions;
private readonly cryptUtils: ICryptUtils;

/**
* @type {string}
* @type {IOptions}
*/
@initializable()
private sourceMap!: string;
private readonly options: IOptions;

public constructor (
@inject(ServiceIdentifiers.ICryptUtils) cryptUtils: ICryptUtils,
Expand Down
Loading

0 comments on commit d0d4bc0

Please sign in to comment.