Socket
Socket
Sign inDemoInstall

yargs-parser

Package Overview
Dependencies
2
Maintainers
2
Versions
83
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 13.0.0-candidate.0 to 13.0.0

17

CHANGELOG.md

@@ -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 @@

9

index.js

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc