@ai-matrx/content-ir 0.24.0 → 0.24.2

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
@@ -2533,7 +2533,10 @@ function satisfies(resolved) {
2533
2533
  resolved?.isActive && resolved.componentKey !== GENERIC_FALLBACK_COMPONENT_KEY
2534
2534
  );
2535
2535
  }
2536
- var ajv = new Ajv({ allErrors: true, strict: false });
2536
+ var ajvInstance;
2537
+ function getAjv() {
2538
+ return ajvInstance ??= new Ajv({ allErrors: true, strict: false });
2539
+ }
2537
2540
  function stripKind(value) {
2538
2541
  if (Array.isArray(value)) return value.map(stripKind);
2539
2542
  if (value && typeof value === "object") {
@@ -2557,7 +2560,7 @@ function schemaDeclaresKind(emittedJsonSchema) {
2557
2560
  function validateStructuralLeg(sample, emittedJsonSchema) {
2558
2561
  let validate;
2559
2562
  try {
2560
- validate = ajv.compile(emittedJsonSchema);
2563
+ validate = getAjv().compile(emittedJsonSchema);
2561
2564
  } catch (err) {
2562
2565
  return {
2563
2566
  ok: false,