(
conditional: ConditionalSelect,
prefixPath: Array<string>,
guards: Array<ConditionalSelectGuard>,
results: Array<{
key: string
path: Array<string>
subquery: IncludesSubquery
guards: Array<ConditionalSelectGuard>
}>,
)
| 1792 | } |
| 1793 | |
| 1794 | function collectIncludesFromConditionalSelect( |
| 1795 | conditional: ConditionalSelect, |
| 1796 | prefixPath: Array<string>, |
| 1797 | guards: Array<ConditionalSelectGuard>, |
| 1798 | results: Array<{ |
| 1799 | key: string |
| 1800 | path: Array<string> |
| 1801 | subquery: IncludesSubquery |
| 1802 | guards: Array<ConditionalSelectGuard> |
| 1803 | }>, |
| 1804 | ): void { |
| 1805 | const previousBranchGuards: Array<ConditionalSelectGuard> = [] |
| 1806 | for (const branch of conditional.branches) { |
| 1807 | collectIncludesFromSelectValue( |
| 1808 | branch.value, |
| 1809 | prefixPath, |
| 1810 | [ |
| 1811 | ...guards, |
| 1812 | ...previousBranchGuards, |
| 1813 | { condition: branch.condition, expected: true }, |
| 1814 | ], |
| 1815 | results, |
| 1816 | ) |
| 1817 | previousBranchGuards.push({ |
| 1818 | condition: branch.condition, |
| 1819 | expected: false, |
| 1820 | }) |
| 1821 | } |
| 1822 | |
| 1823 | if (conditional.defaultValue !== undefined) { |
| 1824 | collectIncludesFromSelectValue( |
| 1825 | conditional.defaultValue, |
| 1826 | prefixPath, |
| 1827 | [...guards, ...previousBranchGuards], |
| 1828 | results, |
| 1829 | ) |
| 1830 | } |
| 1831 | } |
| 1832 | |
| 1833 | function collectIncludesFromSelectValue( |
| 1834 | value: any, |
no test coverage detected