diff --git a/src/Components/CreateImageWizardV2/validators.ts b/src/Components/CreateImageWizardV2/validators.ts index d740673d..ca1357f5 100644 --- a/src/Components/CreateImageWizardV2/validators.ts +++ b/src/Components/CreateImageWizardV2/validators.ts @@ -1,21 +1,15 @@ export const isAwsAccountIdValid = (awsAccountId: string | undefined) => { - if ( + return ( awsAccountId !== undefined && /^\d+$/.test(awsAccountId) && awsAccountId.length === 12 - ) { - return true; - } - return false; + ); }; export const isGcpEmailValid = (gcpShareWithAccount: string | undefined) => { - if ( + return ( gcpShareWithAccount !== undefined && /^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,12}$/.test(gcpShareWithAccount) && gcpShareWithAccount.length <= 253 - ) { - return true; - } - return false; + ); };