UNPKG

@uigstudio/gitlab-env

Version:

26 lines (25 loc) 839 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.envsToFileContent = void 0; var envsToFileContent = function (envs, conf) { return envs .filter(function (_a) { var environment_scope = _a.environment_scope, key = _a.key; if (conf.blockList.includes(key)) { return false; } if (environment_scope === conf.env) { return true; } if (environment_scope === '*') { return !Boolean(envs.find(function (e) { return e.key === key && e.environment_scope === conf.env; })); } return false; }) .map(function (_a) { var key = _a.key, value = _a.value; return "".concat(key, "=").concat(value, "\n"); }) .join(''); }; exports.envsToFileContent = envsToFileContent;