assert.d.ts 396 B

123456
  1. /**
  2. * This function asserts the given value as a function or itself.
  3. * If the value itself is a function it will evaluate it with the passed in arguments,
  4. * elsewise it will directly return itself.
  5. */
  6. export declare function assertFunctionOrSelf<T>(functionOrSelf: T, ...args: T extends (...args: any[]) => any ? Parameters<T> : never): T extends (...args: any[]) => any ? ReturnType<T> : T;