Skip to content

Instantly share code, notes, and snippets.

View younessdev9's full-sized avatar
🎯
Focusing

Youness younessdev9

🎯
Focusing
View GitHub Profile
// typescript utilities
// make field optional oa type
type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
type User = { name: string; age: number }
type UserWithoutAge = Optional<User, "age" >