config.js 357 B

12345678910111213141516171819
  1. 'use strict'
  2. const _ = require('lodash')
  3. module.exports = {
  4. /**
  5. * Parse configuration value for environment vars
  6. *
  7. * @param {any} cfg Configuration value
  8. * @returns Parse configuration value
  9. */
  10. parseConfigValue (cfg) {
  11. return _.replace(
  12. cfg,
  13. /\$\(([A-Z0-9_]+)\)/g,
  14. (fm, m) => { return process.env[m] }
  15. )
  16. }
  17. }