yargs-parser
Advanced tools
Comparing version 13.0.0-candidate.0 to 13.0.0
@@ -5,2 +5,17 @@ # Change Log | ||
<a name="13.0.0"></a> | ||
# [13.0.0](https://github.com/yargs/yargs-parser/compare/v12.0.0...v13.0.0) (2019-02-02) | ||
### Features | ||
* don't coerce number from string with leading '0' or '+' ([#158](https://github.com/yargs/yargs-parser/issues/158)) ([18d0fd5](https://github.com/yargs/yargs-parser/commit/18d0fd5)) | ||
### BREAKING CHANGES | ||
* options with leading '+' or '0' now parse as strings | ||
<a name="12.0.0"></a> | ||
@@ -23,3 +38,3 @@ # [12.0.0](https://github.com/yargs/yargs-parser/compare/v11.1.1...v12.0.0) (2019-01-29) | ||
* a flag with no right-hand value no longer populates defaulted options with `undefined`. | ||
* quotes and beginning and endings of strings are not removed during parsing. | ||
* quotes at beginning and endings of strings are not removed during parsing. | ||
@@ -26,0 +41,0 @@ |
@@ -19,3 +19,3 @@ var camelCase = require('camelcase') | ||
'dot-notation': true, | ||
'parse-numbers': false, | ||
'parse-numbers': true, | ||
'boolean-negation': true, | ||
@@ -790,5 +790,10 @@ 'negation-prefix': 'no-', | ||
function isNumber (x) { | ||
if (x === null || x === undefined) return false | ||
// if loaded from config, may already be a number. | ||
if (typeof x === 'number') return true | ||
// hexadecimal. | ||
if (/^0x[0-9a-f]+$/i.test(x)) return true | ||
return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x) | ||
// don't treat 0123 as a number; as it drops the leading '0'. | ||
if (x.length > 1 && x[0] === '0') return false | ||
return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x) | ||
} | ||
@@ -795,0 +800,0 @@ |
{ | ||
"name": "yargs-parser", | ||
"version": "13.0.0-candidate.0", | ||
"version": "13.0.0", | ||
"description": "the mighty option parser used by yargs", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -179,3 +179,3 @@ # yargs-parser | ||
* default: `false` | ||
* default: `true` | ||
* key: `parse-numbers` | ||
@@ -182,0 +182,0 @@ |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
53893
801
0
4