diff --git a/package.json b/package.json index 31d01d691..3873fd11b 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "string-width": "^3.0.0", "which-module": "^2.0.0", "y18n": "^4.0.0", - "yargs-parser": "^12.0.0" + "yargs-parser": "^13.0.0" }, "devDependencies": { "chai": "^4.2.0", diff --git a/test/command.js b/test/command.js index 04ba5e383..9c394ce61 100644 --- a/test/command.js +++ b/test/command.js @@ -1458,4 +1458,11 @@ describe('Command', () => { return done() }) }) + + // see: https://github.com/yargs/yargs/issues/1099 + it('does not coerce number from positional with leading "+"', () => { + const argv = yargs.command('$0 ', '', (yargs) => {}) + .parse('+5550100') + argv.phone.should.equal('+5550100') + }) })