Sfoglia il codice sorgente

@types: added `commander` types, removed `typings` `commander` types

sanex3339 8 anni fa
parent
commit
fb9c825e34

+ 71 - 73
dist/index.js

@@ -79,7 +79,7 @@ module.exports =
 /******/ 	__webpack_require__.p = "";
 /******/
 /******/ 	// Load entry module and return exports
-/******/ 	return __webpack_require__(__webpack_require__.s = 52);
+/******/ 	return __webpack_require__(__webpack_require__.s = 60);
 /******/ })
 /************************************************************************/
 /******/ ([
@@ -93,7 +93,7 @@ var _createClass = function () { function defineProperties(target, props) { for
 
 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
-var chance_1 = __webpack_require__(47);
+var chance_1 = __webpack_require__(55);
 var JSFuck_1 = __webpack_require__(9);
 
 var Utils = function () {
@@ -1060,7 +1060,7 @@ exports.Obfuscator = Obfuscator;
 
 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
-var Joi = __webpack_require__(50);
+var Joi = __webpack_require__(58);
 var DefaultPreset_1 = __webpack_require__(16);
 var OptionsNormalizer_1 = __webpack_require__(22);
 
@@ -1259,8 +1259,8 @@ var _createClass = function () { function defineProperties(target, props) { for
 
 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
-var fs = __webpack_require__(49);
-var mkdirp = __webpack_require__(51);
+var fs = __webpack_require__(57);
+var mkdirp = __webpack_require__(59);
 var path = __webpack_require__(18);
 var Utils_1 = __webpack_require__(0);
 
@@ -1346,8 +1346,8 @@ var _createClass = function () { function defineProperties(target, props) { for
 
 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
+var commander = __webpack_require__(56);
 var path = __webpack_require__(18);
-var commander_1 = __webpack_require__(48);
 var SourceMapMode_1 = __webpack_require__(11);
 var DefaultPreset_1 = __webpack_require__(16);
 var CLIUtils_1 = __webpack_require__(24);
@@ -1395,7 +1395,7 @@ var JavaScriptObfuscatorCLI = function () {
     }, {
         key: 'configureCommands',
         value: function configureCommands() {
-            this.commands = new commander_1.Command().version(JavaScriptObfuscatorCLI.getBuildVersion(), '-v, --version').usage('<inputPath> [options]').option('-o, --output <path>', 'Output path for obfuscated code').option('--compact <boolean>', 'Disable one line output code compacting', JavaScriptObfuscatorCLI.parseBoolean).option('--debugProtection <boolean>', 'Disable browser Debug panel (can cause DevTools enabled browser freeze)', JavaScriptObfuscatorCLI.parseBoolean).option('--debugProtectionInterval <boolean>', 'Disable browser Debug panel even after page was loaded (can cause DevTools enabled browser freeze)', JavaScriptObfuscatorCLI.parseBoolean).option('--disableConsoleOutput <boolean>', 'Allow console.log, console.info, console.error and console.warn messages output into browser console', JavaScriptObfuscatorCLI.parseBoolean).option('--encodeUnicodeLiterals <boolean>', 'All literals in Unicode array become encoded in Base64 (this option can slightly slow down your code speed)', JavaScriptObfuscatorCLI.parseBoolean).option('--reservedNames <list>', 'Disable obfuscation of variable names, function names and names of function parameters that match the passed RegExp patterns (comma separated)', function (val) {
+            this.commands = new commander.Command().version(JavaScriptObfuscatorCLI.getBuildVersion(), '-v, --version').usage('<inputPath> [options]').option('-o, --output <path>', 'Output path for obfuscated code').option('--compact <boolean>', 'Disable one line output code compacting', JavaScriptObfuscatorCLI.parseBoolean).option('--debugProtection <boolean>', 'Disable browser Debug panel (can cause DevTools enabled browser freeze)', JavaScriptObfuscatorCLI.parseBoolean).option('--debugProtectionInterval <boolean>', 'Disable browser Debug panel even after page was loaded (can cause DevTools enabled browser freeze)', JavaScriptObfuscatorCLI.parseBoolean).option('--disableConsoleOutput <boolean>', 'Allow console.log, console.info, console.error and console.warn messages output into browser console', JavaScriptObfuscatorCLI.parseBoolean).option('--encodeUnicodeLiterals <boolean>', 'All literals in Unicode array become encoded in Base64 (this option can slightly slow down your code speed)', JavaScriptObfuscatorCLI.parseBoolean).option('--reservedNames <list>', 'Disable obfuscation of variable names, function names and names of function parameters that match the passed RegExp patterns (comma separated)', function (val) {
                 return val.split(',');
             }).option('--rotateUnicodeArray <boolean>', 'Disable rotation of unicode array values during obfuscation', JavaScriptObfuscatorCLI.parseBoolean).option('--selfDefending <boolean>', 'Disables self-defending for obfuscated code', JavaScriptObfuscatorCLI.parseBoolean).option('--sourceMap <boolean>', 'Enables source map generation', JavaScriptObfuscatorCLI.parseBoolean).option('--sourceMapMode <string> [inline, separate]', 'Specify source map output mode', JavaScriptObfuscatorCLI.parseSourceMapMode).option('--unicodeArray <boolean>', 'Disables gathering of all literal strings into an array and replacing every literal string with an array call', JavaScriptObfuscatorCLI.parseBoolean).option('--unicodeArrayThreshold <number>', 'The probability that the literal string will be inserted into unicodeArray (Default: 0.8, Min: 0, Max: 1)', parseFloat).option('--wrapUnicodeArrayCalls <boolean>', 'Disables usage of special access function instead of direct array call', JavaScriptObfuscatorCLI.parseBoolean).parse(this.rawArguments);
             this.commands.on('--help', function () {
@@ -1487,7 +1487,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
 
 var AppendState_1 = __webpack_require__(2);
-var ConsoleOutputDisableExpressionTemplate_1 = __webpack_require__(62);
+var ConsoleOutputDisableExpressionTemplate_1 = __webpack_require__(48);
 var Node_1 = __webpack_require__(3);
 var NodeUtils_1 = __webpack_require__(1);
 
@@ -1640,7 +1640,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
 
 var AppendState_1 = __webpack_require__(2);
-var DebugProtectionFunctionTemplate_1 = __webpack_require__(61);
+var DebugProtectionFunctionTemplate_1 = __webpack_require__(49);
 var Node_1 = __webpack_require__(3);
 var NodeUtils_1 = __webpack_require__(1);
 var Utils_1 = __webpack_require__(0);
@@ -1702,7 +1702,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
 
 var AppendState_1 = __webpack_require__(2);
 var NoCustomNodesPreset_1 = __webpack_require__(13);
-var SelfDefendingTemplate_1 = __webpack_require__(60);
+var SelfDefendingTemplate_1 = __webpack_require__(50);
 var JavaScriptObfuscator_1 = __webpack_require__(8);
 var Node_1 = __webpack_require__(3);
 var NodeUtils_1 = __webpack_require__(1);
@@ -1837,8 +1837,8 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
 
 var AppendState_1 = __webpack_require__(2);
-var SelfDefendingTemplate_1 = __webpack_require__(56);
-var UnicodeArrayDecodeTemplate_1 = __webpack_require__(57);
+var SelfDefendingTemplate_1 = __webpack_require__(51);
+var UnicodeArrayDecodeTemplate_1 = __webpack_require__(52);
 var Node_1 = __webpack_require__(3);
 var NodeUtils_1 = __webpack_require__(1);
 var Utils_1 = __webpack_require__(0);
@@ -1990,8 +1990,8 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
 
 var AppendState_1 = __webpack_require__(2);
 var NoCustomNodesPreset_1 = __webpack_require__(13);
-var SelfDefendingTemplate_1 = __webpack_require__(58);
-var UnicodeArrayRotateFunctionTemplate_1 = __webpack_require__(59);
+var SelfDefendingTemplate_1 = __webpack_require__(53);
+var UnicodeArrayRotateFunctionTemplate_1 = __webpack_require__(54);
 var JavaScriptObfuscator_1 = __webpack_require__(8);
 var Node_1 = __webpack_require__(3);
 var NodeUtils_1 = __webpack_require__(1);
@@ -2843,61 +2843,55 @@ exports.VariableDeclarationObfuscator = VariableDeclarationObfuscator;
 /* 47 */
 /***/ function(module, exports) {
 
-module.exports = require("chance");
-
-/***/ },
-/* 48 */
-/***/ function(module, exports) {
-
-module.exports = require("commander");
-
-/***/ },
-/* 49 */
-/***/ function(module, exports) {
+"use strict";
+"use strict";
 
-module.exports = require("fs");
+function AtobTemplate() {
+    return "\n        (function () {\n            var object = []['filter']['constructor']('return this')();\n            var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\n            object.atob || (\n                object.atob = function(input) {\n                    var str = String(input).replace(/=+$/, '');\n                    for (\n                        var bc = 0, bs, buffer, idx = 0, output = '';\n                        buffer = str.charAt(idx++);\n                        ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,\n                            bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0\n                    ) {\n                        buffer = chars.indexOf(buffer);\n                    }\n                return output;\n            });\n        })();\n    ";
+}
+exports.AtobTemplate = AtobTemplate;
 
 /***/ },
-/* 50 */
+/* 48 */
 /***/ function(module, exports) {
 
-module.exports = require("joi");
-
-/***/ },
-/* 51 */
-/***/ function(module, exports) {
+"use strict";
+"use strict";
 
-module.exports = require("mkdirp");
+function ConsoleOutputDisableExpressionTemplate() {
+    return "\n        (function () {\n            var _ = '(\u0004\u0006\u0003\u0005[]' + '[\"filter\"][\"\u0007tructor\"]' + '(\"return this\")()' + '.' + '\u0003;\u0006\u0002\u0005\u0004};' + '_\u0003.log\u0001.in' + 'fo\u0001.' + 'war' + 'n\u0001.er' + 'r' + 'or\u0001})();' + '\u0001\u0005_\u0002;' + '_\u0003\u0002function' + '\u0003\u0007ole\u0004\u0002 ()' + '{\u0005 = \u0006var ' + '_\u0007cons', \n                Y, \n                $;\n            \n            for (Y in $ = \"\u0007\u0006\u0005\u0004\u0003\u0002\u0001\") {\n              var arr = _.split($[Y]);\n              _ = arr.join(arr.pop());\n            }\n            \n            [][\"filter\"][\"constructor\"](_)();\n        })()\n    ";
+}
+exports.ConsoleOutputDisableExpressionTemplate = ConsoleOutputDisableExpressionTemplate;
 
 /***/ },
-/* 52 */
+/* 49 */
 /***/ function(module, exports, __webpack_require__) {
 
 "use strict";
 "use strict";
 
-var JavaScriptObfuscator_1 = __webpack_require__(8);
-if (!global._babelPolyfill) {
-    __webpack_require__(19);
+var Utils_1 = __webpack_require__(0);
+function DebugProtectionFunctionTemplate(debugProtectionFunctionName) {
+    return "\n        var " + debugProtectionFunctionName + " = function () {\n            function debuggerProtection (counter) {\n                if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n                    (function () {}.constructor('debugger')());\n                } else {\n                    [].filter.constructor(" + Utils_1.Utils.stringToJSFuck('debugger') + ")();\n                }\n                \n                debuggerProtection(++counter);\n            }\n            \n            try {\n                debuggerProtection(0);\n            } catch (y) {}\n        };\n    ";
 }
-module.exports = JavaScriptObfuscator_1.JavaScriptObfuscator;
+exports.DebugProtectionFunctionTemplate = DebugProtectionFunctionTemplate;
 
 /***/ },
-/* 53 */,
-/* 54 */,
-/* 55 */
-/***/ function(module, exports) {
+/* 50 */
+/***/ function(module, exports, __webpack_require__) {
 
 "use strict";
 "use strict";
 
-function AtobTemplate() {
-    return "\n        (function () {\n            var object = []['filter']['constructor']('return this')();\n            var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\n            object.atob || (\n                object.atob = function(input) {\n                    var str = String(input).replace(/=+$/, '');\n                    for (\n                        var bc = 0, bs, buffer, idx = 0, output = '';\n                        buffer = str.charAt(idx++);\n                        ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,\n                            bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0\n                    ) {\n                        buffer = chars.indexOf(buffer);\n                    }\n                return output;\n            });\n        })();\n    ";
+var JSFuck_1 = __webpack_require__(9);
+var Utils_1 = __webpack_require__(0);
+function SelfDefendingTemplate() {
+    return "\n        (function () {                                \n            var func = function(){return " + Utils_1.Utils.stringToUnicode('dev') + ";},\n                func2 = function () {\n                    return 'window';\n                };\n        \n            !Function(" + Utils_1.Utils.stringToUnicode("return/\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}/") + ")().test(func.toString()) ? Function(" + Utils_1.Utils.stringToUnicode("return/(\\\\[x|u](\\w){2,4})+/") + ")().test(func2.toString()) ? []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(" + JSFuck_1.JSFuck.False + "){}')() : []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(" + JSFuck_1.JSFuck.True + "){}')() : []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(" + JSFuck_1.JSFuck.False + "){}')();\n        })();\n    ";
 }
-exports.AtobTemplate = AtobTemplate;
+exports.SelfDefendingTemplate = SelfDefendingTemplate;
 
 /***/ },
-/* 56 */
+/* 51 */
 /***/ function(module, exports, __webpack_require__) {
 
 "use strict";
@@ -2912,14 +2906,14 @@ function SelfDefendingTemplate(unicodeArrayName, forLoopFunctionName) {
 exports.SelfDefendingTemplate = SelfDefendingTemplate;
 
 /***/ },
-/* 57 */
+/* 52 */
 /***/ function(module, exports, __webpack_require__) {
 
 "use strict";
 "use strict";
 
 var NoCustomNodesPreset_1 = __webpack_require__(13);
-var AtobTemplate_1 = __webpack_require__(55);
+var AtobTemplate_1 = __webpack_require__(47);
 var JavaScriptObfuscator_1 = __webpack_require__(8);
 var Utils_1 = __webpack_require__(0);
 function UnicodeArrayDecodeTemplate(code, unicodeArrayName, forLoopFunctionName) {
@@ -2930,7 +2924,7 @@ function UnicodeArrayDecodeTemplate(code, unicodeArrayName, forLoopFunctionName)
 exports.UnicodeArrayDecodeTemplate = UnicodeArrayDecodeTemplate;
 
 /***/ },
-/* 58 */
+/* 53 */
 /***/ function(module, exports, __webpack_require__) {
 
 "use strict";
@@ -2944,7 +2938,7 @@ function SelfDefendingTemplate(whileFunctionName, timesName) {
 exports.SelfDefendingTemplate = SelfDefendingTemplate;
 
 /***/ },
-/* 59 */
+/* 54 */
 /***/ function(module, exports, __webpack_require__) {
 
 "use strict";
@@ -2959,43 +2953,47 @@ function UnicodeArrayRotateFunctionTemplate(code, unicodeArrayName, unicodeArray
 exports.UnicodeArrayRotateFunctionTemplate = UnicodeArrayRotateFunctionTemplate;
 
 /***/ },
-/* 60 */
-/***/ function(module, exports, __webpack_require__) {
+/* 55 */
+/***/ function(module, exports) {
 
-"use strict";
-"use strict";
+module.exports = require("chance");
 
-var JSFuck_1 = __webpack_require__(9);
-var Utils_1 = __webpack_require__(0);
-function SelfDefendingTemplate() {
-    return "\n        (function () {                                \n            var func = function(){return " + Utils_1.Utils.stringToUnicode('dev') + ";},\n                func2 = function () {\n                    return 'window';\n                };\n        \n            !Function(" + Utils_1.Utils.stringToUnicode("return/\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}/") + ")().test(func.toString()) ? Function(" + Utils_1.Utils.stringToUnicode("return/(\\\\[x|u](\\w){2,4})+/") + ")().test(func2.toString()) ? []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(" + JSFuck_1.JSFuck.False + "){}')() : []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(" + JSFuck_1.JSFuck.True + "){}')() : []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(" + JSFuck_1.JSFuck.False + "){}')();\n        })();\n    ";
-}
-exports.SelfDefendingTemplate = SelfDefendingTemplate;
+/***/ },
+/* 56 */
+/***/ function(module, exports) {
+
+module.exports = require("commander");
 
 /***/ },
-/* 61 */
-/***/ function(module, exports, __webpack_require__) {
+/* 57 */
+/***/ function(module, exports) {
 
-"use strict";
-"use strict";
+module.exports = require("fs");
 
-var Utils_1 = __webpack_require__(0);
-function DebugProtectionFunctionTemplate(debugProtectionFunctionName) {
-    return "\n        var " + debugProtectionFunctionName + " = function () {\n            function debuggerProtection (counter) {\n                if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n                    (function () {}.constructor('debugger')());\n                } else {\n                    [].filter.constructor(" + Utils_1.Utils.stringToJSFuck('debugger') + ")();\n                }\n                \n                debuggerProtection(++counter);\n            }\n            \n            try {\n                debuggerProtection(0);\n            } catch (y) {}\n        };\n    ";
-}
-exports.DebugProtectionFunctionTemplate = DebugProtectionFunctionTemplate;
+/***/ },
+/* 58 */
+/***/ function(module, exports) {
+
+module.exports = require("joi");
 
 /***/ },
-/* 62 */
+/* 59 */
 /***/ function(module, exports) {
 
+module.exports = require("mkdirp");
+
+/***/ },
+/* 60 */
+/***/ function(module, exports, __webpack_require__) {
+
 "use strict";
 "use strict";
 
-function ConsoleOutputDisableExpressionTemplate() {
-    return "\n        (function () {\n            var _ = '(\u0004\u0006\u0003\u0005[]' + '[\"filter\"][\"\u0007tructor\"]' + '(\"return this\")()' + '.' + '\u0003;\u0006\u0002\u0005\u0004};' + '_\u0003.log\u0001.in' + 'fo\u0001.' + 'war' + 'n\u0001.er' + 'r' + 'or\u0001})();' + '\u0001\u0005_\u0002;' + '_\u0003\u0002function' + '\u0003\u0007ole\u0004\u0002 ()' + '{\u0005 = \u0006var ' + '_\u0007cons', \n                Y, \n                $;\n            \n            for (Y in $ = \"\u0007\u0006\u0005\u0004\u0003\u0002\u0001\") {\n              var arr = _.split($[Y]);\n              _ = arr.join(arr.pop());\n            }\n            \n            [][\"filter\"][\"constructor\"](_)();\n        })()\n    ";
+var JavaScriptObfuscator_1 = __webpack_require__(8);
+if (!global._babelPolyfill) {
+    __webpack_require__(19);
 }
-exports.ConsoleOutputDisableExpressionTemplate = ConsoleOutputDisableExpressionTemplate;
+module.exports = JavaScriptObfuscator_1.JavaScriptObfuscator;
 
 /***/ }
 /******/ ]);

+ 1 - 0
package.json

@@ -33,6 +33,7 @@
   "devDependencies": {
     "@types/chai": "^3.4.27-alpha",
     "@types/chance": "^0.7.27-alpha",
+    "@types/commander": "^2.3.28",
     "@types/esprima": "^2.1.27-alpha",
     "@types/joi": "^6.5.27-alpha",
     "@types/mkdirp": "^0.3.27-alpha",

+ 1 - 0
src/cli/CLIUtils.ts

@@ -1,3 +1,4 @@
+import * as commander from 'commander';
 import * as fs from 'fs';
 import * as mkdirp from 'mkdirp';
 import * as path from 'path';

+ 2 - 2
src/cli/JavaScriptObfuscatorCLI.ts

@@ -1,6 +1,6 @@
+import * as commander from 'commander';
 import * as path from 'path';
 
-import { Command } from 'commander';
 
 import { IObfuscationResult } from "../interfaces/IObfuscationResult";
 import { IObfuscatorOptions } from "../interfaces/IObfuscatorOptions";
@@ -119,7 +119,7 @@ export class JavaScriptObfuscatorCLI {
     }
 
     private configureCommands (): void {
-        this.commands = new Command()
+        this.commands = new commander.Command()
             .version(JavaScriptObfuscatorCLI.getBuildVersion(), '-v, --version')
             .usage('<inputPath> [options]')
             .option('-o, --output <path>', 'Output path for obfuscated code')

+ 1 - 0
tsconfig-test.json

@@ -14,6 +14,7 @@
     "types": [
       "chai",
       "chance",
+      "commander",
       "esprima",
       "joi",
       "mkdirp",

+ 1 - 0
tsconfig.json

@@ -12,6 +12,7 @@
     "types": [
       "chai",
       "chance",
+      "commander",
       "esprima",
       "joi",
       "mkdirp",

+ 0 - 1
typings.json

@@ -2,7 +2,6 @@
   "name": "javascript-obfuscator",
   "version": false,
   "globalDependencies": {
-    "commander": "github:DefinitelyTyped/DefinitelyTyped/commander/commander.d.ts",
     "escodegen": "github:DefinitelyTyped/DefinitelyTyped/escodegen/escodegen.d.ts",
     "estraverse": "github:DefinitelyTyped/DefinitelyTyped/estraverse/estraverse.d.ts"
   }

+ 0 - 407
typings/globals/commander/index.d.ts

@@ -1,407 +0,0 @@
-// Generated by typings
-// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/commander/commander.d.ts
-declare namespace commander {
-    interface ICommandStatic {
-        /**
-         * Initialize a new `Command`.
-         *
-         * @param {String} name
-         * @api public
-         */
-        new (name?:string):ICommand;
-    }
-
-    interface ICommand extends NodeJS.EventEmitter {
-        args: string[];
-        _args: { required:boolean; name: string; }[];
-
-        /**
-         * Add command `name`.
-         *
-         * The `.action()` callback is invoked when the
-         * command `name` is specified via __ARGV__,
-         * and the remaining arguments are applied to the
-         * function for access.
-         *
-         * When the `name` is "*" an un-matched command
-         * will be passed as the first arg, followed by
-         * the rest of __ARGV__ remaining.
-         *
-         * Examples:
-         *
-         *      program
-         *        .version('0.0.1')
-         *        .option('-C, --chdir <path>', 'change the working directory')
-         *        .option('-c, --config <path>', 'set config path. defaults to ./deploy.conf')
-         *        .option('-T, --no-tests', 'ignore test hook')
-         *
-         *      program
-         *        .command('setup')
-         *        .description('run remote setup commands')
-         *        .action(function(){
-         *          console.log('setup');
-         *        });
-         *
-         *      program
-         *        .command('exec <cmd>')
-         *        .description('run the given remote command')
-         *        .action(function(cmd){
-         *          console.log('exec "%s"', cmd);
-         *        });
-         *
-         *      program
-         *        .command('*')
-         *        .description('deploy the given env')
-         *        .action(function(env){
-         *          console.log('deploying "%s"', env);
-         *        });
-         *
-         *      program.parse(process.argv);
-         *
-         * @param {String} name
-         * @param {String} [desc]
-         * @param {Mixed} [opts]
-         * @return {Command} the new command
-         * @api public
-         */
-        command(name:string, desc?:string, opts?: any):ICommand;
-
-        /**
-         * Add an implicit `help [cmd]` subcommand
-         * which invokes `--help` for the given command.
-         *
-         * @api private
-         */
-        addImplicitHelpCommand():void;
-
-        /**
-         * Parse expected `args`.
-         *
-         * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`.
-         *
-         * @param {Array} args
-         * @return {Command} for chaining
-         * @api public
-         */
-        parseExpectedArgs(args:string[]):ICommand;
-
-        /**
-         * Register callback `fn` for the command.
-         *
-         * Examples:
-         *
-         *      program
-         *        .command('help')
-         *        .description('display verbose help')
-         *        .action(function(){
-         *           // output help here
-         *        });
-         *
-         * @param {Function} fn
-         * @return {Command} for chaining
-         * @api public
-         */
-        action(fn:(...args:any[])=>void):ICommand;
-
-        /**
-         * Define option with `flags`, `description` and optional
-         * coercion `fn`.
-         *
-         * The `flags` string should contain both the short and long flags,
-         * separated by comma, a pipe or space. The following are all valid
-         * all will output this way when `--help` is used.
-         *
-         *    "-p, --pepper"
-         *    "-p|--pepper"
-         *    "-p --pepper"
-         *
-         * Examples:
-         *
-         *     // simple boolean defaulting to false
-         *     program.option('-p, --pepper', 'add pepper');
-         *
-         *     --pepper
-         *     program.pepper
-         *     // => Boolean
-         *
-         *     // simple boolean defaulting to true
-         *     program.option('-C, --no-cheese', 'remove cheese');
-         *
-         *     program.cheese
-         *     // => true
-         *
-         *     --no-cheese
-         *     program.cheese
-         *     // => false
-         *
-         *     // required argument
-         *     program.option('-C, --chdir <path>', 'change the working directory');
-         *
-         *     --chdir /tmp
-         *     program.chdir
-         *     // => "/tmp"
-         *
-         *     // optional argument
-         *     program.option('-c, --cheese [type]', 'add cheese [marble]');
-         *
-         * @param {String} flags
-         * @param {String} description
-         * @param {Function|Mixed} fn or default
-         * @param {Mixed} defaultValue
-         * @return {Command} for chaining
-         * @api public
-         */
-        option(flags:string, description?:string, fn?:((arg1:any, arg2:any)=>void)|RegExp, defaultValue?:any):ICommand;
-        option(flags:string, description?:string, defaultValue?:any):ICommand;
-
-        /**
-         * Allow unknown options on the command line.
-         *
-         * @param {Boolean} arg if `true` or omitted, no error will be thrown
-         * for unknown options.
-         * @api public
-         */
-        allowUnknownOption(arg?: boolean):ICommand;
-
-        /**
-         * Parse `argv`, settings options and invoking commands when defined.
-         *
-         * @param {Array} argv
-         * @return {Command} for chaining
-         * @api public
-         */
-        parse(argv:string[]):ICommand;
-
-        /**
-         * Execute a sub-command executable.
-         *
-         * @param {Array} argv
-         * @param {Array} args
-         * @param {Array} unknown
-         * @api private
-         */
-        executeSubCommand(argv:string[], args:string[], unknown:string[]):any; /* child_process.ChildProcess */
-
-        /**
-         * Normalize `args`, splitting joined short flags. For example
-         * the arg "-abc" is equivalent to "-a -b -c".
-         * This also normalizes equal sign and splits "--abc=def" into "--abc def".
-         *
-         * @param {Array} args
-         * @return {Array}
-         * @api private
-         */
-        normalize(args:string[]):string[];
-
-        /**
-         * Parse command `args`.
-         *
-         * When listener(s) are available those
-         * callbacks are invoked, otherwise the "*"
-         * event is emitted and those actions are invoked.
-         *
-         * @param {Array} args
-         * @return {Command} for chaining
-         * @api private
-         */
-        parseArgs(args:string[], unknown:string[]):ICommand;
-
-        /**
-         * Return an option matching `arg` if any.
-         *
-         * @param {String} arg
-         * @return {Option}
-         * @api private
-         */
-        optionFor(arg:string):IOption;
-
-        /**
-         * Parse options from `argv` returning `argv`
-         * void of these options.
-         *
-         * @param {Array} argv
-         * @return {Array}
-         * @api public
-         */
-        parseOptions(argv:string[]): {args:string[]; unknown:string[];};
-
-        /**
-         * Return an object containing options as key-value pairs
-         *
-         * @return {Object}
-         * @api public
-         */
-        opts():any;
-
-        /**
-         * Argument `name` is missing.
-         *
-         * @param {String} name
-         * @api private
-         */
-        missingArgument(name:string):void;
-
-        /**
-         * `Option` is missing an argument, but received `flag` or nothing.
-         *
-         * @param {String} option
-         * @param {String} flag
-         * @api private
-         */
-        optionMissingArgument(option:{flags:string;}, flag?:string):void;
-
-        /**
-         * Unknown option `flag`.
-         *
-         * @param {String} flag
-         * @api private
-         */
-        unknownOption(flag:string):void;
-
-        /**
-         * Set the program version to `str`.
-         *
-         * This method auto-registers the "-V, --version" flag
-         * which will print the version number when passed.
-         *
-         * @param {String} str
-         * @param {String} flags
-         * @return {Command} for chaining
-         * @api public
-         */
-        version(str:string, flags?:string):ICommand;
-
-        /**
-         * Set the description to `str`.
-         *
-         * @param {String} str
-         * @return {String|Command}
-         * @api public
-         */
-        description(str:string):ICommand;
-        description():string;
-
-        /**
-         * Set an alias for the command
-         *
-         * @param {String} alias
-         * @return {String|Command}
-         * @api public
-         */
-        alias(alias:string):ICommand;
-        alias():string;
-
-        /**
-         * Set / get the command usage `str`.
-         *
-         * @param {String} str
-         * @return {String|Command}
-         * @api public
-         */
-        usage(str:string):ICommand;
-        usage():string;
-
-        /**
-         * Get the name of the command
-         *
-         * @param {String} name
-         * @return {String|Command}
-         * @api public
-         */
-        name():string;
-
-        /**
-         * Return the largest option length.
-         *
-         * @return {Number}
-         * @api private
-         */
-        largestOptionLength():number;
-
-        /**
-         * Return help for options.
-         *
-         * @return {String}
-         * @api private
-         */
-        optionHelp():string;
-
-        /**
-         * Return command help documentation.
-         *
-         * @return {String}
-         * @api private
-         */
-        commandHelp():string;
-
-        /**
-         * Return program help documentation.
-         *
-         * @return {String}
-         * @api private
-         */
-        helpInformation():string;
-
-        /**
-         * Output help information for this command
-         *
-         * @api public
-         */
-        outputHelp():void;
-
-        /**
-         * Output help information and exit.
-         *
-         * @api public
-         */
-        help():void;
-    }
-
-    interface IOptionStatic {
-        /**
-         * Initialize a new `Option` with the given `flags` and `description`.
-         *
-         * @param {String} flags
-         * @param {String} description
-         * @api public
-         */
-        new (flags:string, description?:string):IOption;
-    }
-
-    interface IOption {
-        flags:string;
-        required:boolean;
-        optional:boolean;
-        bool:boolean;
-        short?:string;
-        long:string;
-        description:string;
-
-        /**
-         * Return option name.
-         *
-         * @return {String}
-         * @api private
-         */
-        name():string;
-
-        /**
-         * Check if `arg` matches the short or long flag.
-         *
-         * @param {String} arg
-         * @return {Boolean}
-         * @api private
-         */
-        is(arg:string):boolean;
-    }
-
-    interface IExportedCommand extends ICommand {
-        Command: commander.ICommandStatic;
-        Option: commander.IOptionStatic;
-    }
-}
-
-declare module "commander" {
-    var _tmp:commander.IExportedCommand;
-    export = _tmp;
-}

+ 0 - 8
typings/globals/commander/typings.json

@@ -1,8 +0,0 @@
-{
-  "resolution": "main",
-  "tree": {
-    "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/commander/commander.d.ts",
-    "raw": "github:DefinitelyTyped/DefinitelyTyped/commander/commander.d.ts",
-    "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/commander/commander.d.ts"
-  }
-}

+ 0 - 1
typings/index.d.ts

@@ -1,3 +1,2 @@
-/// <reference path="globals/commander/index.d.ts" />
 /// <reference path="globals/escodegen/index.d.ts" />
 /// <reference path="globals/estraverse/index.d.ts" />