@forge/egress
2.3.22.3.2-experimental-04cc2b9
out/egress/utils.js~
out/egress/utils.jsModified+4−4
Index: package/out/egress/utils.js
===================================================================
--- package/out/egress/utils.js
+++ package/out/egress/utils.js
@@ -1,14 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-exports.getEgressesBasedOnToggles = exports.sortAndGroupEgressPermissionsByDomain = exports.EgressCategory = exports.EgressType = exports.globToRegex = void 0;
+exports.getEgressesBasedOnToggles = exports.sortAndGroupEgressPermissionsByDomain = exports.EgressCategory = exports.EgressType = void 0;
+exports.globToRegex = globToRegex;
const url_parser_1 = require("./url-parser");
function globToRegex(pattern) {
const escaped = pattern.replace(/[.+?^${}()|[\]\\]/g, '\\$&');
const regexPattern = escaped.replace(/\*/g, '.*');
return new RegExp(`^${regexPattern}$`);
}
-exports.globToRegex = globToRegex;
const sortAndGroupEgressPermissionsByDomain = (egressAddresses) => {
if ((egressAddresses === null || egressAddresses === void 0 ? void 0 : egressAddresses.length) === 0) {
return [];
}
@@ -43,13 +43,13 @@
EgressType["Images"] = "IMAGES";
EgressType["Media"] = "MEDIA";
EgressType["Scripts"] = "SCRIPTS";
EgressType["Styles"] = "STYLES";
-})(EgressType = exports.EgressType || (exports.EgressType = {}));
+})(EgressType || (exports.EgressType = EgressType = {}));
var EgressCategory;
(function (EgressCategory) {
EgressCategory["ANALYTICS"] = "ANALYTICS";
-})(EgressCategory = exports.EgressCategory || (exports.EgressCategory = {}));
+})(EgressCategory || (exports.EgressCategory = EgressCategory = {}));
const getEgressesBasedOnToggles = (input) => {
const filteredEgresses = input.egress.filter((egress) => {
var _a;
if (((_a = egress.category) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === EgressCategory.ANALYTICS) {