(query: Query, key: string)
| 212 | } |
| 213 | |
| 214 | const collectQueryStringByKey = (query: Query, key: string): string[] => { |
| 215 | const needle = query[key]; |
| 216 | const collection = decodeList(needle); |
| 217 | return collection.reduce((acc: string[], item: string) => { |
| 218 | if (typeof item !== 'string') { |
| 219 | return acc; |
| 220 | } |
| 221 | item = item.trim(); |
| 222 | |
| 223 | if (item.length > 0) { |
| 224 | acc.push(item); |
| 225 | } |
| 226 | |
| 227 | return acc; |
| 228 | }, []); |
| 229 | }; |
| 230 | |
| 231 | const decodeQuery = (location: Location): string => { |
| 232 | if (!location.query?.query) { |
no test coverage detected