MCPcopy Create free account
hub / github.com/bigskysoftware/_hyperscript / parseUrl

Function parseUrl

www/js/_hyperscript-max.js:11290–11301  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

11288 });
11289 }
11290 function parseUrl(url) {
11291 var finalUrl = url;
11292 if (finalUrl.startsWith("/")) {
11293 var basePart = window.location.hostname + (window.location.port ? ":" + window.location.port : "");
11294 if (window.location.protocol === "https:") {
11295 finalUrl = "wss://" + basePart + finalUrl;
11296 } else if (window.location.protocol === "http:") {
11297 finalUrl = "ws://" + basePart + finalUrl;
11298 }
11299 }
11300 return finalUrl;
11301 }
11302 var PROXY_BLACKLIST = ["then", "catch", "length", "toJSON"];
11303 var SocketFeature = class _SocketFeature extends Feature {
11304 static keyword = "socket";

Callers 2

parseMethod · 0.70
getProxyMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected