(block: TabsBlock, failures: string[])
| 180 | } |
| 181 | |
| 182 | function assertExpectedTabLabels(block: TabsBlock, failures: string[]): void { |
| 183 | const hasZodishTab = block.tabs.some((tab) => isLikelyTabValue(tab.value, "Zod")); |
| 184 | const hasZodMiniishTab = block.tabs.some((tab) => isLikelyTabValue(tab.value, "Zod Mini")); |
| 185 | |
| 186 | if (!hasZodishTab || !hasZodMiniishTab) { |
| 187 | return; |
| 188 | } |
| 189 | |
| 190 | for (const tab of block.tabs) { |
| 191 | for (const expectedValue of ["Zod", "Zod Mini"]) { |
| 192 | if (tab.value !== expectedValue && isLikelyTabValue(tab.value, expectedValue)) { |
| 193 | failures.push( |
| 194 | `api.mdx:${tab.line} has likely ${expectedValue} tab label typo: expected value="${expectedValue}", found value="${tab.value}".` |
| 195 | ); |
| 196 | } |
| 197 | } |
| 198 | } |
| 199 | } |
| 200 | |
| 201 | function compareCodeFences(block: TabsBlock, zodTab: TabBlock, zodMiniTab: TabBlock, failures: string[]): void { |
| 202 | if (zodTab.codeFences.length !== zodMiniTab.codeFences.length) { |
no test coverage detected