You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// get from https://github.com/microsoft/TypeScript/issues/20423#issuecomment-812564842typePathOf<T,Kextendsstring,Pextendsstring="">=Kextends `${infer U}.${infer V}`
? UextendskeyofT ? PathOf<T[U],V, `${P}${U}.`> : `${P}${keyofT&(string|number)}`
: KextendskeyofT ? `${P}${K}` : `${P}${keyofT&(string|number)}`;declarefunctionconsumer<Kextendsstring>(path: PathOf<{a: string,b: {c: string}},K>) : number;// suggestion works well in 4.6, and not work in 4.7consumer('b.')
Bug Report
π Search Terms
suggestion pathof
π Version & Regression Information
4.7
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
π Expected behavior