MCPcopy Create free account
hub / github.com/BrainicHQ/DoHSpeedTest / findDefaultDoHServer

Function findDefaultDoHServer

script.js:140–148  ·  view source on GitHub ↗
(server)

Source from the content-addressed store, hash-verified

138}
139
140function findDefaultDoHServer(server) {
141 if (!server || typeof server !== 'object') return null;
142 const name = typeof server.name === 'string' ? server.name.trim().toLowerCase() : '';
143 const url = typeof server.url === 'string' ? server.url.trim() : '';
144 return DEFAULT_DNS_SERVERS.find(defaultServer =>
145 (url && defaultServer.url === url) ||
146 (name && defaultServer.name.toLowerCase() === name)
147 ) || null;
148}
149
150function normalizeHostnameForStorage(value) {
151 if (typeof value !== 'string') return null;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected