We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7a0fd82 commit 6df3a8eCopy full SHA for 6df3a8e
1 file changed
src/events/event.ts
@@ -13,9 +13,10 @@ const namespace = 'nmr-wrapper';
13
function parseOrigin(origin: string) {
14
const urlSegments = origin.split('://');
15
const hostSegments = urlSegments[1].split('.');
16
+ const startIndex = hostSegments.length > 2 ? 1 : 0;
17
18
const url = `${urlSegments[0]}://${hostSegments
- .slice(hostSegments.length > 1 ? 1 : 0)
19
+ .slice(hostSegments.length > 1 ? startIndex : 0)
20
.join('.')}`;
21
22
return url;
0 commit comments