MCPcopy Create free account
hub / github.com/emwalker/digraph / primaryOrFirstEmail

Function primaryOrFirstEmail

client/src/server/auth/withGithub.ts:36–41  ·  view source on GitHub ↗
(emails: Email[])

Source from the content-addressed store, hash-verified

34}
35
36const primaryOrFirstEmail = (emails: Email[]) => {
37 const matches = emails.filter(({ primary }) => primary)
38 if (matches.length) return matches[0].value
39 if (emails.length) return emails[0].value
40 return null
41}
42
43const onAuthSuccessFn = (environment: Environment) => async (
44 _arg0: any, _arg1: any, profile: IProfile, done: Done,

Callers 1

onAuthSuccessFnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected