commander 3.0.1 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/index.js +3 -3
  3. package/package.json +6 -6
package/CHANGELOG.md CHANGED
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). (Format adopted after v3.0.0.)
7
7
 
8
+ ## [3.0.2] (2019-09-27)
9
+
10
+ ### Fixed
11
+
12
+ * Improve tracking of executable subcommands.
13
+
14
+ ### Changed
15
+
16
+ * update development dependencies
17
+
8
18
  ## [3.0.1] (2019-08-30)
9
19
 
10
20
  ### Added
package/index.js CHANGED
@@ -97,7 +97,7 @@ Option.prototype.is = function(arg) {
97
97
  function Command(name) {
98
98
  this.commands = [];
99
99
  this.options = [];
100
- this._execs = {};
100
+ this._execs = new Set();
101
101
  this._allowUnknownOption = false;
102
102
  this._args = [];
103
103
  this._name = name || '';
@@ -149,7 +149,7 @@ Command.prototype.command = function(nameAndArgs, actionOptsOrExecDesc, execOpts
149
149
  if (desc) {
150
150
  cmd.description(desc);
151
151
  this.executables = true;
152
- this._execs[cmd._name] = true;
152
+ this._execs.add(cmd._name);
153
153
  if (opts.isDefault) this.defaultExecutable = cmd._name;
154
154
  }
155
155
  cmd._noHelp = !!opts.noHelp;
@@ -498,7 +498,7 @@ Command.prototype.parse = function(argv) {
498
498
  });
499
499
  }
500
500
 
501
- if (this._execs[name] && typeof this._execs[name] !== 'function') {
501
+ if (this._execs.has(name)) {
502
502
  return this.executeSubCommand(argv, args, parsed.unknown, subCommand ? subCommand._executableFile : undefined);
503
503
  }
504
504
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commander",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "the complete solution for node.js command-line programs",
5
5
  "keywords": [
6
6
  "commander",
@@ -26,13 +26,13 @@
26
26
  ],
27
27
  "dependencies": {},
28
28
  "devDependencies": {
29
- "@types/node": "^12.7.2",
30
- "eslint": "^6.1.0",
29
+ "@types/node": "^12.7.8",
30
+ "eslint": "^6.4.0",
31
31
  "should": "^13.2.3",
32
- "sinon": "^7.4.1",
32
+ "sinon": "^7.5.0",
33
33
  "standard": "^13.1.0",
34
- "ts-node": "^8.3.0",
35
- "typescript": "^3.5.3"
34
+ "ts-node": "^8.4.1",
35
+ "typescript": "^3.6.3"
36
36
  },
37
37
  "typings": "typings/index.d.ts"
38
38
  }