MCPcopy Index your code
hub / github.com/bigskysoftware/_hyperscript / parseUrl

Function parseUrl

src/ext/socket.js:12–23  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

10}
11
12function parseUrl(url) {
13 var finalUrl = url;
14 if (finalUrl.startsWith("/")) { // complete absolute paths without scheme only
15 var basePart = window.location.hostname + (window.location.port ? ':' + window.location.port : '');
16 if (window.location.protocol === 'https:') {
17 finalUrl = "wss://" + basePart + finalUrl;
18 } else if (window.location.protocol === 'http:') {
19 finalUrl = "ws://" + basePart + finalUrl;
20 }
21 }
22 return finalUrl;
23}
24
25/** @type {(string | symbol)[]} */
26var PROXY_BLACKLIST = ["then", "catch", "length", "toJSON"];

Callers 2

parseMethod · 0.70
getProxyMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected