Record Types
Record Type
π¨βπΌ We need a lookup table by ID and a count for each role. A
Record type
gives us a clean way to describe those object shapes.π¨ Open
and:
- Create a
UsersByIdtype usingRecordthat maps string IDs toUser - Create a
RoleCountstype usingRecordthat maps role strings to numbers - Type the provided
usersByIdandroleCountsobjects with those aliases (remove the@ts-expect-errorcomments once the types exist) - Export
usersByIdandroleCountsby name
Completion criteria
- Named exports:
usersById,roleCounts usersById.u1.nameis'Ava'andusersById.u2.roleis'member'roleCountsdeep-equals{ admin: 1, member: 1 }


