(value: unknown, param: OperationParameter)
| 58 | }; |
| 59 | |
| 60 | const 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 |
no test coverage detected