This is probably a very trivial question, but after reading other answers on typescript, my head is exploding.
Lets say I have a type of User fields I want to get
export type UserFileds = {
id: User["id"];
email: User["email"];
emailVerified: User["emailVerified"];
image: User["image"];
name: User["name"];
};
Now I need to get all of those fileds from the data I get. This is how I make it before:
const { id, email, emailVerified, image, name } = user as User;
return { id, email, emailVerified, image, name };
How can I put dynamically all this keys from UserFileds, like:
const { "list of keys of UserFileds" } = user as User;
Thanks