Skip to content

Documentation / listr2 / assertFunctionOrSelf

Function: assertFunctionOrSelf()

assertFunctionOrSelf<T>(functionOrSelf, ...args): T extends (...args) => any ? ReturnType<T> : T

This function asserts the given value as a function or itself. If the value itself is a function it will evaluate it with the passed in arguments, elsewise it will directly return itself.

Type Parameters

T

Parameters

functionOrSelf: T

• ...args: T extends (...args) => any ? Parameters<T<T>> : never

Returns

T extends (...args) => any ? ReturnType<T> : T

Defined in

packages/listr2/src/utils/assert.ts:6