MCPcopy
hub / github.com/remoteintech/remote-jobs / safeUrl

Function safeUrl

scripts/fix-links.mjs:108–114  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

106
107// ---------- URL helpers ----------
108function safeUrl(s) {
109 try {
110 return new URL(s);
111 } catch {
112 return null;
113 }
114}
115
116// Public-suffix-light: returns the last two labels of a hostname.
117// Good enough to call "github.com" and "www.github.com" the same registrable.

Callers 4

isParkedFunction · 0.85
reverifyFunction · 0.85
classifyFunction · 0.85
cleanFinalUrlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected