* This method is intended for encoding *key* or *value* parts of query component. We need a custom * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be * encoded per http://tools.ietf.org/html/rfc3986: * query = *( pchar / "/" / "?" ) * pcha
(val, pctEncodeSpaces)
| 874 | * / "*" / "+" / "," / ";" / "=" |
| 875 | */ |
| 876 | function encodeUriQuery(val, pctEncodeSpaces) { |
| 877 | return encodeURIComponent(val). |
| 878 | replace(/%40/gi, '@'). |
| 879 | replace(/%3A/gi, ':'). |
| 880 | replace(/%24/g, '$'). |
| 881 | replace(/%2C/gi, ','). |
| 882 | replace(/%20/g, (pctEncodeSpaces ? '%20' : '+')); |
| 883 | } |
| 884 | |
| 885 | |
| 886 | /** |
no test coverage detected