MCPcopy
hub / github.com/angular/angular / consumeOptional

Method consumeOptional

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

Source from the content-addressed store, hash-verified

804
805 // Consumes the prefix when it is present and returns whether it has been consumed
806 private consumeOptional(str: string): boolean {
807 if (this.peekStartsWith(str)) {
808 this.remaining = this.remaining.substring(str.length);
809 return true;
810 }
811 return false;
812 }
813
814 private capture(str: string): void {
815 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