Skip to content

Commit

Permalink
Merge pull request #265 from rabbitmq/make-IS_KHEPRI_CONDITION-more-s…
Browse files Browse the repository at this point in the history
…trict

include/khepri.hrl: Make `?IS_KHEPRI_CONDITION/1` stricter
  • Loading branch information
dumbbell authored Jul 14, 2024
2 parents bca3c7a + 0d3dfdc commit 23cda49
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion include/khepri.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,20 @@
-define(IS_KHEPRI_PATH(Path),
(Path =:= [] orelse ?IS_KHEPRI_PATH_COMPONENT(hd(Path)))).

-define(IS_KHEPRI_CONDITION(Condition), is_tuple(Condition)).
-define(IS_KHEPRI_CONDITION(Condition),
(is_record(Condition, if_child_list_length) orelse
is_record(Condition, if_child_list_version) orelse
is_record(Condition, if_data_matches) orelse
is_record(Condition, if_has_data) orelse
is_record(Condition, if_has_payload) orelse
is_record(Condition, if_has_sproc) orelse
is_record(Condition, if_name_matches) orelse
is_record(Condition, if_node_exists) orelse
is_record(Condition, if_path_matches) orelse
is_record(Condition, if_payload_version) orelse
is_record(Condition, if_not) orelse
is_record(Condition, if_all) orelse
is_record(Condition, if_any))).

-define(IS_KHEPRI_PATH_CONDITION(PathCondition),
(?IS_KHEPRI_PATH_COMPONENT(PathCondition) orelse
Expand Down

0 comments on commit 23cda49

Please sign in to comment.