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

Function encodeUriString

packages/router/src/url_tree.ts:513–519  ·  view source on GitHub ↗

* Encodes a URI string with the default encoding. This function will only ever be called from * `encodeUriQuery` or `encodeUriSegment` as it's the base set of encodings to be used. We need * a custom encoding because encodeURIComponent is too aggressive and encodes stuff that doesn't * have to be

(s: string)

Source from the content-addressed store, hash-verified

511 * have to be encoded per https://url.spec.whatwg.org.
512 */
513function encodeUriString(s: string): string {
514 return encodeURIComponent(s)
515 .replace(/%40/g, '@')
516 .replace(/%3A/gi, ':')
517 .replace(/%24/g, '$')
518 .replace(/%2C/gi, ',');
519}
520
521/**
522 * This function should be used to encode both keys and values in a query string key/value. In

Callers 2

encodeUriQueryFunction · 0.85
encodeUriSegmentFunction · 0.85

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…