@quoin/node-rc
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -5,3 +5,3 @@ const _ = require('lodash'); | ||
module.exports = (name, baseConfig) => { | ||
module.exports = (name, baseConfig, postConfig) => { | ||
if (name[0] === '@') { | ||
@@ -14,3 +14,3 @@ debug(`scoped name: ${name}`); | ||
const config = _.cloneDeep(rc(name, baseConfig)); | ||
const config = rc(name, _.cloneDeep(baseConfig)); | ||
@@ -22,3 +22,6 @@ // Remove extra properties added by `rc` module. | ||
if (postConfig) { | ||
return _.merge(config, postConfig); | ||
} | ||
return config; | ||
}; |
{ | ||
"name": "@quoin/node-rc", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Wrapper for rc library.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -16,2 +16,13 @@ # @quoin/node-rc | ||
You can also add values to be merged after the config file has been loaded: | ||
const config = rc(packageJson.name, {original: 'value'}, {version: '1.0'}); | ||
This would allow `version` not to be overwritten by a value set in the config | ||
file. | ||
This module, unlike the `rc` module, will not mutate neither `baseConfig`, nor | ||
`postConfig`. | ||
## Debugging | ||
@@ -18,0 +29,0 @@ |
# Releases | ||
## 0.1.1 - 2017-04-20 | ||
- Add `postConfig` parameter and prevent mutating. | ||
## 0.1.0 - 2017-04-17 | ||
- initial release. |
2724
19
31