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

Function encodeUriSegment

web/static/bower_components/angular/angular.js:1378–1383  ·  view source on GitHub ↗

* We need our custom method because encodeURIComponent is too aggressive and doesn't follow * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path * segments: * segment = *pchar * pchar = unreserved / pct-encoded / sub-delims / ":" / "

(val)

Source from the content-addressed store, hash-verified

1376 * / "*" / "+" / "," / ";" / "="
1377 */
1378function encodeUriSegment(val) {
1379 return encodeUriQuery(val, true).
1380 replace(/%26/gi, '&').
1381 replace(/%3D/gi, '=').
1382 replace(/%2B/gi, '+');
1383}
1384
1385
1386/**

Callers 4

encodePathFunction · 0.70
LocationHtml5UrlFunction · 0.70
LocationHashbangUrlFunction · 0.70

Calls 1

encodeUriQueryFunction · 0.70

Tested by

no test coverage detected