MCPcopy
hub / github.com/colinhacks/zod / assertExpectedTabLabels

Function assertExpectedTabLabels

packages/docs/content/api.test.ts:182–199  ·  view source on GitHub ↗
(block: TabsBlock, failures: string[])

Source from the content-addressed store, hash-verified

180}
181
182function 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
201function compareCodeFences(block: TabsBlock, zodTab: TabBlock, zodMiniTab: TabBlock, failures: string[]): void {
202 if (zodTab.codeFences.length !== zodMiniTab.codeFences.length) {

Callers 1

api.test.tsFile · 0.85

Calls 1

isLikelyTabValueFunction · 0.85

Tested by

no test coverage detected