UNPKG

1.35 kBJavaScriptView Raw
1"use strict";
2/**
3 * This file is part of the @egodigital/egoose distribution.
4 * Copyright (c) e.GO Digital GmbH, Aachen, Germany (https://www.e-go-digital.com/)
5 *
6 * @egodigital/egoose is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation, version 3.
9 *
10 * @egodigital/egoose is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18Object.defineProperty(exports, "__esModule", { value: true });
19const index_1 = require("./index");
20/**
21 * Checks if 'APP_ENV' has at least one specific value.
22 *
23 * @param {string[]} [envs] One or more possible values for 'APP_ENV'.
24 *
25 * @return {boolean} Is one value of 'envs' or not.
26 */
27function isAppEnv(...envs) {
28 const APP_ENV = ('' + process.env.APP_ENV).toLowerCase().trim();
29 return index_1.asArray(envs)
30 .map(e => index_1.normalizeString(e))
31 .indexOf(APP_ENV) > -1;
32}
33exports.isAppEnv = isAppEnv;
34//# sourceMappingURL=env.js.map
\No newline at end of file