coerce.*
The DP.coerce.* family applies normalization before running the usual checkers. It is ideal to accept raw payloads (form-data, URLSearchParams, partial JSON) while guaranteeing a strong output type.
Available functions
DP.coerce.string(): converts to string.DP.coerce.number(): converts to number ("42").DP.coerce.bigint()DP.coerce.boolean(): interprets"true","false",1,0,on,off, etc.DP.coerce.date(): acceptsDate, timestamp, or ISO string and returns aTheDate.DP.coerce.nil(): convertsundefined/"null"tonull.DP.coerce.empty(): convertsnull/""toundefined.
Global example
Direct DPC import
Need a tree-shakable import? Use the DPC namespace from @duplojs/utils/dataParserCoerce (or via import { DDataParserCoerce } from "@duplojs/utils").
