@redhat-cloud-services/frontend-components-config 4.7.1 → 4.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redhat-cloud-services/frontend-components-config",
|
|
3
|
-
"version": "4.7.
|
|
3
|
+
"version": "4.7.3",
|
|
4
4
|
"description": "Config plugins and settings for RedHat Cloud Services project.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"homepage": "https://github.com/RedHatInsights/frontend-components/tree/master/packages/config#readme",
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.8",
|
|
24
|
-
"@redhat-cloud-services/frontend-components-config-utilities": "^1.5.
|
|
24
|
+
"@redhat-cloud-services/frontend-components-config-utilities": "^1.5.31",
|
|
25
25
|
"assert": "^2.0.0",
|
|
26
26
|
"axios": "^0.27.2",
|
|
27
27
|
"babel-loader": "^8.2.5",
|
|
@@ -5,20 +5,22 @@ const fecConfig = require(process.env.FEC_CONFIG_PATH);
|
|
|
5
5
|
const isBeta = process.env.BETA === 'true';
|
|
6
6
|
|
|
7
7
|
function parseRegexpURL(url) {
|
|
8
|
-
return new RegExp(
|
|
8
|
+
return isBeta ? [new RegExp(`/beta${url.toString()}`), new RegExp(`/preview${url.toString()}`)] : new RegExp(url.toString());
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
function createAppUrl(appUrl) {
|
|
12
12
|
if (Array.isArray(appUrl)) {
|
|
13
|
-
return appUrl
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
return appUrl
|
|
14
|
+
.map((url) => {
|
|
15
|
+
if (typeof url === 'object') {
|
|
16
|
+
return parseRegexpURL(url);
|
|
17
|
+
} else if (typeof url === 'string') {
|
|
18
|
+
return isBeta ? [`/beta${url}`, `/preview${url}`] : url;
|
|
19
|
+
} else {
|
|
20
|
+
throw `Invalid appURL format! Expected string or regexp, got ${typeof url}. Check your fec.config.js:appUrl.`;
|
|
21
|
+
}
|
|
22
|
+
})
|
|
23
|
+
.flat();
|
|
22
24
|
} else if (typeof appUrl === 'object') {
|
|
23
25
|
return parseRegexpURL(appUrl);
|
|
24
26
|
} else if (typeof appUrl === 'string') {
|