Comparing version 0.0.12 to 0.0.14
@@ -26,7 +26,9 @@ // defaults, types, and shorthands. | ||
if (typeof val === "number") { | ||
data[k] = "0" + val.toString(8) | ||
data[k] = val | ||
return true | ||
} | ||
if (typeof val === "string") { | ||
if (val.charAt(0) !== "0" || isNaN(val)) return false | ||
data[k] = "0" + parseInt(val, 8).toString(8) | ||
data[k] = parseInt(val, 8).toString(8) | ||
} | ||
@@ -33,0 +35,0 @@ } |
@@ -284,4 +284,4 @@ | ||
var isString = -1 !== typeList.indexOf(String) | ||
var isNumber = -1 !== typeList.indexOf(Number) || | ||
-1 !== typeList.indexOf(Octal) | ||
var isOctal = -1 !== typeList.indexOf(Octal) | ||
var isNumber = isOctal || (-1 !== typeList.indexOf(Number)) | ||
@@ -314,3 +314,3 @@ f = (''+f).trim() | ||
if (isNumber && !isNaN(f)) | ||
f = +f | ||
f = isOctal ? parseInt(f, 8) : +f | ||
@@ -317,0 +317,0 @@ return f |
{ | ||
"name": "npmconf", | ||
"version": "0.0.12", | ||
"version": "0.0.14", | ||
"description": "The config thing npm uses", | ||
@@ -14,3 +14,4 @@ "main": "npmconf.js", | ||
"mkdirp": "~0.3.3", | ||
"osenv": "0.0.3" | ||
"osenv": "0.0.3", | ||
"nopt": "~2.0.0" | ||
}, | ||
@@ -33,6 +34,3 @@ "devDependencies": {}, | ||
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)", | ||
"license": "BSD", | ||
"optionalDependencies": { | ||
"nopt": "~2.0.0" | ||
} | ||
"license": "BSD" | ||
} |
@@ -37,3 +37,3 @@ var test = require('tap').test | ||
var cli = { foo: 'bar' } | ||
var cli = { foo: 'bar', umask: 022 } | ||
@@ -71,4 +71,5 @@ var expectList = | ||
t.equal(conf.root, npmconf.defs.defaults) | ||
t.equal(conf.get('umask'), 022) | ||
t.end() | ||
}) | ||
}) |
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
31240
873
+ Addednopt@~2.0.0