import type { Args, Fn } from "../HKT"; import type { List } from "../List"; import type { Assert } from "../helpers"; /** * Returns a list of characters of a string. * * Sig: `(s: string) => List` */ export type ToChars = Assert< List, string extends S ? List : S extends `${infer Head}${infer Tail}` ? readonly [Head, ...ToChars] : readonly [] >; /** * [Fn] Returns a list of characters of a string. * * Sig: `(s: string) => List` */ export default interface ToCharsFn extends Fn<[string], List> { def: ([s]: Args) => ToChars; }