UNPKG

465 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const errors_1 = require("../errors");
4function get(k, defaultValue) {
5 return process.env[k] || defaultValue;
6}
7exports.env = {
8 get,
9 has(k) {
10 return Boolean(get(k));
11 },
12 require(k) {
13 const v = process.env[k];
14 if (!v) {
15 throw new errors_1.JobException(`${k} not found in environment`, 'server');
16 }
17 return v;
18 },
19};