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

Function isLikelyTabValue

packages/docs/content/api.test.ts:223–227  ·  view source on GitHub ↗
(actual: string, expected: string)

Source from the content-addressed store, hash-verified

221}
222
223function isLikelyTabValue(actual: string, expected: string): boolean {
224 const normalizedActual = normalizeTabValue(actual);
225 const normalizedExpected = normalizeTabValue(expected);
226 return normalizedActual === normalizedExpected || getEditDistance(normalizedActual, normalizedExpected) <= 1;
227}
228
229function normalizeTabValue(value: string): string {
230 return value.toLowerCase().replaceAll(/[\s_-]/g, "");

Callers 1

assertExpectedTabLabelsFunction · 0.85

Calls 2

normalizeTabValueFunction · 0.85
getEditDistanceFunction · 0.85

Tested by

no test coverage detected