cf.completefrontend

Write the codeHard

Write PathKeys<T>: every dot path into a nested object, like "account.address.city".

PathKeys<T> is the union of every path to a property of T: each top-level key, and for each property whose value is an object, that key, a dot, and each path inside it. Treat arrays as leaves, so there are no paths into them. An optional object property still has its paths. A type that refers to itself, like a linked list, must not break the compiler: stop after 5 levels.

Write this
type PathKeys<T> = keyof T; // type Settings = { theme: string; account: { email: string; address?: { city: string } } };// PathKeys<Settings>// // "theme" | "account" | "account.email" | "account.address" | "account.address.city"

Solve it in the editor

The answer

Write it yourself first. Then compare it with a reference solution and the checks it passes.

Checking your sign-in…