parseHttpFlag

tcmts.cli.web.parseHttpFlag · #xcqizuxf · term · runs anywhere

import type { HttpRoutes } from "#codebase/tcmts/cli/web";

export function parseHttpFlag(flag: string): HttpRoutes {
  const [namespace, prefix = "/api"] = flag.split("=") as [string, string | undefined];
  return { namespace, prefix: "/" + prefix.replace(/^\/+|\/+$/g, "") };
}

uses

used by