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` is typed `unknown`: an adapter must re-narrow before calling
// a validator expecting a precise type.
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.