Is there a way to exclude a specific nested property?
Let's take a look at an example.
interface ILikes {
article: string,
page: string,
userId: number | string,
}
interface IUserData {
userName: string,
isAdmin: boolean,
...data,
interests: {
likes: ILikes,
saved: {
...data
}
}
}
const userObj: Omit<IUserData, "interests"> = {
...data
}
I am trying to remove the "likes" property which is deeply nested within the data structure. It isn't possible for me to just make it optional as it is required in other parts of my codebase.