Comparing version 14.2.2 to 14.2.3
{ | ||
"name": "yargs", | ||
"version": "14.2.2", | ||
"version": "14.2.3", | ||
"description": "yargs the modern, pirate-themed, successor to optimist.", | ||
@@ -32,3 +32,3 @@ "main": "./index.js", | ||
"y18n": "^4.0.0", | ||
"yargs-parser": "^15.0.0" | ||
"yargs-parser": "^15.0.1" | ||
}, | ||
@@ -35,0 +35,0 @@ "devDependencies": { |
11
yargs.js
@@ -241,2 +241,3 @@ 'use strict' | ||
keys.forEach((key) => { | ||
key = sanitizeKey(key) | ||
options[type].push(key) | ||
@@ -297,4 +298,4 @@ }) | ||
if (Array.isArray(key)) { | ||
const temp = Object.create(null) | ||
// an array of keys with one value ['x', 'y', 'z'], function parse () {} | ||
const temp = {} | ||
key.forEach((k) => { | ||
@@ -310,2 +311,3 @@ temp[k] = value | ||
} else { | ||
key = sanitizeKey(key) | ||
// a single key value pair 'x', parse() {} | ||
@@ -320,2 +322,9 @@ if (isArray) { | ||
// TODO(bcoe): in future major versions move more objects towards | ||
// Object.create(null): | ||
function sanitizeKey (key) { | ||
if (key === '__proto__') return '___proto___' | ||
return key | ||
} | ||
function deleteFromParserHintObject (optionKey) { | ||
@@ -322,0 +331,0 @@ // delete from all parsing hints: |
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
236321
3557
Updatedyargs-parser@^15.0.1