MCPcopy Create free account
hub / github.com/angular/angular / escapeOutletDelimiter

Function escapeOutletDelimiter

packages/router/src/url_tree.ts:566–568  ·  view source on GitHub ↗

* Inside a parenthesized group, the parser distinguishes a named outlet (`name:path`) from the * unprefixed primary child by looking for a `:` in the first segment token. A primary child whose * first segment legitimately contains a colon (e.g. a param value `admin:y`) would therefore be * mispar

(serializedPrimary: string)

Source from the content-addressed store, hash-verified

564 * misparsed as outlet `admin` on round-trip. Percent-encode colons in that leading token only.
565 */
566function escapeOutletDelimiter(serializedPrimary: string): string {
567 return serializedPrimary.replace(SEGMENT_RE, (firstSegment) => firstSegment.replace(/:/g, '%3A'));
568}
569
570/**
571 * Encodes a URI string with the default encoding. This function will only ever be called from

Callers 1

serializeSegmentFunction · 0.85

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected