codebaseHost

tcmts.registry.codebaseHost · #mcoo2flf · term · runs anywhere

A listed codebase's server, by host (as the libraries' sources are counted).

import type { RegistryCodebase } from "#codebase/tcmts/registry";

export const codebaseHost = (c: Pick<RegistryCodebase, "url">): string => {
  try {
    return new URL(c.url).host;
  } catch {
    return c.url;
  }
}

uses

used by