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

Method parseSegment

packages/router/src/url_tree.ts:689–701  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

687 // parse a segment with its matrix parameters
688 // ie `name;k1=v1;k2`
689 private parseSegment(): UrlSegment {
690 const path = matchSegments(this.remaining);
691 if (path === '' && this.peekStartsWith(';')) {
692 throw new RuntimeError(
693 RuntimeErrorCode.EMPTY_PATH_WITH_PARAMS,
694 (typeof ngDevMode === 'undefined' || ngDevMode) &&
695 `Empty path url segment cannot have parameters: '${this.remaining}'.`,
696 );
697 }
698
699 this.capture(path);
700 return new UrlSegment(decode(path), this.parseMatrixParams());
701 }
702
703 private parseMatrixParams(): {[key: string]: string} {
704 const params: {[key: string]: string} = {};

Callers 1

parseChildrenMethod · 0.95

Calls 5

peekStartsWithMethod · 0.95
captureMethod · 0.95
parseMatrixParamsMethod · 0.95
matchSegmentsFunction · 0.85
decodeFunction · 0.70

Tested by

no test coverage detected