I'd wager it would be pretty straightforward to build a library to do this. I built something similar to verify json against user-defined schemas. You could extend that idea to check conditions or pass arguments into a callback on success.
There's something about in Lodash: lodash.com/docs/4.17.11#cond
Neat! I've never actually used lodash, but it looks like it has some really nice utility methods.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I'd wager it would be pretty straightforward to build a library to do this. I built something similar to verify json against user-defined schemas. You could extend that idea to check conditions or pass arguments into a callback on success.
There's something about in Lodash:
lodash.com/docs/4.17.11#cond
Neat! I've never actually used lodash, but it looks like it has some really nice utility methods.