Skip to content

TypeAlias.FirstNChars

github-actions[bot] edited this page Jul 8, 2026 · 34 revisions

umt / FirstNChars

Type Alias: FirstNChars<S, N, C, A>

FirstNChars<S, N, C, A> = C["length"] extends N ? A : S extends `${infer Head}${infer Rest}` ? FirstNChars<Rest, N, [...C, Head], `${A}${Head}`> : never

Defined in: types/logic/firstNChars.ts:1

Type Parameters

S

S extends string

N

N extends number

C

C extends unknown[] = []

A

A extends string = ""

API

Classes

Interfaces

Type Aliases

Variables

Functions

Clone this wiki locally