yargs-unparser
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -16,2 +16,6 @@ 'use strict'; | ||
function hasDefaultValue(key, value, defaults) { | ||
return value === defaults[key]; | ||
} | ||
function isCamelCased(key, argv) { | ||
@@ -88,2 +92,4 @@ return /[A-Z]/.test(key) && camelCase(key) === key && // Is it camel case? | ||
isAlias(key, options.alias) || | ||
// Remove default values | ||
hasDefaultValue(key, value, options.default) || | ||
// Remove camel-cased | ||
@@ -107,2 +113,3 @@ isCamelCased(key, argv)); | ||
alias: {}, | ||
default: {}, | ||
command: null, | ||
@@ -109,0 +116,0 @@ }, options); |
{ | ||
"name": "yargs-unparser", | ||
"description": "Converts back a yargs argv object to its original array form.", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "yargs", |
@@ -49,2 +49,3 @@ # yargs-unparser | ||
- `alias`: The [aliases](https://github.com/yargs/yargs-parser#requireyargs-parserargs-opts) so that duplicate options aren't generated | ||
- `default`: The [default] values so that they flags with their default values are omitted | ||
- `command`: The [command](https://github.com/yargs/yargs/blob/master/docs/advanced.md#commands) first argument so that command names and positional arguments are handled correctly | ||
@@ -51,0 +52,0 @@ |
9918
104
88