UNPKG

sqlpad

Version:

Web app. Write SQL and visualize the results. Supports Postgres, MySQL, SQL Server, Crate, Vertica and SAP HANA.

19 lines (17 loc) 485 B
const definitions = require('./configItems'); /** * Gets config values from environment * @param {object} env optional * @returns {object} configMap */ module.exports = function getEnvConfig(env = process.env) { return definitions .filter(definition => definition.hasOwnProperty('envVar')) .reduce((envMap, definition) => { const { key, envVar } = definition; if (env[envVar]) { envMap[key] = env[envVar]; } return envMap; }, {}); };