MCPcopy Create free account
hub / github.com/cafebazaar/blacksmith / encodeUriQuery

Function encodeUriQuery

web/static/bower_components/angular/angular.js:1397–1405  ·  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

1395 * / "*" / "+" / "," / ";" / "="
1396 */
1397function encodeUriQuery(val, pctEncodeSpaces) {
1398 return encodeURIComponent(val).
1399 replace(/%40/gi, '@').
1400 replace(/%3A/gi, ':').
1401 replace(/%24/g, '$').
1402 replace(/%2C/gi, ',').
1403 replace(/%3B/gi, ';').
1404 replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));
1405}
1406
1407var ngAttrPrefixes = ['ng-', 'data-ng-', 'ng:', 'x-ng-'];
1408

Callers 4

toKeyValueFunction · 0.70
encodeUriSegmentFunction · 0.70
serializeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected