Selaa lähdekoodia

Changed Replacer on ObfuscatingReplacer. Changed ObfuscatingReplacer return type from string on ESTree.Node

sanex3339 8 vuotta sitten
vanhempi
commit
568bb805fb
24 muutettua tiedostoa jossa 655 lisäystä ja 631 poistoa
  1. 314 368
      dist/index.js
  2. 5 5
      package.json
  3. 14 14
      src/container/modules/node-transformers/ObfuscatingTransformersModule.ts
  4. 11 0
      src/interfaces/node-transformers/IIdentifierReplacer.d.ts
  5. 9 0
      src/interfaces/node-transformers/IObfuscatingReplacer.d.ts
  6. 0 7
      src/interfaces/node-transformers/IObfuscationReplacer.d.ts
  7. 0 9
      src/interfaces/node-transformers/IObfuscationReplacerWithStorage.d.ts
  8. 13 10
      src/node-transformers/obfuscating-transformers/CatchClauseTransformer.ts
  9. 15 11
      src/node-transformers/obfuscating-transformers/FunctionDeclarationTransformer.ts
  10. 18 13
      src/node-transformers/obfuscating-transformers/FunctionTransformer.ts
  11. 7 7
      src/node-transformers/obfuscating-transformers/LabeledStatementTransformer.ts
  12. 7 23
      src/node-transformers/obfuscating-transformers/LiteralTransformer.ts
  13. 15 11
      src/node-transformers/obfuscating-transformers/VariableDeclarationTransformer.ts
  14. 6 4
      src/node-transformers/obfuscating-transformers/obfuscating-replacers/AbstractObfuscatingReplacer.ts
  15. 51 0
      src/node-transformers/obfuscating-transformers/obfuscating-replacers/BooleanLiteralReplacer.ts
  16. 11 8
      src/node-transformers/obfuscating-transformers/obfuscating-replacers/IdentifierReplacer.ts
  17. 49 0
      src/node-transformers/obfuscating-transformers/obfuscating-replacers/NumberLiteralReplacer.ts
  18. 55 24
      src/node-transformers/obfuscating-transformers/obfuscating-replacers/StringLiteralReplacer.ts
  19. 0 28
      src/node-transformers/obfuscating-transformers/replacers/BooleanLiteralReplacer.ts
  20. 0 46
      src/node-transformers/obfuscating-transformers/replacers/NumberLiteralReplacer.ts
  21. 19 3
      src/node/Nodes.ts
  22. 2 2
      src/types/container/TObfuscationReplacerFactory.d.ts
  23. 1 1
      test/functional-tests/node-transformers/obfuscating-transformers/literal-transformer/LiteralTransformer.spec.ts
  24. 33 37
      yarn.lock

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 314 - 368
dist/index.js


+ 5 - 5
package.json

@@ -43,7 +43,7 @@
     "@types/estree": "0.0.35",
     "@types/mkdirp": "0.3.29",
     "@types/mocha": "2.2.41",
-    "@types/node": "7.0.18",
+    "@types/node": "7.0.22",
     "@types/sinon": "2.2.2",
     "@types/string-template": "1.0.2",
     "awesome-typescript-loader": "3.1.3",
@@ -56,12 +56,12 @@
     "istanbul": "1.1.0-alpha.1",
     "mocha": "3.4.1",
     "pre-commit": "^1.2.2",
-    "sinon": "2.2.0",
+    "sinon": "2.3.1",
     "ts-node": "3.0.4",
-    "tslint": "5.2.0",
+    "tslint": "5.3.2",
     "tslint-loader": "3.5.3",
