Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/mean-apes-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/backend': patch
---

Add JSdoc comments for user methods.
12 changes: 12 additions & 0 deletions packages/backend/src/api/resources/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,18 +185,30 @@ export class User {
return res;
}

/**
* The primary email address of the user.
*/
get primaryEmailAddress() {
return this.emailAddresses.find(({ id }) => id === this.primaryEmailAddressId) ?? null;
}

/**
* The primary phone number of the user.
*/
get primaryPhoneNumber() {
return this.phoneNumbers.find(({ id }) => id === this.primaryPhoneNumberId) ?? null;
}

/**
* The primary web3 wallet of the user.
*/
get primaryWeb3Wallet() {
return this.web3Wallets.find(({ id }) => id === this.primaryWeb3WalletId) ?? null;
}

/**
* The full name of the user.
*/
get fullName() {
return [this.firstName, this.lastName].join(' ').trim() || null;
}
Expand Down
Loading