Skip to main content
Module

x/tsafe/Parameters.ts

🔩 The missing TypeScript utils
Go to Latest
File
/* eslint-disable @typescript-eslint/no-explicit-any */
/** * Obtain the parameters of a function type in a tuple * ...(event if the function type can be nullish). * Better that the default because prevent from having to do Parameters<NonNullable<typeof f>> */export type Parameters< T extends ((...args: any[]) => unknown) | null | undefined | false | ""> = T extends (...args: infer P) => any ? P : never;