2017-05-15 00:17:08 +00:00
|
|
|
'use strict'
|
|
|
|
|
|
|
|
const _ = require('lodash')
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
/**
|
|
|
|
* Parse configuration value for environment vars
|
|
|
|
*
|
|
|
|
* @param {any} cfg Configuration value
|
|
|
|
* @returns Parse configuration value
|
|
|
|
*/
|
|
|
|
parseConfigValue (cfg) {
|
|
|
|
return _.replace(
|
|
|
|
cfg,
|
2017-05-16 01:09:53 +00:00
|
|
|
/\$\(([A-Z0-9_]+)\)/g,
|
|
|
|
(fm, m) => { return process.env[m] }
|
2017-05-15 00:17:08 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|