All checks were successful
Auto Tag Develop / tag (push) Successful in 6s
| Numéro du ticket | Titre du ticket | |------------------|-----------------| | | | ## Description de la PR ## Modification du .env ## Check list - [x] Pas de régression - [x] TU/TI/TF rédigée - [x] TU/TI/TF OK - [ ] CHANGELOG modifié Co-authored-by: Matthieu <mtholot19@gmail.com> Reviewed-on: #8 Co-authored-by: tristan <tristan@yuno.malio.fr> Co-committed-by: tristan <tristan@yuno.malio.fr>
20 lines
575 B
TypeScript
20 lines
575 B
TypeScript
/**
|
|
* Utilitaires de couleur partages.
|
|
*
|
|
* Aligne sur la regex backend stricte #RRGGBB (voir Site.php).
|
|
*/
|
|
|
|
const HEX_COLOR_REGEX = /^#[0-9A-Fa-f]{6}$/
|
|
|
|
/**
|
|
* Valide qu'une chaine respecte le format #RRGGBB strict (7 caracteres,
|
|
* 6 chiffres hexadecimaux apres le #). Tolere la casse (majuscules,
|
|
* minuscules, mixte).
|
|
*
|
|
* Utilise cote front par SiteDrawer pour bloquer le submit avant l'envoi
|
|
* backend — miroir du pattern Symfony Assert\Regex sur Site::$color.
|
|
*/
|
|
export function isValidSiteColor(hex: string): boolean {
|
|
return HEX_COLOR_REGEX.test(hex)
|
|
}
|