registryMountOf

tcmts.registry.registryMountOf · #4jdn77mt · term · runs anywhere

Whose mount a name in the registry's codebase is under, if it's one (registryMounts): a mount is its author's DID and two names more (plc_….geo.v1_2_0, plc_…._codebases.notes).

import { registryMounts } from "#codebase/tcmts/registry";

export function registryMountOf(
  name: string,
): { mount: string; label: string; href: string; tab: string } | undefined {
  const mount = name.split(".").slice(0, 3).join(".");
  const m = registryMounts.get(mount);
  return m && { mount, ...m };
}

uses

used by