Files
wikijs-fork/server/helpers/config.js
2017-05-14 21:20:40 -04:00

20 lines
355 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] })
)
}
}