Members
(constant) initialState
Initial state for the registration form.
All fields start empty.
- Source:
(constant) isAdult
Checks if a birth date corresponds to an adult (18+ years old)
Uses the calculateAge function from module.js
- Source:
(constant) isValidEmail
Validate that an email is properly formatted.
Simple regex check for standard email patterns.
- Source:
(constant) isValidFrenchPostalCode
Validate a French postal code
Must be exactly 5 digits
- Source:
(constant) isValidName
Validate that a name is valid.
Accepts letters (including accents), apostrophes, hyphens, and spaces.
Minimum 2 characters.
- Source:
(constant) validatePerson
Validate a full person object
- Source:
Methods
calculateAge(p) → {number}
Calculate a person's age in years.
Parameters:
| Name | Type | Description |
|---|---|---|
p |
object | An object representing a person, implementing a birth Date parameter. |
Returns:
The age in years of p.
* @throws Will throw errors for missing or invalid parameters, invalid dates, or future birth dates.
- Type
- number
calculateAge()
- Source: