Skip to content

Type Alias: FirstNonErrorArg<T>

ts
type FirstNonErrorArg<T> = T extends (...args: infer Params) => any
  ? FirstNonErrorTuple<Params>
  : any;

Extracts the first non-error argument from a function's parameters.

Type Parameters

Type ParameterDescription
TThe function type to extract the argument from.