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

Method consumeOptional

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

Source from the content-addressed store, hash-verified

889
890 // Consumes the prefix when it is present and returns whether it has been consumed
891 private consumeOptional(str: string): boolean {
892 if (this.peekStartsWith(str)) {
893 this.remaining = this.remaining.substring(str.length);
894 return true;
895 }
896 return false;
897 }
898
899 private capture(str: string): void {
900 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