MCPcopy Create free account
hub / github.com/bytebase/bytebase / buildSearchString

Function buildSearchString

frontend/src/react/router/navigation.ts:48–62  ·  view source on GitHub ↗
(query: NavQuery)

Source from the content-addressed store, hash-verified

46// Coerce a vue-router-style query (values may be strings, numbers, arrays,
47// null/undefined) into a URL search string.
48export function buildSearchString(query: NavQuery): string {
49 const search = new URLSearchParams();
50 for (const [key, value] of Object.entries(query)) {
51 if (value === undefined || value === null) continue;
52 if (Array.isArray(value)) {
53 for (const item of value) {
54 if (item !== undefined && item !== null)
55 search.append(key, String(item));
56 }
57 } else {
58 search.set(key, String(value));
59 }
60 }
61 return search.toString();
62}
63
64// Fill `:param` placeholders and append a query string.
65export function resolvePath(

Callers 2

resolveTargetFunction · 0.90
resolvePathFunction · 0.85

Calls 3

appendMethod · 0.80
toStringMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected