coerce.*
La famille DP.coerce.* applique une normalisation avant de lancer les checkers classiques. Elle est idéale pour accepter des payloads bruts (form-data, URLSearchParams, JSON partiel) tout en garantissant un type fort en sortie.
Fonctions disponibles
DP.coerce.string(): convertit en chaîne de caractères.DP.coerce.number(): convertit en nombre ("42").DP.coerce.bigint()DP.coerce.boolean(): interprète"true","false",1,0,on,off, etc.DP.coerce.date(): accepteDate, timestamp ou ISO string et renvoie unTheDate.DP.coerce.nil(): convertitundefined/"null"versnull.DP.coerce.empty(): convertitnull/""versundefined.
Exemple global
Import direct DPC
Besoin d'un import tree-shakable ? Utilisez le namespace DPC depuis @duplojs/utils/dataParserCoerce (ou via import { DDataParserCoerce } from "@duplojs/utils").
