MCPcopy
hub / github.com/vercel/commerce / createUrl

Function createUrl

lib/utils.ts:7–15  ·  view source on GitHub ↗
(
  pathname: string,
  params: URLSearchParams | ReadonlyURLSearchParams,
)

Source from the content-addressed store, hash-verified

5 : "http://localhost:3000";
6
7export const createUrl = (
8 pathname: string,
9 params: URLSearchParams | ReadonlyURLSearchParams,
10) => {
11 const paramsString = params.toString();
12 const queryString = `${paramsString.length ? "?" : ""}${paramsString}`;
13
14 return `${pathname}${queryString}`;
15};
16
17export const ensureStartsWith = (stringToCheck: string, startsWith: string) =>
18 stringToCheck.startsWith(startsWith)

Callers 3

PathFilterItemFunction · 0.90
SortFilterItemFunction · 0.90
CartModalFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected