yargs-parser
Advanced tools
Comparing version 13.1.1 to 13.1.2
23
index.js
@@ -424,3 +424,3 @@ var camelCase = require('camelcase') | ||
// handle populating aliases of the full key | ||
if (flags.aliases[key]) { | ||
if (flags.aliases[key] && flags.aliases[key].forEach) { | ||
flags.aliases[key].forEach(function (x) { | ||
@@ -663,2 +663,6 @@ x = x.split('.') | ||
keys.slice(0, -1).forEach(function (key, index) { | ||
// TODO(bcoe): in the next major version of yargs, switch to | ||
// Object.create(null) for dot notation: | ||
key = sanitizeKey(key) | ||
if (typeof o === 'object' && o[key] === undefined) { | ||
@@ -683,7 +687,9 @@ o[key] = {} | ||
var key = keys[keys.length - 1] | ||
// TODO(bcoe): in the next major version of yargs, switch to | ||
// Object.create(null) for dot notation: | ||
const key = sanitizeKey(keys[keys.length - 1]) | ||
var isTypeArray = checkAllAliases(keys.join('.'), flags.arrays) | ||
var isValueArray = Array.isArray(value) | ||
var duplicate = configuration['duplicate-arguments-array'] | ||
const isTypeArray = checkAllAliases(keys.join('.'), flags.arrays) | ||
const isValueArray = Array.isArray(value) | ||
let duplicate = configuration['duplicate-arguments-array'] | ||
@@ -906,2 +912,9 @@ // nargs has higher priority than duplicate | ||
// TODO(bcoe): in the next major version of yargs, switch to | ||
// Object.create(null) for dot notation: | ||
function sanitizeKey (key) { | ||
if (key === '__proto__') return '___proto___' | ||
return key | ||
} | ||
module.exports = Parser |
{ | ||
"name": "yargs-parser", | ||
"version": "13.1.1", | ||
"version": "13.1.2", | ||
"description": "the mighty option parser used by yargs", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
57117
823