MCPcopy Create free account
hub / github.com/EricSimons/ionic-course / encodeUriQuery

Function encodeUriQuery

code/songhop/www/lib/angular/angular.js:1177–1185  ·  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

1175 * / "*" / "+" / "," / ";" / "="
1176 */
1177function encodeUriQuery(val, pctEncodeSpaces) {
1178 return encodeURIComponent(val).
1179 replace(/%40/gi, '@').
1180 replace(/%3A/gi, ':').
1181 replace(/%24/g, '$').
1182 replace(/%2C/gi, ',').
1183 replace(/%3B/gi, ';').
1184 replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));
1185}
1186
1187var ngAttrPrefixes = ['ng-', 'data-ng-', 'ng:', 'x-ng-'];
1188

Callers 3

toKeyValueFunction · 0.70
encodeUriSegmentFunction · 0.70
buildUrlFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected