@genesislcap/pbc-documents-ui 0.0.8 → 0.0.10
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const getEndpointUrl: (endpoint: string) => string;
|
|
1
|
+
export declare const getEndpointUrl: (endpoint: string, urlRoot?: string) => string;
|
|
2
2
|
//# sourceMappingURL=endpoint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint.d.ts","sourceRoot":"","sources":["../../../src/utils/endpoint.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"endpoint.d.ts","sourceRoot":"","sources":["../../../src/utils/endpoint.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,aACf,MAAM,YACP,MAAM,KACd,MAWF,CAAC"}
|
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
export const getEndpointUrl = (endpoint) => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
else if (urlRoot.startsWith('ws:')) {
|
|
7
|
-
urlRoot = urlRoot.substring(3);
|
|
8
|
-
}
|
|
9
|
-
else if (urlRoot.startsWith('wss:')) {
|
|
10
|
-
urlRoot = urlRoot.substring(4);
|
|
11
|
-
}
|
|
12
|
-
else {
|
|
13
|
-
urlRoot = urlRoot.substring(4);
|
|
14
|
-
}
|
|
1
|
+
export const getEndpointUrl = (endpoint, urlRoot = sessionStorage.getItem('hostUrl')) => {
|
|
2
|
+
const url = new URL(urlRoot);
|
|
3
|
+
const path = url.pathname && url.pathname[url.pathname.length - 1] == '/'
|
|
4
|
+
? url.pathname
|
|
5
|
+
: `${url.pathname}/`;
|
|
15
6
|
if (urlRoot.includes('localhost')) {
|
|
16
|
-
return
|
|
7
|
+
return `http://${url.host}${path}${endpoint}`;
|
|
17
8
|
}
|
|
18
9
|
else {
|
|
19
|
-
return
|
|
10
|
+
return `https://${url.host}${path}${endpoint}`;
|
|
20
11
|
}
|
|
21
12
|
};
|
|
22
13
|
//# sourceMappingURL=endpoint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint.js","sourceRoot":"","sources":["../../../src/utils/endpoint.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,
|
|
1
|
+
{"version":3,"file":"endpoint.js","sourceRoot":"","sources":["../../../src/utils/endpoint.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,QAAgB,EAChB,UAAkB,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC,EAC3C,EAAE;IACV,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;IAC7B,MAAM,IAAI,GACR,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,GAAG;QAC1D,CAAC,CAAC,GAAG,CAAC,QAAQ;QACd,CAAC,CAAC,GAAG,GAAG,CAAC,QAAQ,GAAG,CAAC;IACzB,IAAI,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE;QACjC,OAAO,UAAU,GAAG,CAAC,IAAI,GAAG,IAAI,GAAG,QAAQ,EAAE,CAAC;KAC/C;SAAM;QACL,OAAO,WAAW,GAAG,CAAC,IAAI,GAAG,IAAI,GAAG,QAAQ,EAAE,CAAC;KAChD;AACH,CAAC,CAAC"}
|