(params: Params)
| 808 | |
| 809 | // Parse a single query parameter `name[=value]` |
| 810 | private parseQueryParam(params: Params): void { |
| 811 | const key = matchQueryParams(this.remaining); |
| 812 | if (!key) { |
| 813 | return; |
| 814 | } |
| 815 | this.capture(key); |
| 816 | let value = ''; |
| 817 | if (this.consumeOptional('=')) { |
| 818 | const valueMatch = matchUrlQueryParamValue(this.remaining); |
| 819 | if (valueMatch) { |
| 820 | value = valueMatch; |
| 821 | this.capture(value); |
| 822 | } |
| 823 | } |
| 824 | |
| 825 | const decodedKey = decodeQuery(key); |
| 826 | const decodedVal = decodeQuery(value); |
| 827 | |
| 828 | if (Object.hasOwn(params, decodedKey)) { |
| 829 | // Append to existing values |
| 830 | let currentVal = params[decodedKey]; |
| 831 | if (!Array.isArray(currentVal)) { |
| 832 | currentVal = [currentVal]; |
| 833 | params[decodedKey] = currentVal; |
| 834 | } |
| 835 | currentVal.push(decodedVal); |
| 836 | } else { |
| 837 | // Create a new value |
| 838 | params[decodedKey] = decodedVal; |
| 839 | } |
| 840 | } |
| 841 | |
| 842 | // parse `(a/b//outlet_name:c/d)` |
| 843 | private parseParens(allowPrimary: boolean, depth: number): {[outlet: string]: UrlSegmentGroup} { |
no test coverage detected