Skip to content

Commit 96485c8

Browse files
committed
fix(Google-getContacts): add missing optional chaining
1 parent 1f48c26 commit 96485c8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/classes/Standardizer/plugins/Google/getters/getContacts.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Google from '../Google'
2-
import { Contact, ProfilePicture, Media } from '../../../../../types/schemas'
2+
import { Contact } from '../../../../../types/schemas'
33
import { MediaType } from '../../../../../types/schemas/Media'
44
import withAutoParser from '../../../../../modules/Standardizer/withAutoParser'
55

@@ -11,19 +11,19 @@ Google.prototype.getContacts = withAutoParser(async parser => {
1111
const rawContacts = await parser.parseAsCSV(CONTACT_FILE_CSV)
1212
const contacts: Contact[] = rawContacts.data.map((contact): Contact => ({
1313
displayName: contact?.Name,
14-
firstName: contact['Given Name'],
15-
lastName: contact['Family Name'],
14+
firstName: contact?.['Given Name'],
15+
lastName: contact?.['Family Name'],
1616
nickname: contact?.Nickname,
1717
gender: contact?.Gender,
1818
birthday: contact?.Birthday ? new Date(contact.Birthday) : undefined,
19-
phoneNumbers: contact['Phone 1 - Value'],
20-
mails: contact['E-mail 1 - Value'],
19+
phoneNumbers: contact?.['Phone 1 - Value'],
20+
mails: contact?.['E-mail 1 - Value'],
2121
profilePicture: {
2222
current: {
2323
url: contact?.Photo,
2424
type: MediaType.IMAGE,
25-
} as Media,
26-
} as ProfilePicture,
25+
},
26+
},
2727
}))
2828
return contacts
2929
}

0 commit comments

Comments
 (0)