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

Function matchParts

packages/router/src/shared.ts:120–136  ·  view source on GitHub ↗
(
  routeParts: string[],
  urlSegments: UrlSegment[],
  posParams: {[key: string]: UrlSegment},
)

Source from the content-addressed store, hash-verified

118}
119
120function matchParts(
121 routeParts: string[],
122 urlSegments: UrlSegment[],
123 posParams: {[key: string]: UrlSegment},
124): boolean {
125 for (let i = 0; i < routeParts.length; i++) {
126 const part = routeParts[i];
127 const segment = urlSegments[i];
128 const isParameter = part[0] === ':';
129 if (isParameter) {
130 posParams[part.substring(1)] = segment;
131 } else if (part !== segment.path) {
132 return false;
133 }
134 }
135 return true;
136}
137
138/**
139 * Matches the route configuration (`route`) against the actual URL (`segments`).

Callers 1

defaultUrlMatcherFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…