expand-args
Advanced tools
Comparing version 0.2.0 to 0.2.1
22
index.js
@@ -30,3 +30,17 @@ /*! | ||
if (Array.isArray(orig)) { | ||
res[key] = expandEach(orig); | ||
if (key !== '_') { | ||
res[key] = expandEach(orig); | ||
continue; | ||
} else { | ||
var len = orig.length, i = -1; | ||
while (++i < len) { | ||
var ele = orig[i]; | ||
if (/\W/.test(ele)) { | ||
extend(res, expand(ele)); | ||
} else { | ||
res._ = res._ || []; | ||
res._.push(ele); | ||
} | ||
} | ||
} | ||
continue; | ||
@@ -44,2 +58,3 @@ } | ||
} | ||
res[key] = orig; | ||
@@ -50,2 +65,7 @@ } | ||
function extend(a, b) { | ||
for (var key in b) a[key] = b[key]; | ||
return a; | ||
}; | ||
function expandEach(arr) { | ||
@@ -52,0 +72,0 @@ return arr.map(function (ele) { |
{ | ||
"name": "expand-args", | ||
"description": "Expand parsed command line arguments using expand-object.", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"homepage": "https://github.com/jonschlinkert/expand-args", | ||
@@ -6,0 +6,0 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", |
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
5513
65