Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardTypeScripttype-level string parsingSingle-choice MCQ

In this type-level trimmer, what is `R`, and which detail of template-literal inference with a union delimiter governs it?

type TrimLeft<S extends string> = S extends `${" " | "\n" | "\t"}${infer Rest}` ? TrimLeft<Rest> : S; type R = TrimLeft<" \n\tx ">;