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

Function parseUrl

www/js/ext/socket.js:73–84  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

71 });
72 }
73 function parseUrl(url) {
74 var finalUrl = url;
75 if (finalUrl.startsWith("/")) {
76 var basePart = window.location.hostname + (window.location.port ? ":" + window.location.port : "");
77 if (window.location.protocol === "https:") {
78 finalUrl = "wss://" + basePart + finalUrl;
79 } else if (window.location.protocol === "http:") {
80 finalUrl = "ws://" + basePart + finalUrl;
81 }
82 }
83 return finalUrl;
84 }
85 var PROXY_BLACKLIST = ["then", "catch", "length", "toJSON"];
86 var SocketFeature = class _SocketFeature extends Feature {
87 static keyword = "socket";

Callers 2

parseMethod · 0.70
getProxyMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected