Sequence NODE_171
EasyUse Pick to Select Specific Fields
TypeScript
Technical Specification
Create a PublicUser type that only has 'id' and 'name' from User.
Input/Output Samples
Input:PublicUser
Output:{ id: number; name: string }
Optimal Logic Path
type User = {
id: number;
name: string;
email: string;
isAdmin: boolean;
};
type PublicUser = Pick<User, "id" | "name">;Architectural Deep-Dive
Pick is useful for shaping data transfer objects where not all fields should be exposed.