UNPKG

@cuppachino/type-space

Version:

A collection of type utilities for TypeScript.

11 lines (10 loc) 253 B
import type { Stringifiable } from './stringifiable'; /** * Converts a type to a template literal type, if possible. * * @example * ``` * Stringify<1 | 2> // '1' | '2' * ``` */ export type Stringify<T> = T extends Stringifiable ? `${T}` : never;