Type alias Str<T>

Str<T>: T extends string
    ? T
    : `${T}`

将类型转换成字符串类型, 支持传入 string | number | bigint | boolean

Type Parameters

  • T extends string | number | bigint | boolean

Example

Str<123> // "123"
Str<true> // "true"

Generated using TypeDoc