wikijs-fork/server/helpers/config.js
2017-05-14 20:24:08 -04:00

20 lines
353 B
JavaScript

'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,
(/\$\([A-Z0-9_]+\)/g,
(m) => { return process.env[m] })
)
}
}