Skip to content

Commit fad13cd

Browse files
fix(*): build issues
1 parent 7bc3d21 commit fad13cd

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed
Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
1-
export const isLabeuEnvironment = (hostname = window.location.hostname) =>
1+
/* global globalThis */
2+
3+
const isLabeuEnvironment = (hostname = window.location.hostname) =>
24
/\.labeu\./.test(hostname);
35

4-
export const isProdEnvironment = (hostname = window.location.hostname) =>
6+
const isProdEnvironment = (hostname = window.location.hostname) =>
57
/(?:ca|us|eu)\.ovhcloud\.com/.test(hostname);
68

7-
export const getWillPaymentUrl = () => {
9+
const getLabeuEntryPoint = () => {
10+
const v = globalThis?.__WP_LABEU_ENTRY_POINT__;
11+
return typeof v === 'string' ? v : '';
12+
};
13+
14+
const getWillPaymentUrl = () => {
815
if (isProdEnvironment()) {
916
return '/order/payment/assets/remoteEntry.js';
1017
}
1118

12-
return (
13-
(isLabeuEnvironment() &&
14-
(typeof __WP_LABEU_ENTRY_POINT__ === 'string' ? __WP_LABEU_ENTRY_POINT__ : '')) ||
15-
'https://www.ovhcloud.com/order/payment/assets/remoteEntry.js'
16-
);
19+
if (isLabeuEnvironment()) {
20+
return getLabeuEntryPoint() || '/order/payment/assets/remoteEntry.js';
21+
}
22+
23+
return 'https://www.ovhcloud.com/order/payment/assets/remoteEntry.js';
1724
};
25+
26+
exports.isLabeuEnvironment = isLabeuEnvironment;
27+
exports.isProdEnvironment = isProdEnvironment;
28+
exports.getWillPaymentUrl = getWillPaymentUrl;

0 commit comments

Comments
 (0)