MCPcopy Create free account
hub / github.com/arktypeio/arktype / checkArity

Function checkArity

ark/type/runtime.ts:1365–1376  ·  view source on GitHub ↗
(
	value: unknown,
	expected: number,
	label?: string
)

Source from the content-addressed store, hash-verified

1363// a function's fact alone, its arity, so a program whose holes are functions
1364// ships nothing of what tells a class or a symbol from the one a build read
1365export const checkArity = (
1366 value: unknown,
1367 expected: number,
1368 label?: string
1369): void =>
1370 checkFacts(
1371 typeof value !== "function" || isValidator(value) ?
1372 describeValue(value)
1373 : Math.min(value.length, 2),
1374 expected,
1375 label
1376 )
1377
1378const describeFact = (fact: HoleFact): string =>
1379 typeof fact === "string" ? fact : (

Callers 1

transform.test.tsFile · 0.90

Calls 3

checkFactsFunction · 0.85
describeValueFunction · 0.85
isValidatorFunction · 0.70

Tested by

no test coverage detected