typedash
Version:
modern, type-safe collection of utility functions
13 lines • 405 B
text/typescript
//#region src/types/Many.d.ts
type MutableMany<T> = T | T[];
type ImmutableMany<T> = T | readonly T[];
/**
* Represents a value that can be either a single value or an array of values.
*/
type Many<T, Type extends 'mutable' | 'immutable' = 'immutable'> = {
immutable: ImmutableMany<T>;
mutable: MutableMany<T>;
}[Type];
//#endregion
export { Many as t };
//# sourceMappingURL=Many-bCNxekD7.d.cts.map