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

Method parseSegment

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

Source from the content-addressed store, hash-verified

767 // parse a segment with its matrix parameters
768 // ie `name;k1=v1;k2`
769 private parseSegment(): UrlSegment {
770 const path = matchSegments(this.remaining);
771 if (path === '' && this.peekStartsWith(';')) {
772 throw new RuntimeError(
773 RuntimeErrorCode.EMPTY_PATH_WITH_PARAMS,
774 (typeof ngDevMode === 'undefined' || ngDevMode) &&
775 `Empty path url segment cannot have parameters: '${this.remaining}'.`,
776 );
777 }
778
779 this.capture(path);
780 return new UrlSegment(decode(path), this.parseMatrixParams());
781 }
782
783 private parseMatrixParams(): {[key: string]: string} {
784 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