shaKY-iota / type-challenges

Collection of TypeScript type challenges with online judge
https://tsch.js.org/
MIT License
0 stars 0 forks source link

8 - Readonly 2 #11

Open shaKY-iota opened 2 years ago

shaKY-iota commented 2 years ago
// your answers
type MyReadonly2<T, K extends keyof T = keyof T> = Readonly<Pick<T, K>> & Pick<T, Exclude<keyof T, K>>
shaKY-iota commented 2 years ago
// your answers
type MyReadonly2<T, K extends keyof T = keyof T> = Readonly<Pick<T, K>> & Omit<T, K>