wikijs-fork/server/helpers/config.js
2017-05-15 21:09:53 -04:00

20 lines
357 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,
(fm, m) => { return process.env[m] }
)
}
}