Skip to content

Instantly share code, notes, and snippets.

@kevin-machship
Created July 2, 2025 01:35
Show Gist options
  • Save kevin-machship/8d2f94489bd10a83a1566876ed211985 to your computer and use it in GitHub Desktop.
Save kevin-machship/8d2f94489bd10a83a1566876ed211985 to your computer and use it in GitHub Desktop.
Function to handle email and phone fallbacks
const getEmail = (input) => {
return (
input?.consignment?.fromAddress?.email ||
input?.userInformation?.email ||
input?.company?.address?.email ||
null
)
}
const getPhone = (input) => {
return (
input?.consignment?.fromAddress?.phone ||
input?.userInformation?.phone ||
input?.company?.address?.phone ||
null
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment