import { useMemo } from "react";
import { useEnvironment, QueryLanguage } from "@contember/binding";
const useSearchFields = (searchByFields) => {
  const sugaredSearchFields = useMemo(() => searchByFields === void 0 ? [] : Array.isArray(searchByFields) ? searchByFields : [searchByFields], [searchByFields]);
  const environment = useEnvironment();
  return useMemo(() => sugaredSearchFields.map((field) => QueryLanguage.desugarRelativeSingleField(field, environment)), [sugaredSearchFields, environment]);
};
export { useSearchFields };
//# sourceMappingURL=useSearchFields.js.map
