@learncard/types 5.17.3 → 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
@@ -581,13 +581,6 @@ var parseRegexString = /* @__PURE__ */ __name((regexStr) => {
581
581
  if (!match) throw new Error("Invalid RegExp string format");
582
582
  return { pattern: match[1], flags: match[2] };
583
583
  }, "parseRegexString");
584
- var withStringOverride = /* @__PURE__ */ __name((schema) => {
585
- const metaSchema = schema;
586
- if (typeof metaSchema.meta === "function") {
587
- return metaSchema.meta({ override: { type: "string" } });
588
- }
589
- return schema;
590
- }, "withStringOverride");
591
584
  var RegExpStringValidator = z10.string().refine(
592
585
  (str) => {
593
586
  try {
@@ -607,8 +600,11 @@ var RegExpStringValidator = z10.string().refine(
607
600
  } catch (error) {
608
601
  throw new Error(`Invalid RegExp: ${error.message}`);
609
602
  }
610
- });
611
- var RegExpValidator = withStringOverride(z10.instanceof(RegExp).or(RegExpStringValidator));
603
+ }).meta({ override: { type: "string" } });
604
+ var RegExpValidator = z10.preprocess(
605
+ (value) => value instanceof RegExp ? `/${value.source}/${value.flags}` : value,
606
+ RegExpStringValidator
607
+ );
612
608
  var BaseStringQuery = z10.string().or(z10.object({ $in: z10.string().array() })).or(z10.object({ $regex: RegExpValidator }));
613
609
  var StringQuery = z10.union([
614
610
  BaseStringQuery,