@learncard/helpers 1.3.4 → 1.3.5
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/helpers.cjs.development.cjs +116 -105
- package/dist/helpers.cjs.development.cjs.map +2 -2
- package/dist/helpers.cjs.production.min.cjs +5 -5
- package/dist/helpers.cjs.production.min.cjs.map +3 -3
- package/dist/helpers.esm.js +10 -3
- package/dist/helpers.esm.js.map +2 -2
- package/package.json +2 -2
package/dist/helpers.esm.js
CHANGED
|
@@ -14226,6 +14226,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14226
14226
|
if (!match) throw new Error("Invalid RegExp string format");
|
|
14227
14227
|
return { pattern: match[1], flags: match[2] };
|
|
14228
14228
|
}, "parseRegexString");
|
|
14229
|
+
var withStringOverride = /* @__PURE__ */ __name2((schema) => {
|
|
14230
|
+
const metaSchema = schema;
|
|
14231
|
+
if (typeof metaSchema.meta === "function") {
|
|
14232
|
+
return metaSchema.meta({ override: { type: "string" } });
|
|
14233
|
+
}
|
|
14234
|
+
return schema;
|
|
14235
|
+
}, "withStringOverride");
|
|
14229
14236
|
var RegExpStringValidator = external_exports.string().refine(
|
|
14230
14237
|
(str) => {
|
|
14231
14238
|
try {
|
|
@@ -14245,9 +14252,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14245
14252
|
} catch (error46) {
|
|
14246
14253
|
throw new Error(`Invalid RegExp: ${error46.message}`);
|
|
14247
14254
|
}
|
|
14248
|
-
})
|
|
14249
|
-
var RegExpValidator = external_exports.instanceof(RegExp).
|
|
14250
|
-
var BaseStringQuery = external_exports.string().or(external_exports.object({ $in: external_exports.string().array() })).or(external_exports.object({ $regex: RegExpValidator
|
|
14255
|
+
});
|
|
14256
|
+
var RegExpValidator = withStringOverride(external_exports.instanceof(RegExp).or(RegExpStringValidator));
|
|
14257
|
+
var BaseStringQuery = external_exports.string().or(external_exports.object({ $in: external_exports.string().array() })).or(external_exports.object({ $regex: RegExpValidator }));
|
|
14251
14258
|
var StringQuery = external_exports.union([
|
|
14252
14259
|
BaseStringQuery,
|
|
14253
14260
|
external_exports.object({
|