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

Function formBody

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

Source from the content-addressed store, hash-verified

122};
123
124const formBody = (fields: Record<string, string | undefined>): string => {
125 const params = new URLSearchParams();
126 for (const [key, value] of Object.entries(fields)) {
127 if (value !== undefined) params.set(key, value);
128 }
129 return params.toString();
130};
131
132const definedFields = (fields: Record<string, string | undefined>): Record<string, string> =>
133 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