lib/json_logic/operation.rb in json_logic-0.4.5 vs lib/json_logic/operation.rb in json_logic-0.4.6
- old
+ new
@@ -14,9 +14,11 @@
v[0].any? do |val|
interpolated_block(v[1], val).truthy?
end
end,
'filter' => -> (v,d) do
+ return [] unless v[0].is_a?(Array)
+
v[0].select do |val|
interpolated_block(v[1], val).truthy?
end
end,
'substr' => -> (v,d) do