Module: userUtility

Provides utility functions for user validation.
Source:

Methods

(static) validateEmail(email)

Validates the user's email.
Parameters:
Name Type Description
email string The email of the user.
Source:
Throws:
- Throws an error if the email is invalid.
Type
Error

(static) validateName(name)

Validates the user's name.
Parameters:
Name Type Description
name string The name of the user.
Source:
Throws:
- Throws an error if the name is invalid.
Type
Error

(static) validatePassword(password)

Validates the user's password.
Parameters:
Name Type Description
password string The password of the user.
Source:
Throws:
- Throws an error if the password is invalid.
Type
Error

(static) validateRequestBody(body, requiredFields)

Validates the request body for required fields.
Parameters:
Name Type Description
body Object The request body.
requiredFields Array.<string> The list of required fields.
Source:
Throws:
- Throws an error if any of the required fields are missing.
Type
Error

(static) validateUserRegistration(name, email, password)

Validates the user's registration data.
Parameters:
Name Type Description
name string The name of the user.
email string The email of the user.
password string The password of the user.
Source:
Throws:
- Throws an error if any of the registration data is invalid.
Type
Error