Download wp-calypso/client/lib/emails/has-unverified-email-forward.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 751 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/lib/emails/has-unverified-email-forward.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/lib/emails/has-unverified-email-forward.js
-
curl -L -o has-unverified-email-forward.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/lib/emails/has-unverified-email-forward.js
751 Bytes
| import { EMAIL_WARNING_SLUG_UNVERIFIED_FORWARDS } from './email-provider-constants'; | |
| /** | |
| * Indicates whether the supplied email account has an unverified email forward warning | |
| * for any of its mailboxes. | |
| * @param {Object} emailAccount - Email account object returned from the server. | |
| * @returns {boolean} - Returns whether an email for the email account has an unverified email warning. | |
| */ | |
| export function hasUnverifiedEmailForward( emailAccount ) { | |
| if ( ! emailAccount?.emails?.length ) { | |
| return false; | |
| } | |
| return emailAccount.emails.some( ( email ) => { | |
| if ( ! email?.warnings?.length ) { | |
| return false; | |
| } | |
| return email.warnings.some( | |
| ( warning ) => warning?.warning_slug === EMAIL_WARNING_SLUG_UNVERIFIED_FORWARDS | |
| ); | |
| } ); | |
| } | |