MCPcopy
hub / github.com/musistudio/claude-code-router / addHost

Function addHost

examples/plugins/claude-design-plugin.cjs:1051–1060  ·  view source on GitHub ↗
(host)

Source from the content-addressed store, hash-verified

1049function normalizeFallbackRouteHosts(value, primaryHost) {
1050 const hosts = [];
1051 const addHost = (host) => {
1052 const raw = stringValue(host);
1053 if (!raw) {
1054 return;
1055 }
1056 const normalized = raw.replace(/^https?:\/\//i, "").replace(/\/.*$/, "").toLowerCase();
1057 if (normalized && normalized !== primaryHost.toLowerCase() && !hosts.includes(normalized)) {
1058 hosts.push(normalized);
1059 }
1060 };
1061 DEFAULT_FALLBACK_ROUTE_HOSTS.forEach(addHost);
1062 if (Array.isArray(value)) {
1063 value.forEach(addHost);

Callers 1

Calls 2

stringValueFunction · 0.70
replaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…