(s)
| 106 | |
| 107 | // ---------- URL helpers ---------- |
| 108 | function 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. |
no outgoing calls
no test coverage detected