@gitlab/ui
Version:
GitLab UI Components
17 lines (14 loc) • 502 B
JavaScript
/**
* Utilities to get information about the current environment
*/
const getEnv = function (key) {
let fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
const env = typeof process !== 'undefined' && process ? process.env || {} : {};
if (!key) {
/* istanbul ignore next */
return env;
}
return env[key] || fallback;
};
const getNoWarn = () => getEnv('BOOTSTRAP_VUE_NO_WARN') || getEnv('NODE_ENV') === 'production';
export { getEnv, getNoWarn };