14 lines
280 B
JavaScript
14 lines
280 B
JavaScript
/**
|
|
* Utility functions for the application.
|
|
*/
|
|
|
|
const isValidDomain = (domain) => {
|
|
// Regular expression to validate a domain name
|
|
const domainRegex = /^(?!:\/\/)([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/;
|
|
return domainRegex.test(domain);
|
|
}
|
|
|
|
module.exports = {
|
|
isValidDomain
|
|
};
|