Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .babelrc

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ $ npm install --save-dev javascript-obfuscator
From CDN:

```html
<script src="https://cdn.jsdelivr.net/npm/javascript-obfuscator/dist/index.browser.js"/>
<script src="https://cdn.jsdelivr.net/npm/javascript-obfuscator/dist/index.browser.js"></script>
```

From `node_modules`:

```html
<script src="./node_modules/javascript-obfuscator/dist/index.browser.js"/>
<script src="./node_modules/javascript-obfuscator/dist/index.browser.js"></script>
```

## Usage
Expand Down
8 changes: 4 additions & 4 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.

6 changes: 0 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
},
"types": "index.d.ts",
"dependencies": {
"@babel/runtime": "7.7.4",
"chalk": "3.0.0",
"chance": "1.1.3",
"class-validator": "0.11.0",
Expand All @@ -42,10 +41,6 @@
"tslib": "1.10.0"
},
"devDependencies": {
"@babel/cli": "7.7.4",
"@babel/core": "7.7.4",
"@babel/plugin-transform-runtime": "7.7.4",
"@babel/preset-env": "7.7.4",
"@types/chai": "4.2.5",
"@types/chance": "1.0.7",
"@types/escodegen": "0.0.6",
Expand All @@ -61,7 +56,6 @@
"@types/string-template": "1.0.2",
"@types/webpack-env": "1.14.1",
"awesome-typescript-loader": "5.2.1",
"babel-loader": "8.0.6",
"chai": "4.2.0",
"coveralls": "3.0.9",
"istanbul": "1.1.0-alpha.1",
Expand Down
3 changes: 1 addition & 2 deletions scripts/test-compile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash

$(yarn bin)/tsc -p test/tsconfig.test.json &&
$(yarn bin)/babel test-tmp --out-dir test-tmp --source-maps inline &&
$(yarn bin)/tsc -p test/tsconfig.test.json --outDir test-tmp &&
rsync -a --prune-empty-dirs --include '*/' --include '*.js' --include '*.json' --exclude '*' test/ test-tmp/test/
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export class DictionaryIdentifierNamesGenerator extends AbstractIdentifierNamesG
private readonly arrayUtils: IArrayUtils;

/**
* @type {string[]}
* @type {Set<string>}
*/
private identifierNames: string[] = [];
private identifierNamesSet: Set<string>;

/**
* @type {IterableIterator<string>}
Expand All @@ -37,8 +37,8 @@ export class DictionaryIdentifierNamesGenerator extends AbstractIdentifierNamesG
super(randomGenerator, options);

this.arrayUtils = arrayUtils;
this.identifierNames = this.getInitialIdentifierNames(this.options.identifiersDictionary);
this.identifiersIterator = this.identifierNames.values();
this.identifierNamesSet = new Set(this.getInitialIdentifierNames(this.options.identifiersDictionary));
this.identifiersIterator = this.identifierNamesSet.values();
}

/**
Expand Down Expand Up @@ -68,7 +68,7 @@ export class DictionaryIdentifierNamesGenerator extends AbstractIdentifierNamesG
}

public generate (): string {
if (!this.identifierNames.length) {
if (!this.identifierNamesSet.size) {
throw new Error('Too many identifiers in the code, add more words to identifiers dictionary');
}

Expand All @@ -78,8 +78,8 @@ export class DictionaryIdentifierNamesGenerator extends AbstractIdentifierNamesG
return iteratorResult.value;
}

this.identifierNames = this.getIncrementedIdentifierNames(this.identifierNames);
this.identifiersIterator = this.identifierNames.values();
this.identifierNamesSet = new Set(this.getIncrementedIdentifierNames([...this.identifierNamesSet]));
this.identifiersIterator = this.identifierNamesSet.values();

return this.generate();
}
Expand Down
2 changes: 0 additions & 2 deletions webpack/webpack.browser.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ module.exports = {
loader: 'awesome-typescript-loader',
query: {
configFileName: 'src/tsconfig.browser.json',
useBabel: true,
babelCore: '@babel/core',
useCache: true,
forceIsolatedModules: true
}
Expand Down
2 changes: 0 additions & 2 deletions webpack/webpack.node.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ module.exports = {
loader: 'awesome-typescript-loader',
query: {
configFileName: 'src/tsconfig.node.json',
useBabel: true,
babelCore: '@babel/core',
useCache: true,
forceIsolatedModules: true
}
Expand Down
Loading