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

When the checker matches a string against the template literal pattern `` `${infer A}.${infer B}` `` for the input `"a.b.c"`, how is the split point chosen for the placeholder before a literal delimiter?

type FirstDot<S extends string> = S extends `${infer A}.${infer B}` ? A : never; type R = FirstDot<"a.b.c">;