/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { astToFunction } from "./conformance-compiler.js";
function createConformanceValidator(schema, supervisor, nextValidator) {
  const validate = astToFunction(schema, supervisor);
  if (!validate && !nextValidator) {
    return void 0;
  }
  return (value, session, location) => {
    const cfg = location.config?.supervision;
    if (cfg?.validate === false) {
      return;
    }
    if (cfg?.conformance !== false) {
      validate?.(value, session, location);
    }
    if (value !== void 0) {
      nextValidator?.(value, session, location);
    }
  };
}
export {
  createConformanceValidator
};
//# sourceMappingURL=conformance.js.map
