22 lines
649 B
TypeScript
22 lines
649 B
TypeScript
/*
|
|
* File: validators.ts
|
|
* Description: Common input validation functions.
|
|
* Design & Developed by Tech4Biz Solutions
|
|
* Copyright (c) Spurrin Innovations. All rights reserved.
|
|
*/
|
|
|
|
/**
|
|
* Validates an email address against a standard regex pattern.
|
|
* @param email The email address string to validate.
|
|
* @returns `true` if the email is valid, `false` otherwise.
|
|
*/
|
|
export const validateEmail = (email: string): boolean => {
|
|
const regex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
return regex.test(email);
|
|
};
|
|
|
|
/*
|
|
* End of File: validators.ts
|
|
* Design & Developed by Tech4Biz Solutions
|
|
* Copyright (c) Spurrin Innovations. All rights reserved.
|
|
*/
|