Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Parse true/false/null/undefined config values before path interpolation.

  • Loading branch information...
commit 19bf596460e94335728645a7419e4fc73effa402 1 parent 100f137
@chromakode chromakode authored isaacs committed
Showing with 7 additions and 7 deletions.
  1. +7 −7 lib/utils/ini.js
View
14 lib/utils/ini.js
@@ -110,7 +110,13 @@ function parseField (f, k) {
// type can be an array or single thing.
var isPath = -1 !== [].concat(parseArgs.types[k]).indexOf(path)
f = (""+f).trim()
- if (f === "") f = true
+ if (f === "") return f = true
+ switch (f) {
+ case "true": return f = true
+ case "false": return f = false
+ case "null": return f = null
+ case "undefined": return f = undefined
+ }
if (isPath) {
if (f.substr(0, 2) === "~/" && process.env.HOME) {
f = path.join(process.env.HOME, f.substr(2))
@@ -119,12 +125,6 @@ function parseField (f, k) {
f = path.join(process.cwd(), f.substr(2))
}
}
- switch (f) {
- case "true": f = true; break
- case "false": f = false; break
- case "null": f = null; break
- case "undefined": f = undefined; break
- }
return f
}
Please sign in to comment.
Something went wrong with that request. Please try again.