@mastra/schema-compat 1.3.1 → 1.3.2-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4499,18 +4499,20 @@ var SchemaCompatLayer2 = class {
4499
4499
  if (checks) {
4500
4500
  for (const check of checks) {
4501
4501
  switch (check._zod.def.check) {
4502
+ // `.max(d)` lowers the upper bound, stored as a `less_than` check: the date must be older than `d`.
4502
4503
  case "less_than":
4503
- const minDate = new Date(check._zod.def.value);
4504
- if (!isNaN(minDate.getTime())) {
4505
- constraints.push(`Date must be newer than ${minDate.toISOString()} (ISO)`);
4506
- }
4507
- break;
4508
- case "greater_than":
4509
4504
  const maxDate = new Date(check._zod.def.value);
4510
4505
  if (!isNaN(maxDate.getTime())) {
4511
4506
  constraints.push(`Date must be older than ${maxDate.toISOString()} (ISO)`);
4512
4507
  }
4513
4508
  break;
4509
+ // `.min(d)` raises the lower bound, stored as a `greater_than` check: the date must be newer than `d`.
4510
+ case "greater_than":
4511
+ const minDate = new Date(check._zod.def.value);
4512
+ if (!isNaN(minDate.getTime())) {
4513
+ constraints.push(`Date must be newer than ${minDate.toISOString()} (ISO)`);
4514
+ }
4515
+ break;
4514
4516
  }
4515
4517
  }
4516
4518
  }