UNPKG

@liplum/env

Version:

Reading and parsing environment variables from "process.env"

19 lines 526 B
export const getValueFromStore = ({ key, store }) => { const _store = store ? store : process.env; if (_store instanceof Map) { return _store.get(key); } if (typeof _store === "function") { return _store(key); } return _store[key]; }; export const missingEnvError = (key) => { if (key) { return new Error(`Missing the environment variable "${key}".`); } else { return new Error(`Missing the environment variable.`); } }; //# sourceMappingURL=utils.js.map