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

Function parameterCount

ark/aot/interpreter.ts:3632–3640  ·  view source on GitHub ↗
(fn: FunctionNode)

Source from the content-addressed store, hash-verified

3630}
3631
3632const parameterCount = (fn: FunctionNode): number => {
3633 let count = 0
3634 for (const param of runtimeParamsOf(fn)) {
3635 if (param.type === "AssignmentPattern" || param.type === "RestElement")
3636 break
3637 count++
3638 }
3639 return count
3640}
3641
3642// e.g. a callback passed to a library, which only arktype can define with
3643// what it's passed

Callers 2

functionStandInMethod · 0.85
classStandInMethod · 0.85

Calls 1

runtimeParamsOfFunction · 0.90

Tested by

no test coverage detected