UNPKG

integration-operator

Version:
71 lines (59 loc) 2.43 kB
require("core-js/modules/es.array.concat.js"); require("core-js/modules/es.object.to-string.js"); require("core-js/modules/es.regexp.to-string.js"); (function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports", "yaml", "fs-extra", "path"], factory); } else if (typeof exports !== "undefined") { factory(exports, require("yaml"), require("fs-extra"), require("path")); } else { var mod = { exports: {} }; factory(mod.exports, global.yaml, global.fsExtra, global.path); global.util = mod.exports; } })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _yaml, _fsExtra, _path) { "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(_exports, "__esModule", { value: true }); _exports.kind2plural = kind2plural; _exports.getGroupName = getGroupName; _exports.project = void 0; _yaml = _interopRequireDefault(_yaml); _fsExtra = _interopRequireDefault(_fsExtra); _path = _interopRequireDefault(_path); /** * Copyright 2021 Silicon Hills LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ var project = _yaml.default.parse(_fsExtra.default.readFileSync(_path.default.resolve(__dirname, '../PROJECT')).toString()); _exports.project = project; function kind2plural(kind) { var lowercasedKind = kind.toLowerCase(); if (lowercasedKind[lowercasedKind.length - 1] === 's') { return lowercasedKind; } if (lowercasedKind[lowercasedKind.length - 1] === 'o') { lowercasedKind = "".concat(lowercasedKind, "e"); } return "".concat(lowercasedKind, "s"); } function getGroupName(groupNamePrefix, domain) { return "".concat(groupNamePrefix, ".").concat(domain || project.domain); } }); //# sourceMappingURL=util.js.map