You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I forked you to add the option to ignore unrecognized fields because my UI framework adds some but my Node.js API doesn't need to care. But, while reading through your code I noticed that I can get effectively the same results by instantiating my validator with a null second parameter (existing_error) :
new FieldVal(input, null);
But, I think that's just a coincidence since it still does unrecognized logic checking in generate_response().
I took a quick stab at accepting options without breaking backwards compatibility over here : darcling@76cfc05
But I only added the 'ignore unrecognized fields' option because that's what I needed : )
You may have a better way.
Thanks for the library by the way, I'm just getting rolling with it.
The text was updated successfully, but these errors were encountered:
I looked at your change and decided the best approach was to change the constructor to accommodate options as the second (optional) argument. The existing_error argument can now be supplied using the "error" property in the options. I've also added support for your additional functionality, "ignore_unrecognized". These changes are currently on the develop_options branch (60a137b). I'll merge them into a release soon if I find no severe issues with projects this library is being used in.
I forked you to add the option to ignore unrecognized fields because my UI framework adds some but my Node.js API doesn't need to care. But, while reading through your code I noticed that I can get effectively the same results by instantiating my validator with a null second parameter (existing_error) :
new FieldVal(input, null);
But, I think that's just a coincidence since it still does unrecognized logic checking in generate_response().
I took a quick stab at accepting options without breaking backwards compatibility over here :
darcling@76cfc05
But I only added the 'ignore unrecognized fields' option because that's what I needed : )
You may have a better way.
Thanks for the library by the way, I'm just getting rolling with it.
The text was updated successfully, but these errors were encountered: