@learncard/types 5.17.2 → 5.17.4

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/types.esm.js CHANGED
@@ -601,8 +601,11 @@ var RegExpStringValidator = z10.string().refine(
601
601
  throw new Error(`Invalid RegExp: ${error.message}`);
602
602
  }
603
603
  }).meta({ override: { type: "string" } });
604
- var RegExpValidator = z10.instanceof(RegExp).meta({ override: { type: "string" } }).or(RegExpStringValidator).meta({ override: { type: "string" } });
605
- var BaseStringQuery = z10.string().or(z10.object({ $in: z10.string().array() })).or(z10.object({ $regex: RegExpValidator.meta({ override: { type: "string" } }) }));
604
+ var RegExpValidator = z10.preprocess(
605
+ (value) => value instanceof RegExp ? `/${value.source}/${value.flags}` : value,
606
+ RegExpStringValidator
607
+ );
608
+ var BaseStringQuery = z10.string().or(z10.object({ $in: z10.string().array() })).or(z10.object({ $regex: RegExpValidator }));
606
609
  var StringQuery = z10.union([
607
610
  BaseStringQuery,
608
611
  z10.object({