diegoholiveira / jsonlogic

Go Lang implementation of JsonLogic
MIT License
159 stars 49 forks source link

support for primitive object return values #59

Closed tlugger closed 2 years ago

tlugger commented 2 years ago

Adds an additional check while recursively parsing through a rule map. If the parsed map has more than 1 key, treat it as a primitive and return. This matches logic currently implemented in the javascript is_logic check: https://github.com/jwadhams/json-logic-js/blob/9c805e9ac6a3787e8508e982a079888d3cc295b5/logic.js#L180

Resolves #58

codecov[bot] commented 2 years ago

Codecov Report

Merging #59 (017dac2) into master (b177c64) will increase coverage by 0.03%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #59      +/-   ##
==========================================
+ Coverage   95.78%   95.82%   +0.03%     
==========================================
  Files           9        9              
  Lines         950      957       +7     
==========================================
+ Hits          910      917       +7     
  Misses         28       28              
  Partials       12       12