Type alias EitherOneOrMany<T>

EitherOneOrMany<T>: T | T[]

Represents a type that can be either a single value of type T or an array of values of type T.

Type Parameters

  • T

Example

type T1 = EitherOneOrMany<number>; 10; // Valid
type T2 = EitherOneOrMany<number>; [20, 30]; // Also valid