You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
357 B

  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. }