Download wp-calypso/client/lib/emails/account-has-warning-with-slug.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 632 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/lib/emails/account-has-warning-with-slug.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/lib/emails/account-has-warning-with-slug.js
-
curl -L -o account-has-warning-with-slug.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/lib/emails/account-has-warning-with-slug.js
632 Bytes
| /** | |
| * Determines if the email account provided i.e. `emailAccount` has one or more warnings with the slug `warningSlug` in its `warnings` array | |
| * @param {string} warningSlug - The warning slug to check against | |
| * @param {Object} emailAccount - The email account being investigated for warnings of a certain slug | |
| * @returns {boolean} Returns true if warnings with the slug are found, false otherwise | |
| */ | |
| export function accountHasWarningWithSlug( warningSlug, emailAccount ) { | |
| const warnings = emailAccount?.warnings; | |
| return ( warnings?.[ 0 ] ? warnings : [] ).some( | |
| ( warning ) => warningSlug === warning?.warning_slug | |
| ); | |
| } | |