MCPcopy
hub / github.com/coder/mux / splitRequestUrlPathAndQuery

Function splitRequestUrlPathAndQuery

src/node/orpc/server.ts:629–645  ·  view source on GitHub ↗
(
  requestUrl: string | undefined
)

Source from the content-addressed store, hash-verified

627}
628
629function splitRequestUrlPathAndQuery(
630 requestUrl: string | undefined
631): { pathname: string; querySuffix: string } | null {
632 if (!requestUrl) {
633 return null;
634 }
635
636 const queryStart = requestUrl.indexOf("?");
637 if (queryStart === -1) {
638 return { pathname: requestUrl, querySuffix: "" };
639 }
640
641 return {
642 pathname: requestUrl.slice(0, queryStart),
643 querySuffix: requestUrl.slice(queryStart),
644 };
645}
646
647function getNormalizedUpgradeRoute(
648 requestUrl: string | undefined

Callers 2

createOrpcServerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected