Skip to content

Commit

Permalink
allow single element in either/all/not structures
Browse files Browse the repository at this point in the history
  • Loading branch information
mickeyn committed Jun 4, 2014
1 parent 8e0e41c commit 131e005
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 1 addition & 3 deletions examples/complex-either-and.pl
Expand Up @@ -9,9 +9,7 @@
{ name => 'Dave *' },
{ name => 'David *' },
],
all => [
{ email => '*gmail.com' }
],
all => { email => '*gmail.com' },
});

my %output = (
Expand Down
1 change: 1 addition & 0 deletions lib/MetaCPAN/Client/Request.pm
Expand Up @@ -140,6 +140,7 @@ sub _build_query_rec {

KEY: for my $k ( qw/ all either not / ) {
my $v = delete $args->{$k} || next KEY;
ref $v eq 'HASH' and $v = [ $v ];
ref $v eq 'ARRAY' or croak "invalid value for key $k";

undef $basic_element;
Expand Down

0 comments on commit 131e005

Please sign in to comment.