Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/fonction/src/types/index.ts>String2Array

A modern practical functional library
Latest
type alias String2Array
import { type String2Array } from "https://deno.land/x/fonction@v2.1.0-beta.4/src/types/index.ts";

Convert string to array types.

Examples

Example 1

String2Array<string> string[]
String2Array<''> // []
String2Array<'hello'> // ["h", "e", "l", "l", "o"]

Type Parameters

T extends string
definition: T extends "" ? [] : T extends `${infer F}${infer R}` ? [F, ...String2Array<R>] : string[]