Comparing version 4.0.1 to 4.0.2
@@ -113,3 +113,3 @@ 'use strict'; | ||
if (!Hoek.isInteger(value)) { | ||
if (!Number.isSafeInteger(value)) { | ||
errors.push(internals.formatError('Invalid value (non-number) for option:', last.name)); | ||
@@ -130,2 +130,3 @@ continue; | ||
} | ||
errors.push(internals.formatError('Invalid value for option:', last.name, '(valid: ' + validValues.join(',') + ')')); | ||
@@ -237,2 +238,3 @@ continue; | ||
} | ||
if (def.require) { | ||
@@ -251,13 +253,13 @@ formattedDesc += formattedDesc.length ? ' ' : ''; | ||
internals.formatError = function (definition) { | ||
internals.formatError = function (...args) { | ||
let msg = ''; | ||
if (arguments.length > 1) { | ||
msg = Array.prototype.slice.call(arguments, 0).join(' '); | ||
if (args.length > 1) { | ||
msg = args.join(' '); | ||
} | ||
else if (typeof definition === 'string') { | ||
msg = definition; | ||
else if (typeof args[0] === 'string') { | ||
msg = args[0]; | ||
} | ||
else { | ||
msg = exports.usage(definition); | ||
msg = exports.usage(args[0]); | ||
} | ||
@@ -264,0 +266,0 @@ |
{ | ||
"name": "bossy", | ||
"description": "Command line options parser", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"repository": "git://github.com/hapijs/bossy", | ||
@@ -14,3 +14,3 @@ "main": "lib/index.js", | ||
"engines": { | ||
"node": ">=8.9.0" | ||
"node": ">=8.12.0" | ||
}, | ||
@@ -20,7 +20,7 @@ "dependencies": { | ||
"hoek": "5.x.x", | ||
"joi": "13.x.x" | ||
"joi": "14.x.x" | ||
}, | ||
"devDependencies": { | ||
"code": "5.x.x", | ||
"lab": "15.x.x" | ||
"lab": "17.x.x" | ||
}, | ||
@@ -27,0 +27,0 @@ "scripts": { |
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
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
15483
+ Addedjoi@14.3.1(transitive)
- Removedjoi@13.7.0(transitive)
Updatedjoi@14.x.x