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

Method consumeOptional

packages/router/src/url_tree.ts:810–816  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

808
809 // Consumes the prefix when it is present and returns whether it has been consumed
810 private consumeOptional(str: string): boolean {
811 if (this.peekStartsWith(str)) {
812 this.remaining = this.remaining.substring(str.length);
813 return true;
814 }
815 return false;
816 }
817
818 private capture(str: string): void {
819 if (!this.consumeOptional(str)) {

Callers 9

parseRootSegmentMethod · 0.95
parseQueryParamsMethod · 0.95
parseFragmentMethod · 0.95
parseChildrenMethod · 0.95
parseMatrixParamsMethod · 0.95
parseParamMethod · 0.95
parseQueryParamMethod · 0.95
parseParensMethod · 0.95
captureMethod · 0.95

Calls 1

peekStartsWithMethod · 0.95

Tested by

no test coverage detected