Renamed nullable utils into isDefined and isUndefinedOrNull (#4402)

* Renamed nullable utils into isDefined and isUndefinedOrNull
This commit is contained in:
Lucas Bordeau
2024-03-11 14:28:57 +01:00
committed by GitHub
parent 3f15cc5b7a
commit 581dfafe11
169 changed files with 469 additions and 493 deletions

View File

@ -1,7 +1,7 @@
import { isNonEmptyString } from '@sniptt/guards';
import { EmailThreadMessageParticipant } from '@/activities/emails/types/EmailThreadMessageParticipant';
import { isNonNullable } from '~/utils/isNonNullable';
import { isDefined } from '~/utils/isDefined';
export const getDisplayNameFromParticipant = ({
participant,
@ -10,14 +10,14 @@ export const getDisplayNameFromParticipant = ({
participant: EmailThreadMessageParticipant;
shouldUseFullName?: boolean;
}) => {
if (isNonNullable(participant.person)) {
if (isDefined(participant.person)) {
return (
`${participant.person?.name?.firstName}` +
(shouldUseFullName ? ` ${participant.person?.name?.lastName}` : '')
);
}
if (isNonNullable(participant.workspaceMember)) {
if (isDefined(participant.workspaceMember)) {
return (
participant.workspaceMember?.name?.firstName +
(shouldUseFullName