Comparing version 1.8.1 to 1.8.2-67-fix-ignored-error-in-async-action-functions-6d532b2a9ec102a60f57eb0e28a30849855ff6d6
@@ -5,4 +5,2 @@ var Command, Option, Signature, _, parse, settings, state, utils; | ||
_.str = require('underscore.string'); | ||
parse = require('./parse'); | ||
@@ -35,3 +33,7 @@ | ||
this.options = []; | ||
_.each(options.options, this.option, this); | ||
_.forEach(options.options, (function(_this) { | ||
return function(option) { | ||
return _this.option(option); | ||
}; | ||
})(this)); | ||
_.extend(this, _.omit(options, 'options')); | ||
@@ -93,2 +95,3 @@ } | ||
return _this.applyPermissions(function(error) { | ||
var actionPromise; | ||
if (error != null) { | ||
@@ -98,3 +101,12 @@ return typeof callback === "function" ? callback(error) : void 0; | ||
try { | ||
_this.action(params, parsedOptions, callback); | ||
actionPromise = _this.action(params, parsedOptions, callback); | ||
if (actionPromise != null) { | ||
if (typeof actionPromise["catch"] === "function") { | ||
actionPromise["catch"](function(_error) { | ||
if (_error) { | ||
return typeof callback === "function" ? callback(_error) : void 0; | ||
} | ||
}); | ||
} | ||
} | ||
} catch (error1) { | ||
@@ -101,0 +113,0 @@ error = error1; |
@@ -58,3 +58,3 @@ var Option, Signature, _, isValidAlias, parse; | ||
} | ||
return !_.any([this.boolean && !_.isBoolean(value), !this.boolean && _.isBoolean(value)]); | ||
return !_.some([this.boolean && !_.isBoolean(value), !this.boolean && _.isBoolean(value)]); | ||
}; | ||
@@ -61,0 +61,0 @@ |
@@ -52,3 +52,3 @@ var Parameter, REGEX_MULTIWORD, REGEX_OPTIONAL, REGEX_REQUIRED, REGEX_STDIN, REGEX_VARIADIC, STDIN_CHARACTER, _, parse; | ||
Parameter.prototype.isWord = function() { | ||
return !_.any([this.isRequired(), this.isOptional()]); | ||
return !_.some([this.isRequired(), this.isOptional()]); | ||
}; | ||
@@ -55,0 +55,0 @@ |
@@ -5,4 +5,2 @@ var Parameter, Signature, _, appearedMoreThanOnce, async, isLastOne, parse, settings, utils; | ||
_.str = require('underscore.string'); | ||
async = require('async'); | ||
@@ -37,3 +35,7 @@ | ||
this.parameters = []; | ||
_.each(parse.split(signature), this._addParameter, this); | ||
_.forEach(parse.split(signature), (function(_this) { | ||
return function(word) { | ||
return _this._addParameter(word); | ||
}; | ||
})(this)); | ||
if (this.allowsStdin()) { | ||
@@ -70,3 +72,3 @@ isStdin = function(parameter) { | ||
Signature.prototype.hasParameters = function() { | ||
return _.any(this.parameters, function(parameter) { | ||
return _.some(this.parameters, function(parameter) { | ||
return !parameter.isWord(); | ||
@@ -77,3 +79,3 @@ }); | ||
Signature.prototype.hasVariadicParameters = function() { | ||
return _.any(this.parameters, function(parameter) { | ||
return _.some(this.parameters, function(parameter) { | ||
return parameter.isVariadic(); | ||
@@ -84,3 +86,3 @@ }); | ||
Signature.prototype.allowsStdin = function() { | ||
return _.any(this.parameters, function(parameter) { | ||
return _.some(this.parameters, function(parameter) { | ||
return parameter.allowsStdin(); | ||
@@ -102,3 +104,3 @@ }); | ||
Signature.prototype.isWildcard = function() { | ||
return _.all([this.parameters.length === 1, this.parameters[0].toString() === settings.signatures.wildcard]); | ||
return _.every([this.parameters.length === 1, this.parameters[0].toString() === settings.signatures.wildcard]); | ||
}; | ||
@@ -111,3 +113,3 @@ | ||
} | ||
if (_.str.startsWith(error.message, 'Missing')) { | ||
if (_.startsWith(error.message, 'Missing')) { | ||
return callback(true); | ||
@@ -114,0 +116,0 @@ } |
@@ -7,2 +7,7 @@ # Change Log | ||
## 1.8.2 - 2018-11-12 | ||
* Fix ignored error in async action functions [Paulo Castro] | ||
* Dependencies: Update lodash and underscore.string packages [Lucian Buzzo] | ||
## v1.8.1 - 2018-08-28 | ||
@@ -9,0 +14,0 @@ |
{ | ||
"name": "capitano", | ||
"version": "1.8.1", | ||
"version": "1.8.2-67-fix-ignored-error-in-async-action-functions-6d532b2a9ec102a60f57eb0e28a30849855ff6d6", | ||
"description": "Powerful, non opitionated command line parser for serious applications", | ||
@@ -44,6 +44,6 @@ "main": "build/capitano.js", | ||
"is-elevated": "^1.0.0", | ||
"lodash": "~3.9.1", | ||
"underscore.string": "~3.0.3", | ||
"lodash": "~4.17.10", | ||
"underscore.string": "~3.3.4", | ||
"yargs-parser": "^2.4.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
154599
795
1
1
+ Addedlodash@4.17.21(transitive)
+ Addedsprintf-js@1.1.3(transitive)
+ Addedunderscore.string@3.3.6(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
- Removedlodash@3.9.3(transitive)
- Removedunderscore.string@3.0.3(transitive)
Updatedlodash@~4.17.10
Updatedunderscore.string@~3.3.4