I like the tricks :) – Kasia
You can use Pick to avoid duplication and keep in sync two types.
type Post = { author: string, title: string, body: string, } type PostPreview = { title: string, body: string, } // ⛔️ Need to keep in sync with Post
type Post = { author: string, title: string, body: string, } type PostPreview = Pick<Post, 'title'|'body'> type PostPreview = Pick<Post, 'hah'> // ✅ Does not compile
Crafted with 💛 by Riccardo