Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "Function/Length"

Index

Type aliases

Type aliases

Length

Length<Fn, fmt>: Length<Parameters<Fn>, fmt>

Extract arguments' length from a Function

Type parameters

param

to extract from

returns

string or number

example

import {F} from 'ts-toolbelt'

const fn = (a1: any, a2: any) => {}

type test0 = F.LengthOf<typeof fn>               // 2

type test1 = F.LengthOf<(a1?: any) => any>       // 0 | 1

type test2 = F.LengthOf<(...a: any[]) => any>    // number

Made with ❤️ by pirix-gh. Documentation generated by TypeDoc.