UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

23 lines (22 loc) • 794 B
import { t as LruCache } from "./lru-cache-wquJPIr-.mjs"; //#region src/plugins/catalog-icon-registry.ts const catalogIconUrls = new LruCache(1024); function normalizeCatalogIconUrl(e) { if (!e || e.length > 2048) return; const t = URL.parse(e); return t?.protocol === "https:" && t.hostname && !t.username && !t.password && !t.hash ? t.href : void 0; } function registerClawHubCatalogIconUrls(e) { for (const t of e) { if (!t) continue; const e = normalizeCatalogIconUrl(t); if (!e) continue; catalogIconUrls.set(e, e); } } function resolveClawHubCatalogIconUrl(e) { const t = normalizeCatalogIconUrl(e); return t ? catalogIconUrls.peek(t) : void 0; } //#endregion export { registerClawHubCatalogIconUrls as n, resolveClawHubCatalogIconUrl as r, normalizeCatalogIconUrl as t };