BFE.dev solution for TypeScript puzzle
1. implement Partial<T>
Looking at the code example, we can see that Partial
means turn each property to be optional.
To get the properties we can use keyof
type A = {
a: number
b: string
}
type C = keyof A // 'a' | 'b'
Then we can just use Mapped Type to map each type to optional by ?
.
type MyPartial<T> = {
[P in keyof T]?: T[P]
}
You might also be able to find a solution fromcommunity posts or fromAI solution.