@npmcli/config
Advanced tools
Comparing version 1.2.3 to 1.2.4
@@ -18,3 +18,3 @@ // Parse a field, coercing it to the best type available. | ||
const isBool = typeList.has(typeDefs.Boolean.type) | ||
const isString = typeList.has(typeDefs.String.type) | ||
const isString = isPath || typeList.has(typeDefs.String.type) | ||
const isUmask = typeList.has(typeDefs.Umask.type) | ||
@@ -42,3 +42,3 @@ const isNumber = typeList.has(typeDefs.Number.type) | ||
// otherwise, parse these values out | ||
if (!isString) { | ||
if (!isString && !isPath && !isNumber) { | ||
switch (f) { | ||
@@ -45,0 +45,0 @@ case 'true': return true |
@@ -13,2 +13,9 @@ const nopt = require('nopt') | ||
const noptValidatePath = nopt.typeDefs.path.validate | ||
const validatePath = (data, k, val) => { | ||
if (typeof val !== 'string') | ||
return false | ||
return noptValidatePath(data, k, val) | ||
} | ||
// add descriptions so we can validate more usefully | ||
@@ -33,2 +40,3 @@ module.exports = { | ||
...nopt.typeDefs.path, | ||
validate: validatePath, | ||
description: 'valid filesystem path', | ||
@@ -35,0 +43,0 @@ }, |
{ | ||
"name": "@npmcli/config", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"files": [ | ||
@@ -5,0 +5,0 @@ "lib" |
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
43218
939