Skip to content

Commit

Permalink
don't coerce booleans to numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Dec 21, 2010
1 parent 964baa7 commit 13df151
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/optimist.js
Expand Up @@ -44,8 +44,7 @@ function Argv (args, cwd) {

function set (key, val) {
var num = Number(val);
// var value = typeof val === 'string' && isNaN(num) ? val : num;
var value = isNaN(num) ? val : num;
var value = typeof val !== 'string' || isNaN(num) ? val : num;

if (key in self.argv) {
if (!Array.isArray(self.argv[key])) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name" : "optimist",
"version" : "0.1.2",
"version" : "0.1.3",
"description" : "Light-weight option parsing with an argv hash. No optstrings attached.",
"modules" : {
"index" : "./lib/optimist.js",
Expand Down

0 comments on commit 13df151

Please sign in to comment.