(params: Params)
| 728 | |
| 729 | // Parse a single query parameter `name[=value]` |
| 730 | private parseQueryParam(params: Params): void { |
| 731 | const key = matchQueryParams(this.remaining); |
| 732 | if (!key) { |
| 733 | return; |
| 734 | } |
| 735 | this.capture(key); |
| 736 | let value: any = ''; |
| 737 | if (this.consumeOptional('=')) { |
| 738 | const valueMatch = matchUrlQueryParamValue(this.remaining); |
| 739 | if (valueMatch) { |
| 740 | value = valueMatch; |
| 741 | this.capture(value); |
| 742 | } |
| 743 | } |
| 744 | |
| 745 | const decodedKey = decodeQuery(key); |
| 746 | const decodedVal = decodeQuery(value); |
| 747 | |
| 748 | if (params.hasOwnProperty(decodedKey)) { |
| 749 | // Append to existing values |
| 750 | let currentVal = params[decodedKey]; |
| 751 | if (!Array.isArray(currentVal)) { |
| 752 | currentVal = [currentVal]; |
| 753 | params[decodedKey] = currentVal; |
| 754 | } |
| 755 | currentVal.push(decodedVal); |
| 756 | } else { |
| 757 | // Create a new value |
| 758 | params[decodedKey] = decodedVal; |
| 759 | } |
| 760 | } |
| 761 | |
| 762 | // parse `(a/b//outlet_name:c/d)` |
| 763 | private parseParens(allowPrimary: boolean, depth: number): {[outlet: string]: UrlSegmentGroup} { |
no test coverage detected