MCPcopy Index your code
hub / github.com/angular-ui/ui-router / encodeUriQuery

Function encodeUriQuery

test/angular/1.3/angular.js:1194–1202  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

1192 * / "*" / "+" / "," / ";" / "="
1193 */
1194function encodeUriQuery(val, pctEncodeSpaces) {
1195 return encodeURIComponent(val).
1196 replace(/%40/gi, '@').
1197 replace(/%3A/gi, ':').
1198 replace(/%24/g, '$').
1199 replace(/%2C/gi, ',').
1200 replace(/%3B/gi, ';').
1201 replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));
1202}
1203
1204var ngAttrPrefixes = ['ng-', 'data-ng-', 'ng:', 'x-ng-'];
1205

Callers 3

toKeyValueFunction · 0.70
encodeUriSegmentFunction · 0.70
buildUrlFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected