Count how many choices anywhere in the tree carry `name` (names aren't unique).
( name: string, choices: IChoice[] = this.settings.choices, )
| 557 | |
| 558 | /** Count how many choices anywhere in the tree carry `name` (names aren't unique). */ |
| 559 | private countChoicesByName( |
| 560 | name: string, |
| 561 | choices: IChoice[] = this.settings.choices, |
| 562 | ): number { |
| 563 | let count = 0; |
| 564 | for (const choice of choices) { |
| 565 | if (choice.name === name) count++; |
| 566 | if (choice.type === "Multi") { |
| 567 | count += this.countChoicesByName( |
| 568 | name, |
| 569 | (choice as IMultiChoice).choices, |
| 570 | ); |
| 571 | } |
| 572 | } |
| 573 | return count; |
| 574 | } |
| 575 | |
| 576 | /** Surface a Notice when a URI's `choice=<name>` is ambiguous, so an automation |
| 577 | * that ran the wrong (first-matching) choice is at least diagnosable. */ |
no outgoing calls
no test coverage detected