import { readonlyObject, readonlyRecord } from "../../shared/src/valita.js";
import { boolean, string } from "@badrap/valita";
const indexDefinitionSchema = readonlyObject({
  prefix: string().optional(),
  jsonPointer: string(),
  allowEmpty: boolean().optional()
});
const indexDefinitionsSchema = readonlyRecord(
  indexDefinitionSchema
);
function indexDefinitionEqual(a, b) {
  return a.jsonPointer === b.jsonPointer && (a.allowEmpty ?? false) === (b.allowEmpty ?? false) && (a.prefix ?? "") === (b.prefix ?? "");
}
function indexDefinitionsEqual(a, b) {
  if (Object.keys(a).length !== Object.keys(b).length) {
    return false;
  }
  for (const [aKey, aValue] of Object.entries(a)) {
    const bValue = b[aKey];
    if (!bValue || !indexDefinitionEqual(aValue, bValue)) {
      return false;
    }
  }
  return true;
}
export {
  indexDefinitionEqual,
  indexDefinitionSchema,
  indexDefinitionsEqual,
  indexDefinitionsSchema
};
//# sourceMappingURL=index-defs.js.map
