Comparing version 2.0.0 to 3.0.0
@@ -12,3 +12,3 @@ 'use strict'; | ||
module.exports = function processConfig(schema, env, parsers) { | ||
const config = new Map(); | ||
const config = Object.create(null); | ||
const envNames = Object.getOwnPropertyNames(env); | ||
@@ -27,5 +27,5 @@ const missingRequiredProperties = []; | ||
if (envNames.includes(optionName)) { | ||
config.set(optionName, parse(env[optionName], parser)); | ||
config[optionName] = parse(env[optionName], parser); | ||
} else if (!optionProperties.required) { | ||
config.set(optionName, parse(optionProperties.defaultValue, parser)); | ||
config[optionName] = parse(optionProperties.defaultValue, parser); | ||
} else { | ||
@@ -40,3 +40,3 @@ missingRequiredProperties.push(optionName); | ||
return config; | ||
return Object.freeze(config); | ||
}; |
{ | ||
"name": "configeur", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"description": "Extensible parsing of environment variables into config.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -38,5 +38,11 @@ # configeur | ||
The above, assuming no values are read from the environment, will assign | ||
config.js a `Map` instance with one key `PORT` with a value of `8000`. | ||
The above, assuming no values are read from the environment, will assign to | ||
config.js: | ||
```javascript | ||
{ | ||
PORT: 8000 | ||
} | ||
``` | ||
Fields used to configure a config variable are: | ||
@@ -43,0 +49,0 @@ |
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
80
6440