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

Function queryParamValues

packages/plugins/openapi/src/sdk/invoke.ts:60–71  ·  view source on GitHub ↗
(value: unknown, param: OperationParameter)

Source from the content-addressed store, hash-verified

58};
59
60const queryParamValues = (value: unknown, param: OperationParameter): string[] => {
61 if (value === undefined || value === null) return [];
62 if (!Array.isArray(value)) return [primitiveToString(value)];
63
64 const style = Option.getOrUndefined(param.style) ?? "form";
65 const explode = Option.getOrElse(param.explode, () => true);
66
67 if (explode) return value.map(primitiveToString);
68
69 const separator = style === "spaceDelimited" ? " " : style === "pipeDelimited" ? "|" : ",";
70 return [value.map(primitiveToString).join(separator)];
71};
72
73// ---------------------------------------------------------------------------
74// Path resolution

Callers 1

invoke.tsFile · 0.85

Calls 1

primitiveToStringFunction · 0.85

Tested by

no test coverage detected