MCPcopy Index your code
hub / github.com/angular/angular / encodeUriSegment

Function encodeUriSegment

packages/common/upgrade/src/params.ts:325–327  ·  view source on GitHub ↗

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

(val: string)

Source from the content-addressed store, hash-verified

323 * Logic from https://github.com/angular/angular.js/blob/864c7f0/src/Angular.js#L1437
324 */
325function encodeUriSegment(val: string) {
326 return encodeUriQuery(val, true).replace(/%26/g, '&').replace(/%3D/gi, '=').replace(/%2B/gi, '+');
327}
328
329/**
330 * This method is intended for encoding *key* or *value* parts of query component. We need a custom

Callers 2

encodePathMethod · 0.70
encodeHashMethod · 0.70

Calls 2

encodeUriQueryFunction · 0.70
replaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…