Comparing version 3.0.2 to 3.0.3
'use strict'; | ||
function parse(value, parser) { | ||
function parse(name, value, parser) { | ||
if (typeof value !== 'string') { | ||
throw new Error(`Value to cast was not a string: ${value}`); | ||
throw new Error(`Value to cast for ${name} was not a string: ${value}`); | ||
} | ||
@@ -26,5 +26,5 @@ | ||
if (envNames.includes(optionName)) { | ||
config[optionName] = parse(env[optionName], parser); | ||
config[optionName] = parse(optionName, env[optionName], parser); | ||
} else if (!optionProperties.required) { | ||
config[optionName] = parse(optionProperties.defaultValue, parser); | ||
config[optionName] = parse(optionName, optionProperties.defaultValue, parser); | ||
} else { | ||
@@ -31,0 +31,0 @@ missingRequiredProperties.push(optionName); |
{ | ||
"name": "configeur", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"description": "Extensible parsing of environment variables into config.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
7032