The checks to run; see ValidateBatchItem.
{ valid, errors }, where errors holds one labelled message per failure and is
empty when everything passed.
const result = GeoLeaf.Validators.validateBatch([
{
value: 45.5017,
// `value` est typé `unknown` : un adaptateur doit re-narrower avant d'appeler
// un validateur qui attend un type précis.
validator: (v, opts) => GeoLeaf.Validators.validateCoordinates(Number(v), 0, opts),
label: "latitude",
},
{
value: "https://example.com",
validator: GeoLeaf.Validators.validateUrl,
label: "url",
},
{
value: "user@example.com",
validator: GeoLeaf.Validators.validateEmail,
label: "email",
},
]);
// Returns: { valid: true, errors: [] }
// Si erreurs : { valid: false, errors: ['latitude: ...', 'url: ...'] }
Runs several validations and collects every failure.
Each entry names its own validator, so heterogeneous checks share one pass. Messages are prefixed by the entry's
label, which is what makes an aggregate report readable. Unlike the single-value validators, this one never throws — it returns the full ValidationResult.