Skip to content

assertcheck v1.0.0


assertcheck / assert / arity

Function: arity()

ts
function arity(
   fn, 
   n, 
   opts?): void;

Defined in: src/assert.ts:1830

Asserts that fn.length equals n (declared parameter count).

Parameters

ParameterType
fn(...args) => unknown
nnumber
opts?Opts

Returns

void

Example

ts
`assert.arity(transform, 1, "pipeline steps must be unary")`

Released under the Apache 2.0 License. Built by Vagabond Studio — senior-only for growing companies.