Jeremy Wadhams
Jeremy Wadhams
Yeah, the problem is that all JsonLogic operators are executed depth-first, except `if`, `and`, and `or`. I did this initially because (a) the original spec was all arithmetic and logic...
You could do this by combining JavaScript's filter with that rule: ``` js data.filter(function(item){ return jsonLogic.apply(filter, item); }) ``` You could also monkey-patch this onto the library quickly like: ```...
I think you're right, you could pretty quickly patch in `replace` and `add` and `remove` operations with `add_operation` that act directly on the `data` object. I'm not familiar with JsonPointer,...
BTW, you can use your existing implementation as a custom operation starting in v1.0.9, like: ``` js jsonLogic.add_operation("typeof", function(variable, type){ return typeof variable === type; }); jsonLogic.apply({"typeof":["a", "string"]}); jsonLogic.apply({"typeof":[1, "number"]});...
I lint the code continuously with JSHint while I'm developing, and I'm not seeing any errors. (If I paste `logic.js` into jshint.com I get three warnings, but all three are...
This is awesome functionality to have. May I propose some refinements? A) We keep your proposed syntax as a shortcut, and also if you call it with one argument it...
OMG how did I not notice this, I'm going to schedule some time into next sprint to work on this.
OK, this is merged up, take a look at version 1.5.0 and let me know if there's anything else I can update for you.
Hey, sorry if you're getting weird cross notifications, I've never seen that happen between repos before. This looks like good functionality to add with two caveats: 1. Would it be...
Turned on query logging, this PHP: ``` \App\Models\AccountIntegrations\TP_TradeEstimate::onlyTrashed()->count(); ``` generates this SQL: ``` select count(*) as aggregate from `account_integrations` where `account_integrations`.`deleted_at` is not null and `account_integrations`.`type` in (?) ["TP_TradeEstimate"] ```...