-    "typescript": "2.3.2",
-    "webpack": "2.5.1",
+    "typescript": "2.3.3",
+    "webpack": "2.6.0",
     "webpack-node-externals": "1.6.0"
   },
   "repository": {

+ 14 - 14
src/container/modules/node-transformers/ObfuscatingTransformersModule.ts

@@ -1,42 +1,42 @@
 import { ContainerModule, interfaces } from 'inversify';
 import { ServiceIdentifiers } from '../../ServiceIdentifiers';
 
-import { IObfuscationReplacer } from '../../../interfaces/node-transformers/IObfuscationReplacer';
+import { IObfuscatingReplacer } from '../../../interfaces/node-transformers/IObfuscatingReplacer';
 
 import { ObfuscationReplacers } from '../../../enums/container/ObfuscationReplacers';
 
-import { BooleanLiteralReplacer } from '../../../node-transformers/obfuscating-transformers/replacers/BooleanLiteralReplacer';
-import { IdentifierReplacer } from '../../../node-transformers/obfuscating-transformers/replacers/IdentifierReplacer';
-import { NumberLiteralReplacer } from '../../../node-transformers/obfuscating-transformers/replacers/NumberLiteralReplacer';
-import { StringLiteralReplacer } from '../../../node-transformers/obfuscating-transformers/replacers/StringLiteralReplacer';
+import { BooleanLiteralReplacer } from '../../../node-transformers/obfuscating-transformers/obfuscating-replacers/BooleanLiteralReplacer';
+import { IdentifierReplacer } from '../../../node-transformers/obfuscating-transformers/obfuscating-replacers/IdentifierReplacer';
+import { NumberLiteralReplacer } from '../../../node-transformers/obfuscating-transformers/obfuscating-replacers/NumberLiteralReplacer';
+import { StringLiteralReplacer } from '../../../node-transformers/obfuscating-transformers/obfuscating-replacers/StringLiteralReplacer';
 
 export const obfuscatingTransformersModule: interfaces.ContainerModule = new ContainerModule((bind: interfaces.Bind) => {
-    bind<IObfuscationReplacer>(ServiceIdentifiers.IObfuscationReplacer)
+    bind<IObfuscatingReplacer>(ServiceIdentifiers.IObfuscationReplacer)
         .to(BooleanLiteralReplacer)
         .whenTargetNamed(ObfuscationReplacers.BooleanReplacer);
 
-    bind<IObfuscationReplacer>(ServiceIdentifiers.IObfuscationReplacer)
+    bind<IObfuscatingReplacer>(ServiceIdentifiers.IObfuscationReplacer)
         .to(IdentifierReplacer)
         .whenTargetNamed(ObfuscationReplacers.IdentifierReplacer);
 
-    bind<IObfuscationReplacer>(ServiceIdentifiers.IObfuscationReplacer)
+    bind<IObfuscatingReplacer>(ServiceIdentifiers.IObfuscationReplacer)
         .to(NumberLiteralReplacer)
         .whenTargetNamed(ObfuscationReplacers.NumberLiteralReplacer);
 
-    bind<IObfuscationReplacer>(ServiceIdentifiers.IObfuscationReplacer)
+    bind<IObfuscatingReplacer>(ServiceIdentifiers.IObfuscationReplacer)
         .to(StringLiteralReplacer)
         .whenTargetNamed(ObfuscationReplacers.StringLiteralReplacer);
 
-    bind<IObfuscationReplacer>(ServiceIdentifiers.Factory__IObfuscationReplacer)
-        .toFactory<IObfuscationReplacer>((context: interfaces.Context) => {
-            const cache: Map <ObfuscationReplacers, IObfuscationReplacer> = new Map();
+    bind<IObfuscatingReplacer>(ServiceIdentifiers.Factory__IObfuscationReplacer)
+        .toFactory<IObfuscatingReplacer>((context: interfaces.Context) => {
+            const cache: Map <ObfuscationReplacers, IObfuscatingReplacer> = new Map();
 
             return (replacerName: ObfuscationReplacers) => {
                 if (cache.has(replacerName)) {
-                    return <IObfuscationReplacer>cache.get(replacerName);
+                    return <IObfuscatingReplacer>cache.get(replacerName);
                 }
 
-                const obfuscationReplacer: IObfuscationReplacer = context.container.getNamed<IObfuscationReplacer>(
+                const obfuscationReplacer: IObfuscatingReplacer = context.container.getNamed<IObfuscatingReplacer>(
                     ServiceIdentifiers.IObfuscationReplacer,
                     replacerName
                 );

+ 11 - 0
src/interfaces/node-transformers/IIdentifierReplacer.d.ts

@@ -0,0 +1,11 @@
+import * as ESTree from 'estree';
+
+import { IObfuscatingReplacer } from './IObfuscatingReplacer';
+
+export interface IIdentifierReplacer extends IObfuscatingReplacer <ESTree.Identifier> {
+    /**
+     * @param nodeValue
+     * @param nodeIdentifier
+     */
+    storeNames (nodeValue: any, nodeIdentifier: number): void;
+}

+ 9 - 0
src/interfaces/node-transformers/IObfuscatingReplacer.d.ts

@@ -0,0 +1,9 @@
+import * as ESTree from 'estree';
+
+export interface IObfuscatingReplacer <T = ESTree.Node> {
+    /**
+     * @param nodeValue
+     * @param nodeIdentifier
+     */
+    replace (nodeValue: any, nodeIdentifier?: number): T;
+}

+ 0 - 7
src/interfaces/node-transformers/IObfuscationReplacer.d.ts

@@ -1,7 +0,0 @@
-export interface IObfuscationReplacer {
-    /**
-     * @param nodeValue
-     * @param nodeIdentifier
-     */
-    replace (nodeValue: any, nodeIdentifier?: number): string;
-}

+ 0 - 9
src/interfaces/node-transformers/IObfuscationReplacerWithStorage.d.ts

@@ -1,9 +0,0 @@
-import { IObfuscationReplacer } from './IObfuscationReplacer';
-
-export interface IObfuscationReplacerWithStorage extends IObfuscationReplacer {
-    /**
-     * @param nodeValue
-     * @param nodeIdentifier
-     */
-    storeNames (nodeValue: any, nodeIdentifier: number): void;
-}

+ 13 - 10
src/node-transformers/obfuscating-transformers/CatchClauseTransformer.ts

@@ -7,7 +7,7 @@ import * as ESTree from 'estree';
 import { TObfuscationReplacerFactory } from '../../types/container/TObfuscationReplacerFactory';
 
 import { IOptions } from '../../interfaces/options/IOptions';
-import { IObfuscationReplacerWithStorage } from '../../interfaces/node-transformers/IObfuscationReplacerWithStorage';
+import { IIdentifierReplacer } from '../../interfaces/node-transformers/IIdentifierReplacer';
 import { IVisitor } from '../../interfaces/IVisitor';
 
 import { ObfuscationReplacers } from '../../enums/container/ObfuscationReplacers';
@@ -26,21 +26,21 @@ import { Node } from '../../node/Node';
 @injectable()
 export class CatchClauseTransformer extends AbstractNodeTransformer {
     /**
-     * @type {IObfuscationReplacerWithStorage}
+     * @type {IIdentifierReplacer}
      */
-    private readonly identifierReplacer: IObfuscationReplacerWithStorage;
+    private readonly identifierReplacer: IIdentifierReplacer;
 
     /**
-     * @param obfuscationReplacerFactory
+     * @param obfuscatingReplacerFactory
      * @param options
      */
     constructor (
-        @inject(ServiceIdentifiers.Factory__IObfuscationReplacer) obfuscationReplacerFactory: TObfuscationReplacerFactory,
+        @inject(ServiceIdentifiers.Factory__IObfuscationReplacer) obfuscatingReplacerFactory: TObfuscationReplacerFactory,
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
         super(options);
 
-        this.identifierReplacer = <IObfuscationReplacerWithStorage>obfuscationReplacerFactory(ObfuscationReplacers.IdentifierReplacer);
+        this.identifierReplacer = <IIdentifierReplacer>obfuscatingReplacerFactory(ObfuscationReplacers.IdentifierReplacer);
     }
 
     /**
@@ -88,12 +88,15 @@ export class CatchClauseTransformer extends AbstractNodeTransformer {
         estraverse.replace(catchClauseNode, {
             enter: (node: ESTree.Node, parentNode: ESTree.Node): any => {
                 if (Node.isReplaceableIdentifierNode(node, parentNode)) {
-                    const newNodeName: string = this.identifierReplacer.replace(node.name, nodeIdentifier);
+                    const newIdentifier: ESTree.Identifier = this.identifierReplacer.replace(node.name, nodeIdentifier);
 
-                    if (node.name !== newNodeName) {
-                        node.name = newNodeName;
-                        node.obfuscatedNode = true;
+                    if (node.name === newIdentifier.name) {
+                        return node;
                     }
+
+                    newIdentifier.obfuscatedNode = true;
+
+                    return newIdentifier;
                 }
             }
         });

+ 15 - 11
src/node-transformers/obfuscating-transformers/FunctionDeclarationTransformer.ts

@@ -8,7 +8,7 @@ import { TNodeWithBlockStatement } from '../../types/node/TNodeWithBlockStatemen
 import { TObfuscationReplacerFactory } from '../../types/container/TObfuscationReplacerFactory';
 
 import { IOptions } from '../../interfaces/options/IOptions';
-import { IObfuscationReplacerWithStorage } from '../../interfaces/node-transformers/IObfuscationReplacerWithStorage';
+import { IIdentifierReplacer } from '../../interfaces/node-transformers/IIdentifierReplacer';
 import { IVisitor } from '../../interfaces/IVisitor';
 
 import { ObfuscationReplacers } from '../../enums/container/ObfuscationReplacers';
@@ -30,9 +30,9 @@ import { NodeUtils } from '../../node/NodeUtils';
 @injectable()
 export class FunctionDeclarationTransformer extends AbstractNodeTransformer {
     /**
-     * @type {IObfuscationReplacerWithStorage}
+     * @type {IIdentifierReplacer}
      */
-    private readonly identifierReplacer: IObfuscationReplacerWithStorage;
+    private readonly identifierReplacer: IIdentifierReplacer;
 
     /**
      * @type {Map<ESTree.Node, ESTree.Identifier[]>}
@@ -40,16 +40,16 @@ export class FunctionDeclarationTransformer extends AbstractNodeTransformer {
     private readonly replaceableIdentifiers: Map <ESTree.Node, ESTree.Identifier[]> = new Map();
 
     /**
-     * @param obfuscationReplacerFactory
+     * @param obfuscatingReplacerFactory
      * @param options
      */
     constructor (
-        @inject(ServiceIdentifiers.Factory__IObfuscationReplacer) obfuscationReplacerFactory: TObfuscationReplacerFactory,
+        @inject(ServiceIdentifiers.Factory__IObfuscationReplacer) obfuscatingReplacerFactory: TObfuscationReplacerFactory,
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
         super(options);
 
-        this.identifierReplacer = <IObfuscationReplacerWithStorage>obfuscationReplacerFactory(ObfuscationReplacers.IdentifierReplacer);
+        this.identifierReplacer = <IIdentifierReplacer>obfuscatingReplacerFactory(ObfuscationReplacers.IdentifierReplacer);
     }
 
     /**
@@ -107,7 +107,9 @@ export class FunctionDeclarationTransformer extends AbstractNodeTransformer {
         const cachedReplaceableIdentifiers: ESTree.Identifier[] = <ESTree.Identifier[]>this.replaceableIdentifiers.get(scopeNode);
 
         cachedReplaceableIdentifiers.forEach((replaceableIdentifier: ESTree.Identifier) => {
-            replaceableIdentifier.name = this.identifierReplacer.replace(replaceableIdentifier.name, nodeIdentifier);
+            const newReplaceableIdentifier: ESTree.Identifier = this.identifierReplacer.replace(replaceableIdentifier.name, nodeIdentifier);
+
+            replaceableIdentifier.name = newReplaceableIdentifier.name;
         });
     }
 
@@ -121,13 +123,15 @@ export class FunctionDeclarationTransformer extends AbstractNodeTransformer {
         estraverse.replace(scopeNode, {
             enter: (node: ESTree.Node, parentNode: ESTree.Node): any => {
                 if (Node.isReplaceableIdentifierNode(node, parentNode)) {
-                    const newNodeName: string = this.identifierReplacer.replace(node.name, nodeIdentifier);
+                    const newIdentifier: ESTree.Identifier = this.identifierReplacer.replace(node.name, nodeIdentifier);
 
-                    if (node.name !== newNodeName) {
-                        node.name = newNodeName;
-                    } else {
+                    if (node.name === newIdentifier.name) {
                         storedReplaceableIdentifiers.push(node);
+
+                        return node;
                     }
+
+                    return newIdentifier;
                 }
             }
         });

+ 18 - 13
src/node-transformers/obfuscating-transformers/FunctionTransformer.ts

@@ -7,7 +7,7 @@ import * as ESTree from 'estree';
 import { TObfuscationReplacerFactory } from '../../types/container/TObfuscationReplacerFactory';
 
 import { IOptions } from '../../interfaces/options/IOptions';
-import { IObfuscationReplacerWithStorage } from '../../interfaces/node-transformers/IObfuscationReplacerWithStorage';
+import { IIdentifierReplacer } from '../../interfaces/node-transformers/IIdentifierReplacer';
 import { IVisitor } from '../../interfaces/IVisitor';
 
 import { ObfuscationReplacers } from '../../enums/container/ObfuscationReplacers';
@@ -26,21 +26,21 @@ import { Node } from '../../node/Node';
 @injectable()
 export class FunctionTransformer extends AbstractNodeTransformer {
     /**
-     * @type {IObfuscationReplacerWithStorage}
+     * @type {IIdentifierReplacer}
      */
-    private readonly identifierReplacer: IObfuscationReplacerWithStorage;
+    private readonly identifierReplacer: IIdentifierReplacer;
 
     /**
-     * @param obfuscationReplacerFactory
+     * @param obfuscatingReplacerFactory
      * @param options
      */
     constructor (
-        @inject(ServiceIdentifiers.Factory__IObfuscationReplacer) obfuscationReplacerFactory: TObfuscationReplacerFactory,
+        @inject(ServiceIdentifiers.Factory__IObfuscationReplacer) obfuscatingReplacerFactory: TObfuscationReplacerFactory,
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
         super(options);
 
-        this.identifierReplacer = <IObfuscationReplacerWithStorage>obfuscationReplacerFactory(ObfuscationReplacers.IdentifierReplacer);
+        this.identifierReplacer = <IIdentifierReplacer>obfuscatingReplacerFactory(ObfuscationReplacers.IdentifierReplacer);
     }
 
     /**
@@ -106,21 +106,26 @@ export class FunctionTransformer extends AbstractNodeTransformer {
      * @param nodeIdentifier
      */
     private replaceFunctionParams (functionNode: ESTree.Function, nodeIdentifier: number): void {
-        const traverseVisitor: estraverse.Visitor = {
+        const replaceVisitor: estraverse.Visitor = {
             enter: (node: ESTree.Node, parentNode: ESTree.Node): any => {
                 if (Node.isReplaceableIdentifierNode(node, parentNode)) {
-                    const newNodeName: string = this.identifierReplacer.replace(node.name, nodeIdentifier);
+                    const newIdentifier: ESTree.Identifier = this.identifierReplacer.replace(node.name, nodeIdentifier);
 
-                    if (node.name !== newNodeName) {
-                        node.name = newNodeName;
-                        node.obfuscatedNode = true;
+                    if (node.name === newIdentifier.name) {
+                        return node;
                     }
+
+                    newIdentifier.obfuscatedNode = true;
+
+                    return newIdentifier;
                 }
             }
         };
 
-        functionNode.params.forEach((paramsNode: ESTree.Node) => estraverse.replace(paramsNode, traverseVisitor));
+        functionNode.params = functionNode.params.map((paramsNode: ESTree.Node) =>
+            <ESTree.Pattern>estraverse.replace(paramsNode, replaceVisitor)
+        );
 
-        estraverse.replace(functionNode.body, traverseVisitor);
+        estraverse.replace(functionNode.body, replaceVisitor);
     }
 }

+ 7 - 7
src/node-transformers/obfuscating-transformers/LabeledStatementTransformer.ts

@@ -7,7 +7,7 @@ import * as ESTree from 'estree';
 import { TObfuscationReplacerFactory } from '../../types/container/TObfuscationReplacerFactory';
 
 import { IOptions } from '../../interfaces/options/IOptions';
-import { IObfuscationReplacerWithStorage } from '../../interfaces/node-transformers/IObfuscationReplacerWithStorage';
+import { IIdentifierReplacer } from '../../interfaces/node-transformers/IIdentifierReplacer';
 import { IVisitor } from '../../interfaces/IVisitor';
 
 import { ObfuscationReplacers } from '../../enums/container/ObfuscationReplacers';
@@ -34,21 +34,21 @@ import { Node } from '../../node/Node';
 @injectable()
 export class LabeledStatementTransformer extends AbstractNodeTransformer {
     /**
-     * @type {IObfuscationReplacerWithStorage}
+     * @type {IIdentifierReplacer}
      */
-    private readonly identifierReplacer: IObfuscationReplacerWithStorage;
+    private readonly identifierReplacer: IIdentifierReplacer;
 
     /**
-     * @param obfuscationReplacerFactory
+     * @param obfuscatingReplacerFactory
      * @param options
      */
     constructor (
-        @inject(ServiceIdentifiers.Factory__IObfuscationReplacer) obfuscationReplacerFactory: TObfuscationReplacerFactory,
+        @inject(ServiceIdentifiers.Factory__IObfuscationReplacer) obfuscatingReplacerFactory: TObfuscationReplacerFactory,
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
         super(options);
 
-        this.identifierReplacer = <IObfuscationReplacerWithStorage>obfuscationReplacerFactory(ObfuscationReplacers.IdentifierReplacer);
+        this.identifierReplacer = <IIdentifierReplacer>obfuscatingReplacerFactory(ObfuscationReplacers.IdentifierReplacer);
     }
 
     /**
@@ -94,7 +94,7 @@ export class LabeledStatementTransformer extends AbstractNodeTransformer {
         estraverse.replace(labeledStatementNode, {
             enter: (node: ESTree.Node, parentNode: ESTree.Node): any => {
                 if (Node.isLabelIdentifierNode(node, parentNode)) {
-                    node.name = this.identifierReplacer.replace(node.name, nodeIdentifier);
+                    return this.identifierReplacer.replace(node.name, nodeIdentifier);
                 }
             }
         });

+ 7 - 23
src/node-transformers/obfuscating-transformers/LiteralTransformer.ts

@@ -1,7 +1,6 @@
 import { injectable, inject } from 'inversify';
 import { ServiceIdentifiers } from '../../container/ServiceIdentifiers';
 
-import * as escodegen from 'escodegen-wallaby';
 import * as ESTree from 'estree';
 
 import { TObfuscationReplacerFactory } from '../../types/container/TObfuscationReplacerFactory';
@@ -22,16 +21,16 @@ export class LiteralTransformer extends AbstractNodeTransformer {
     private readonly obfuscationReplacerFactory: TObfuscationReplacerFactory;
 
     /**
-     * @param obfuscationReplacerFactory
+     * @param obfuscatingReplacerFactory
      * @param options
      */
     constructor (
-        @inject(ServiceIdentifiers.Factory__IObfuscationReplacer) obfuscationReplacerFactory: TObfuscationReplacerFactory,
+        @inject(ServiceIdentifiers.Factory__IObfuscationReplacer) obfuscatingReplacerFactory: TObfuscationReplacerFactory,
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
         super(options);
 
-        this.obfuscationReplacerFactory = obfuscationReplacerFactory;
+        this.obfuscationReplacerFactory = obfuscatingReplacerFactory;
     }
 
     /**
@@ -40,7 +39,7 @@ export class LiteralTransformer extends AbstractNodeTransformer {
     public getVisitor (): IVisitor {
         return {
             enter: (node: ESTree.Node, parentNode: ESTree.Node) => {
-                if (Node.isLiteralNode(node)) {
+                if (Node.isLiteralNode(node) && !node.obfuscatedNode) {
                     return this.transformNode(node, parentNode);
                 }
             }
@@ -57,36 +56,21 @@ export class LiteralTransformer extends AbstractNodeTransformer {
             return literalNode;
         }
 
-        let content: string;
-
         switch (typeof literalNode.value) {
             case 'boolean':
-                content = this.obfuscationReplacerFactory(ObfuscationReplacers.BooleanReplacer)
+                return this.obfuscationReplacerFactory(ObfuscationReplacers.BooleanReplacer)
                     .replace(<boolean>literalNode.value);
 
-                break;
-
             case 'number':
-                content = this.obfuscationReplacerFactory(ObfuscationReplacers.NumberLiteralReplacer)
+                return this.obfuscationReplacerFactory(ObfuscationReplacers.NumberLiteralReplacer)
                     .replace(<number>literalNode.value);
 
-                break;
-
             case 'string':
-                content = this.obfuscationReplacerFactory(ObfuscationReplacers.StringLiteralReplacer)
+                return this.obfuscationReplacerFactory(ObfuscationReplacers.StringLiteralReplacer)
                     .replace(<string>literalNode.value);
 
-                break;
-
             default:
                 return literalNode;
         }
-
-        literalNode['x-verbatim-property'] = {
-            content : content,
-            precedence: escodegen.Precedence.Primary
-        };
-
-        return literalNode;
     }
 }

+ 15 - 11
src/node-transformers/obfuscating-transformers/VariableDeclarationTransformer.ts

@@ -8,7 +8,7 @@ import { TNodeWithBlockStatement } from '../../types/node/TNodeWithBlockStatemen
 import { TObfuscationReplacerFactory } from '../../types/container/TObfuscationReplacerFactory';
 
 import { IOptions } from '../../interfaces/options/IOptions';
-import { IObfuscationReplacerWithStorage } from '../../interfaces/node-transformers/IObfuscationReplacerWithStorage';
+import { IIdentifierReplacer } from '../../interfaces/node-transformers/IIdentifierReplacer';
 import { IVisitor } from '../../interfaces/IVisitor';
 
 import { ObfuscationReplacers } from '../../enums/container/ObfuscationReplacers';
@@ -31,9 +31,9 @@ import { NodeUtils } from '../../node/NodeUtils';
 @injectable()
 export class VariableDeclarationTransformer extends AbstractNodeTransformer {
     /**
-     * @type {IObfuscationReplacerWithStorage}
+     * @type {IIdentifierReplacer}
      */
-    private readonly identifierReplacer: IObfuscationReplacerWithStorage;
+    private readonly identifierReplacer: IIdentifierReplacer;
 
     /**
      * @type {Map<ESTree.Node, ESTree.Identifier[]>}
@@ -41,16 +41,16 @@ export class VariableDeclarationTransformer extends AbstractNodeTransformer {
     private readonly replaceableIdentifiers: Map <ESTree.Node, ESTree.Identifier[]> = new Map();
 
     /**
-     * @param obfuscationReplacerFactory
+     * @param obfuscatingReplacerFactory
      * @param options
      */
     constructor (
-        @inject(ServiceIdentifiers.Factory__IObfuscationReplacer) obfuscationReplacerFactory: TObfuscationReplacerFactory,
+        @inject(ServiceIdentifiers.Factory__IObfuscationReplacer) obfuscatingReplacerFactory: TObfuscationReplacerFactory,
         @inject(ServiceIdentifiers.IOptions) options: IOptions
     ) {
         super(options);
 
-        this.identifierReplacer = <IObfuscationReplacerWithStorage>obfuscationReplacerFactory(ObfuscationReplacers.IdentifierReplacer);
+        this.identifierReplacer = <IIdentifierReplacer>obfuscatingReplacerFactory(ObfuscationReplacers.IdentifierReplacer);
     }
 
     /**
@@ -121,7 +121,9 @@ export class VariableDeclarationTransformer extends AbstractNodeTransformer {
         const cachedReplaceableIdentifiers: ESTree.Identifier[] = <ESTree.Identifier[]>this.replaceableIdentifiers.get(scopeNode);
 
         cachedReplaceableIdentifiers.forEach((replaceableIdentifier: ESTree.Identifier) => {
-            replaceableIdentifier.name = this.identifierReplacer.replace(replaceableIdentifier.name, nodeIdentifier);
+            const newReplaceableIdentifier: ESTree.Identifier = this.identifierReplacer.replace(replaceableIdentifier.name, nodeIdentifier);
+
+            replaceableIdentifier.name = newReplaceableIdentifier.name;
         });
     }
 
@@ -135,13 +137,15 @@ export class VariableDeclarationTransformer extends AbstractNodeTransformer {
         estraverse.replace(scopeNode, {
             enter: (node: ESTree.Node, parentNode: ESTree.Node): any => {
                 if (!node.obfuscatedNode && Node.isReplaceableIdentifierNode(node, parentNode)) {
-                    const newNodeName: string = this.identifierReplacer.replace(node.name, nodeIdentifier);
+                    const newIdentifier: ESTree.Identifier = this.identifierReplacer.replace(node.name, nodeIdentifier);
 
-                    if (node.name !== newNodeName) {
-                        node.name = newNodeName;
-                    } else {
+                    if (node.name === newIdentifier.name) {
                         storedReplaceableIdentifiers.push(node);
+
+                        return node;
                     }
+
+                    return newIdentifier;
                 }
             }
         });

+ 6 - 4
src/node-transformers/obfuscating-transformers/replacers/AbstractReplacer.ts → src/node-transformers/obfuscating-transformers/obfuscating-replacers/AbstractObfuscatingReplacer.ts

@@ -1,11 +1,13 @@
 import { injectable, inject } from 'inversify';
 import { ServiceIdentifiers } from '../../../container/ServiceIdentifiers';
 
+import * as ESTree from 'estree';
+
+import { IObfuscatingReplacer } from '../../../interfaces/node-transformers/IObfuscatingReplacer';
 import { IOptions } from '../../../interfaces/options/IOptions';
-import { IObfuscationReplacer } from '../../../interfaces/node-transformers/IObfuscationReplacer';
 
 @injectable()
-export abstract class AbstractReplacer implements IObfuscationReplacer {
+export abstract class AbstractObfuscatingReplacer implements IObfuscatingReplacer {
     /**
      * @type {IOptions}
      */
@@ -23,7 +25,7 @@ export abstract class AbstractReplacer implements IObfuscationReplacer {
     /**
      * @param nodeValue
      * @param nodeIdentifier
-     * @returns {string}
+     * @returns {ESTree.Node}
      */
-    public abstract replace (nodeValue: any, nodeIdentifier?: number): string;
+    public abstract replace (nodeValue: any, nodeIdentifier?: number): ESTree.Node;
 }

+ 51 - 0
src/node-transformers/obfuscating-transformers/obfuscating-replacers/BooleanLiteralReplacer.ts

@@ -0,0 +1,51 @@
+import { injectable, inject } from 'inversify';
+import { ServiceIdentifiers } from '../../../container/ServiceIdentifiers';
+
+import * as ESTree from 'estree';
+
+import { IOptions } from '../../../interfaces/options/IOptions';
+
+import { AbstractObfuscatingReplacer } from './AbstractObfuscatingReplacer';
+import { Nodes } from '../../../node/Nodes';
+
+@injectable()
+export class BooleanLiteralReplacer extends AbstractObfuscatingReplacer {
+    /**
+     * @param options
+     */
+    constructor (
+        @inject(ServiceIdentifiers.IOptions) options: IOptions
+    ) {
+        super(options);
+    }
+
+    /**
+     * @return {ESTree.UnaryExpression}
+     */
+    private static getTrueUnaryExpressionNode (): ESTree.UnaryExpression {
+        return Nodes.getUnaryExpressionNode(
+            '!',
+            BooleanLiteralReplacer.getFalseUnaryExpressionNode()
+        );
+    }
+
+    /**
+     * @return {ESTree.UnaryExpression}
+     */
+    private static getFalseUnaryExpressionNode (): ESTree.UnaryExpression {
+        return Nodes.getUnaryExpressionNode(
+            '!',
+            Nodes.getArrayExpressionNode()
+        );
+    }
+
+    /**
+     * @param nodeValue
+     * @returns {ESTree.Node}
+     */
+    public replace (nodeValue: boolean): ESTree.Node {
+        return nodeValue ?
+            BooleanLiteralReplacer.getTrueUnaryExpressionNode() :
+            BooleanLiteralReplacer.getFalseUnaryExpressionNode();
+    }
+}

+ 11 - 8
src/node-transformers/obfuscating-transformers/replacers/IdentifierReplacer.ts → src/node-transformers/obfuscating-transformers/obfuscating-replacers/IdentifierReplacer.ts

@@ -1,14 +1,17 @@
 import { injectable, inject } from 'inversify';
 import { ServiceIdentifiers } from '../../../container/ServiceIdentifiers';
 
-import { IObfuscationReplacerWithStorage } from '../../../interfaces/node-transformers/IObfuscationReplacerWithStorage';
+import * as ESTree from 'estree';
+
+import { IIdentifierReplacer } from '../../../interfaces/node-transformers/IIdentifierReplacer';
 import { IOptions } from '../../../interfaces/options/IOptions';
 
-import { AbstractReplacer } from './AbstractReplacer';
+import { AbstractObfuscatingReplacer } from './AbstractObfuscatingReplacer';
+import { Nodes } from '../../../node/Nodes';
 import { RandomGeneratorUtils } from '../../../utils/RandomGeneratorUtils';
 
 @injectable()
-export class IdentifierReplacer extends AbstractReplacer implements IObfuscationReplacerWithStorage {
+export class IdentifierReplacer extends AbstractObfuscatingReplacer implements IIdentifierReplacer {
     /**
      * @type {Map<string, string>}
      */
@@ -26,16 +29,16 @@ export class IdentifierReplacer extends AbstractReplacer implements IObfuscation
     /**
      * @param nodeValue
      * @param nodeIdentifier
-     * @returns {string}
+     * @returns {ESTree.Identifier}
      */
-    public replace (nodeValue: string, nodeIdentifier: number): string {
+    public replace (nodeValue: string, nodeIdentifier: number): ESTree.Identifier {
         const mapKey: string = `${nodeValue}-${String(nodeIdentifier)}`;
 
-        if (!this.namesMap.has(mapKey)) {
-            return nodeValue;
+        if (this.namesMap.has(mapKey)) {
+            nodeValue = <string>this.namesMap.get(mapKey);
         }
 
-        return <string>this.namesMap.get(mapKey);
+        return Nodes.getIdentifierNode(nodeValue);
     }
 
     /**

+ 49 - 0
src/node-transformers/obfuscating-transformers/obfuscating-replacers/NumberLiteralReplacer.ts

@@ -0,0 +1,49 @@
+import { injectable, inject } from 'inversify';
+import { ServiceIdentifiers } from '../../../container/ServiceIdentifiers';
+
+import * as ESTree from 'estree';
+
+import { IOptions } from '../../../interfaces/options/IOptions';
+
+import { AbstractObfuscatingReplacer } from './AbstractObfuscatingReplacer';
+import { Nodes } from '../../../node/Nodes';
+import { Utils } from '../../../utils/Utils';
+
+@injectable()
+export class NumberLiteralReplacer extends AbstractObfuscatingReplacer {
+    /**
+     * @type {Map<string, string>}
+     */
+    private readonly numberLiteralCache: Map <number, string> = new Map();
+
+    /**
+     * @param options
+     */
+    constructor (
+        @inject(ServiceIdentifiers.IOptions) options: IOptions
+    ) {
+        super(options);
+    }
+
+    /**
+     * @param nodeValue
+     * @returns {ESTree.Node}
+     */
+    public replace (nodeValue: number): ESTree.Node {
+        let rawValue: string;
+
+        if (this.numberLiteralCache.has(nodeValue)) {
+            rawValue = <string>this.numberLiteralCache.get(nodeValue);
+        } else {
+            if (!Utils.isCeilNumber(nodeValue)) {
+                rawValue = String(nodeValue);
+            } else {
+                rawValue = `${Utils.hexadecimalPrefix}${Utils.decToHex(nodeValue)}`;
+            }
+
+            this.numberLiteralCache.set(nodeValue, rawValue);
+        }
+
+        return Nodes.getLiteralNode(nodeValue, rawValue);
+    }
+}

+ 55 - 24
src/node-transformers/obfuscating-transformers/replacers/StringLiteralReplacer.ts → src/node-transformers/obfuscating-transformers/obfuscating-replacers/StringLiteralReplacer.ts

@@ -1,6 +1,8 @@
 import { injectable, inject } from 'inversify';
 import { ServiceIdentifiers } from '../../../container/ServiceIdentifiers';
 
+import * as ESTree from 'estree';
+
 import { ICustomNodeGroup } from '../../../interfaces/custom-nodes/ICustomNodeGroup';
 import { IEncodedValue } from '../../../interfaces/node-transformers/IEncodedValue';
 import { IOptions } from '../../../interfaces/options/IOptions';
@@ -8,13 +10,14 @@ import { IStorage } from '../../../interfaces/storages/IStorage';
 
 import { StringArrayEncoding } from '../../../enums/StringArrayEncoding';
 
-import { AbstractReplacer } from './AbstractReplacer';
+import { AbstractObfuscatingReplacer } from './AbstractObfuscatingReplacer';
 import { CryptUtils } from '../../../utils/CryptUtils';
+import { Nodes } from '../../../node/Nodes';
 import { RandomGeneratorUtils } from '../../../utils/RandomGeneratorUtils';
 import { Utils } from '../../../utils/Utils';
 
 @injectable()
-export class StringLiteralReplacer extends AbstractReplacer {
+export class StringLiteralReplacer extends AbstractObfuscatingReplacer {
     /**
      * @type {number}
      */
@@ -26,14 +29,14 @@ export class StringLiteralReplacer extends AbstractReplacer {
     private readonly customNodeGroupStorage: IStorage<ICustomNodeGroup>;
 
     /**
-     * @type {string[]}
+     * @type {Map<string, ESTree.Node>}
      */
-    private readonly rc4Keys: string[];
+    private readonly nodesCache: Map <string, ESTree.Node> = new Map();
 
     /**
-     * @type {Map<string, string>}
+     * @type {string[]}
      */
-    private readonly stringLiteralCache: Map <string, string> = new Map();
+    private readonly rc4Keys: string[];
 
     /**
      * @type {Map<string, string>}
@@ -66,31 +69,41 @@ export class StringLiteralReplacer extends AbstractReplacer {
 
     /**
      * @param nodeValue
-     * @returns {string}
+     * @returns {ESTree.Node}
      */
-    public replace (nodeValue: string): string {
-        const usingStringArray: boolean = (
-            this.options.stringArray &&
-            nodeValue.length >= StringLiteralReplacer.minimumLengthForStringArray &&
-            RandomGeneratorUtils.getMathRandom() <= this.options.stringArrayThreshold
-        );
+    public replace (nodeValue: string): ESTree.Node {
+        const usingStringArray: boolean = this.canUseStringArray(nodeValue);
         const cacheKey: string = `${nodeValue}-${String(usingStringArray)}`;
 
-        if (this.stringLiteralCache.has(cacheKey) && this.options.stringArrayEncoding !== StringArrayEncoding.rc4) {
-            return <string>this.stringLiteralCache.get(cacheKey);
+        if (this.nodesCache.has(cacheKey) && this.options.stringArrayEncoding !== StringArrayEncoding.rc4) {
+            return <ESTree.Node>this.nodesCache.get(cacheKey);
         }
 
-        let result: string;
+        let resultNode: ESTree.Node;
 
         if (usingStringArray) {
-            result = this.replaceStringLiteralWithStringArrayCall(nodeValue);
+            resultNode = this.replaceWithStringArrayCallNode(nodeValue);
         } else {
-            result = `'${Utils.stringToUnicodeEscapeSequence(nodeValue, !this.options.unicodeEscapeSequence)}'`;
+            resultNode = Nodes.getLiteralNode(
+                `${Utils.stringToUnicodeEscapeSequence(nodeValue, !this.options.unicodeEscapeSequence)}`
+            );
         }
 
-        this.stringLiteralCache.set(cacheKey, result);
+        this.nodesCache.set(cacheKey, resultNode);
+
+        return resultNode;
+    }
 
-        return result;
+    /**
+     * @param nodeValue
+     * @return {boolean}
+     */
+    private canUseStringArray (nodeValue: string): boolean {
+        return (
+            this.options.stringArray &&
+            nodeValue.length >= StringLiteralReplacer.minimumLengthForStringArray &&
+            RandomGeneratorUtils.getMathRandom() <= this.options.stringArrayThreshold
+        );
     }
 
     /**
@@ -142,18 +155,36 @@ export class StringLiteralReplacer extends AbstractReplacer {
 
     /**
      * @param value
-     * @returns {string}
+     * @returns {ESTree.Node}
      */
-    private replaceStringLiteralWithStringArrayCall (value: string): string {
+    private replaceWithStringArrayCallNode (value: string): ESTree.Node {
         const { encodedValue, key }: IEncodedValue = this.getEncodedValue(value);
         const hexadecimalIndex: string = this.getArrayHexadecimalIndex(encodedValue);
         const rotatedStringArrayStorageId: string = Utils.stringRotate(this.stringArrayStorage.getStorageId(), 1);
         const stringArrayStorageCallsWrapperName: string = `_${Utils.hexadecimalPrefix}${rotatedStringArrayStorageId}`;
 
+        const hexadecimalLiteralNode: ESTree.Literal = Nodes.getLiteralNode(hexadecimalIndex);
+
+        hexadecimalLiteralNode.obfuscatedNode = true;
+
+        const callExpressionArgs: (ESTree.Expression | ESTree.SpreadElement)[] = [
+            hexadecimalLiteralNode
+        ];
+
         if (key) {
-            return `${stringArrayStorageCallsWrapperName}('${hexadecimalIndex}', '${Utils.stringToUnicodeEscapeSequence(key, !this.options.unicodeEscapeSequence)}')`;
+            const rc4KeyLiteralNode: ESTree.Literal = Nodes.getLiteralNode(
+                Utils.stringToUnicodeEscapeSequence(key, !this.options.unicodeEscapeSequence)
+            );
+
+            rc4KeyLiteralNode.obfuscatedNode = true;
+            callExpressionArgs.push(rc4KeyLiteralNode);
         }
 
-        return `${stringArrayStorageCallsWrapperName}('${hexadecimalIndex}')`;
+        return  Nodes.getCallExpressionNode(
+            Nodes.getIdentifierNode(
+                stringArrayStorageCallsWrapperName
+            ),
+            callExpressionArgs
+        );
     }
 }

+ 0 - 28
src/node-transformers/obfuscating-transformers/replacers/BooleanLiteralReplacer.ts

@@ -1,28 +0,0 @@
-import { injectable, inject } from 'inversify';
-import { ServiceIdentifiers } from '../../../container/ServiceIdentifiers';
-
-import { IOptions } from '../../../interfaces/options/IOptions';
-
-import { JSFuck } from '../../../enums/JSFuck';
-
-import { AbstractReplacer } from './AbstractReplacer';
-
-@injectable()
-export class BooleanLiteralReplacer extends AbstractReplacer {
-    /**
-     * @param options
-     */
-    constructor (
-        @inject(ServiceIdentifiers.IOptions) options: IOptions
-    ) {
-        super(options);
-    }
-
-    /**
-     * @param nodeValue
-     * @returns {string}
-     */
-    public replace (nodeValue: boolean): string {
-        return nodeValue ? JSFuck.True : JSFuck.False;
-    }
-}

+ 0 - 46
src/node-transformers/obfuscating-transformers/replacers/NumberLiteralReplacer.ts

@@ -1,46 +0,0 @@
-import { injectable, inject } from 'inversify';
-import { ServiceIdentifiers } from '../../../container/ServiceIdentifiers';
-
-import { IOptions } from '../../../interfaces/options/IOptions';
-
-import { AbstractReplacer } from './AbstractReplacer';
-import { Utils } from '../../../utils/Utils';
-
-@injectable()
-export class NumberLiteralReplacer extends AbstractReplacer {
-    /**
-     * @type {Map<string, string>}
-     */
-    private readonly numberLiteralCache: Map <number, string> = new Map();
-
-    /**
-     * @param options
-     */
-    constructor (
-        @inject(ServiceIdentifiers.IOptions) options: IOptions
-    ) {
-        super(options);
-    }
-
-    /**
-     * @param nodeValue
-     * @returns {string}
-     */
-    public replace (nodeValue: number): string {
-        if (this.numberLiteralCache.has(nodeValue)) {
-            return <string>this.numberLiteralCache.get(nodeValue);
-        }
-
-        let result: string;
-
-        if (!Utils.isCeilNumber(nodeValue)) {
-            result = String(nodeValue);
-        } else {
-            result = `${Utils.hexadecimalPrefix}${Utils.decToHex(nodeValue)}`;
-        }
-
-        this.numberLiteralCache.set(nodeValue, result);
-
-        return result;
-    }
-}

+ 19 - 3
src/node/Nodes.ts

@@ -19,6 +19,19 @@ export class Nodes {
         };
     }
 
+    /**
+     * @param elements
+     * @return {ESTree.ArrayExpression}
+     */
+    public static getArrayExpressionNode (
+        elements: (ESTree.Expression | ESTree.SpreadElement)[] = []
+    ): ESTree.ArrayExpression {
+        return {
+            type: NodeType.ArrayExpression,
+            elements
+        };
+    }
+
     /**
      * @param operator
      * @param left
@@ -234,15 +247,18 @@ export class Nodes {
 
     /**
      * @param value
+     * @param raw
      * @returns {ESTree.Literal}
      */
-    public static getLiteralNode (value: boolean|number|string): ESTree.Literal {
+    public static getLiteralNode (value: boolean|number|string, raw?: string): ESTree.Literal {
+        raw = raw !== undefined ? raw : `'${value}'`;
+
         return {
             type: NodeType.Literal,
             value,
-            raw: `'${value}'`,
+            raw,
             'x-verbatim-property': {
-                content: `'${value}'`,
+                content: raw,
                 precedence: escodegen.Precedence.Primary
             },
             obfuscatedNode: false

+ 2 - 2
src/types/container/TObfuscationReplacerFactory.d.ts

@@ -1,5 +1,5 @@
-import { IObfuscationReplacer } from '../../interfaces/node-transformers/IObfuscationReplacer';
+import { IObfuscatingReplacer } from '../../interfaces/node-transformers/IObfuscatingReplacer';
 
 import { ObfuscationReplacers } from '../../enums/container/ObfuscationReplacers';
 
-export type TObfuscationReplacerFactory = (replacer: ObfuscationReplacers) => IObfuscationReplacer;
+export type TObfuscationReplacerFactory = (replacer: ObfuscationReplacers) => IObfuscatingReplacer;

+ 1 - 1
test/functional-tests/node-transformers/obfuscating-transformers/literal-transformer/LiteralTransformer.spec.ts

@@ -144,7 +144,7 @@ describe('LiteralTransformer', () => {
 
             assert.match(
                 obfuscationResult.getObfuscatedCode(),
-                /var *test *= *_0x([a-f0-9]){4}\('0x0', '(?:\w|(?:\\x[a-f0-9]*)){4}'\);/
+                /var *test *= *_0x([a-f0-9]){4}\('0x0', *'(?:\w|(?:\\x[a-f0-9]*)){4}'\);/
             );
         });
 

+ 33 - 37
yarn.lock

@@ -44,10 +44,14 @@
   version "2.2.41"
   resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.41.tgz#e27cf0817153eb9f2713b2d3f6c68f1e1c3ca608"
 
-"@types/node@*", "@types/[email protected]":
+"@types/node@*":
   version "7.0.18"
   resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173"
 
+"@types/[email protected]":
+  version "7.0.22"
+  resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.22.tgz#4593f4d828bdd612929478ea40c67b4f403ca255"
+
 "@types/[email protected]":
   version "2.2.2"
   resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-2.2.2.tgz#a80da4868ba08accacbce4d37276f35e1ba0a52f"
@@ -1313,12 +1317,6 @@ find-up@^1.0.0:
     path-exists "^2.0.0"
     pinkie-promise "^2.0.0"
 
-findup-sync@~0.3.0:
-  version "0.3.0"
-  resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-0.3.0.tgz#37930aa5d816b777c03445e1966cc6790a4c0b16"
-  dependencies:
-    glob "~5.0.0"
-
 for-in@^1.0.1:
   version "1.0.2"
   resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
@@ -1451,16 +1449,6 @@ glob@^7.0.0:
     once "^1.3.0"
     path-is-absolute "^1.0.0"
 
-glob@~5.0.0:
-  version "5.0.15"
-  resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1"
-  dependencies:
-    inflight "^1.0.4"
-    inherits "2"
-    minimatch "2 || 3"
-    once "^1.3.0"
-    path-is-absolute "^1.0.0"
-
 globals@^9.0.0:
   version "9.16.0"
   resolved "https://registry.yarnpkg.com/globals/-/globals-9.16.0.tgz#63e903658171ec2d9f51b1d31de5e2b8dc01fb80"
@@ -2068,7 +2056,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1:
   version "1.0.1"
   resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a"
 
-"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3:
+minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3:
   version "3.0.3"
   resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774"
   dependencies:
@@ -2665,9 +2653,9 @@ signal-exit@^3.0.0:
   version "3.0.2"
   resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
 
-sinon@2.2.0:
-  version "2.2.0"
-  resolved "https://registry.yarnpkg.com/sinon/-/sinon-2.2.0.tgz#3b1b42ff5defcbf51a52a62aca6d61171b9fd262"
+sinon@2.3.1:
+  version "2.3.1"
+  resolved "https://registry.yarnpkg.com/sinon/-/sinon-2.3.1.tgz#48c9c758b4d0bb86327486833f1c4298919ce9ee"
   dependencies:
     diff "^3.1.0"
     formatio "1.2.0"
@@ -2916,24 +2904,23 @@ [email protected]:
     rimraf "^2.4.4"
     semver "^5.3.0"
 
-tslint@5.2.0:
-  version "5.2.0"
-  resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.2.0.tgz#16a2addf20cb748385f544e9a0edab086bc34114"
+tslint@5.3.2:
+  version "5.3.2"
+  resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.3.2.tgz#e56459fb095a7307f103b84052174f5e3bbef6ed"
   dependencies:
     babel-code-frame "^6.22.0"
     colors "^1.1.2"
     diff "^3.2.0"
-    findup-sync "~0.3.0"
     glob "^7.1.1"
     optimist "~0.6.0"
     resolve "^1.3.2"
     semver "^5.3.0"
     tslib "^1.6.0"
-    tsutils "^1.8.0"
+    tsutils "^2.0.0"
 
-tsutils@^1.8.0:
-  version "1.8.0"
-  resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-1.8.0.tgz#bf8118ed8e80cd5c9fc7d75728c7963d44ed2f52"
+tsutils@^2.0.0:
+  version "2.0.0"
+  resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.0.0.tgz#ae0ca48a4b431b5c04e4f711a9227aa2e37e2e04"
 
 [email protected]:
   version "0.0.0"
@@ -2965,11 +2952,11 @@ typedarray@^0.0.6:
   version "0.0.6"
   resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
 
[email protected].2:
-  version "2.3.2"
-  resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.3.2.tgz#f0f045e196f69a72f06b25fd3bd39d01c3ce9984"
[email protected].3:
+  version "2.3.3"
+  resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.3.3.tgz#9639f3c3b40148e8ca97fe08a51dd1891bb6be22"
 
-uglify-js@^2.6, uglify-js@^2.8.5:
+uglify-js@^2.6:
   version "2.8.15"
   resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.15.tgz#835dd4cd5872554756e6874508d0d0561704d94d"
   dependencies:
@@ -2978,6 +2965,15 @@ uglify-js@^2.6, uglify-js@^2.8.5:
   optionalDependencies:
     uglify-to-browserify "~1.0.0"
 
+uglify-js@^2.8.27:
+  version "2.8.27"
+  resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.27.tgz#47787f912b0f242e5b984343be8e35e95f694c9c"
+  dependencies:
+    source-map "~0.5.1"
+    yargs "~3.10.0"
+  optionalDependencies:
+    uglify-to-browserify "~1.0.0"
+
 uglify-to-browserify@~1.0.0:
   version "1.0.2"
   resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7"
@@ -3059,9 +3055,9 @@ webpack-sources@^0.2.3:
     source-list-map "^1.1.1"
     source-map "~0.5.3"
 
-webpack@2.5.1:
-  version "2.5.1"
-  resolved "https://registry.yarnpkg.com/webpack/-/webpack-2.5.1.tgz#61742f0cf8af555b87460a9cd8bba2f1e3ee2fce"
+webpack@2.6.0:
+  version "2.6.0"
+  resolved "https://registry.yarnpkg.com/webpack/-/webpack-2.6.0.tgz#7e650a92816abff5db5f43316b0b8b19b13d76c1"
   dependencies:
     acorn "^5.0.0"
     acorn-dynamic-import "^2.0.0"
@@ -3080,7 +3076,7 @@ [email protected]:
     source-map "^0.5.3"
     supports-color "^3.1.0"
     tapable "~0.2.5"
-    uglify-js "^2.8.5"
+    uglify-js "^2.8.27"
     watchpack "^1.3.1"
     webpack-sources "^0.2.3"
     yargs "^6.0.0"

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä