Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 562 Bytes

File metadata and controls

42 lines (30 loc) · 562 Bytes

typelab / utils / ParseString

type ParseString<T> = T extends string ? T : T extends string | number | boolean | null | undefined ? `${T}` : T extends bigint ? `${T}n` : never;

Converts a type to a string.

Type Parameters

Type Parameter Description

T

The type to convert.

Returns

The string representation of the type.

Example

type Stringified = ParseString<11>; // '11'