(exampleObj: CodeExamples | CodeExamples[], matchKey: string)
| 241 | // } |
| 242 | // We need to find the matching key so this is using JSON.stringify to handle the "recursion" to search for the matching key. |
| 243 | function findMatchingQueryKey(exampleObj: CodeExamples | CodeExamples[], matchKey: string) { |
| 244 | let match: string | null = null |
| 245 | JSON.stringify(exampleObj, (_, nestedValue) => { |
| 246 | if (nestedValue && Object.prototype.hasOwnProperty.call(nestedValue, matchKey)) { |
| 247 | match = nestedValue[matchKey] |
| 248 | } |
| 249 | |
| 250 | return nestedValue |
| 251 | }) |
| 252 | |
| 253 | return match |
| 254 | } |
| 255 | |
| 256 | function getRequiredQueryParamsPath(operation: Operation, codeSample: CodeSample) { |
| 257 | const requiredQueryParams = new URLSearchParams() |
no outgoing calls
no test coverage detected