Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/tsafe/Param0.ts

🔩 The missing TypeScript utils
Go to Latest
File
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { Parameters } from "./Parameters.ts";
type NonUndefined<T> = T extends undefined ? never : T;
/** Shorthand for Parameters<typeof f>[0] https://docs.tsafe.dev/param0 */export type Param0<T extends ((...args: any[]) => unknown) | null | undefined | false | ""> = [ Parameters<T>,] extends [never] ? never : Parameters<T> extends [] ? void : NonUndefined<Parameters<T>[0]>;