MCPcopy Create free account
hub / github.com/bclinkinbeard/angular / encodeUriSegment

Function encodeUriSegment

test/fixtures/foo.js:1253–1258  ·  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

1251 * / "*" / "+" / "," / ";" / "="
1252 */
1253function encodeUriSegment(val) {
1254 return encodeUriQuery(val, true).
1255 replace(/%26/gi, '&').
1256 replace(/%3D/gi, '=').
1257 replace(/%2B/gi, '+');
1258}
1259
1260
1261/**

Callers 4

encodePathFunction · 0.85
LocationHtml5UrlFunction · 0.85
LocationHashbangUrlFunction · 0.85

Calls 1

encodeUriQueryFunction · 0.85

Tested by

no test coverage detected