Comparing version 3.0.3 to 3.1.0
@@ -14,5 +14,6 @@ interface EnvironmentSpec { | ||
interface Options { | ||
parsers?: Parser[] | ||
parsers?: Parser[], | ||
mutable?: Boolean | ||
} | ||
export default function configeur(environment: Environment, options?: Options): Object; |
@@ -7,5 +7,5 @@ 'use strict'; | ||
module.exports = function configeur(schema, options = {}) { | ||
return processConfig(schema, process.env, makeParsers(options.parsers)); | ||
return processConfig(schema, process.env, makeParsers(options.parsers), options.mutable); | ||
}; | ||
module.exports.default = module.exports; |
@@ -11,3 +11,3 @@ 'use strict'; | ||
module.exports = function processConfig(schema, env, parsers) { | ||
module.exports = function processConfig(schema, env, parsers, mutable) { | ||
const config = Object.create(null); | ||
@@ -39,3 +39,3 @@ const envNames = Object.getOwnPropertyNames(env); | ||
return Object.freeze(config); | ||
return mutable ? config : Object.freeze(config); | ||
}; |
{ | ||
"name": "configeur", | ||
"version": "3.0.3", | ||
"version": "3.1.0", | ||
"description": "Extensible parsing of environment variables into config.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -83,1 +83,8 @@ # configeur | ||
``` | ||
#### `mutable` | ||
By default, the object returned by configuer is frozen. Since it is also flat, | ||
the object is completely immutable. The `mutable` option makes configeur return | ||
an unfrozen object. This is not recommended in general, but may be useful for | ||
testing purposes. |
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
7370
75
90