MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / formBody

Function formBody

apps/cli/src/device-login.ts:115–121  ·  view source on GitHub ↗
(fields: Record<string, string | undefined>)

Source from the content-addressed store, hash-verified

113};
114
115const formBody = (fields: Record<string, string | undefined>): string => {
116 const params = new URLSearchParams();
117 for (const [key, value] of Object.entries(fields)) {
118 if (value !== undefined) params.set(key, value);
119 }
120 return params.toString();
121};
122
123const definedFields = (fields: Record<string, string | undefined>): Record<string, string> =>
124 Object.fromEntries(Object.entries(fields).filter(([, v]) => v !== undefined)) as Record<

Callers 1

postFunction · 0.85

Calls 2

setMethod · 0.80
toStringMethod · 0.80

Tested by

no test coverage detected