TotalTechGeek / json-logic-engine

Construct complex rules with JSON & process them.
MIT License
43 stars 9 forks source link

fix: enhance length validation for different parameter types #10

Closed tatarysh closed 1 year ago

tatarysh commented 1 year ago

I noticed that the logic crashes when I want to check the length of a value that may be null in some cases, I made a fix for that - maybe someone will find it useful.

TotalTechGeek commented 1 year ago

This is a good catch! I may want to iterate on this further for additional data types (Maps, Sets, etc); but this change in behavior is quite reasonable.

I think I'll merge this as-is, and contribute a few tests.

TotalTechGeek commented 1 year ago

Tests have been added and I have released the change as 1.2.7; have a great day!