Closed vfonic closed 6 years ago
I did a Code Pen where I copied the default messages and "extended" in a new message. Edited: I see it now. I'm dumb. The codepen shows that is is not spreading correctly
Gotta another pen here that shows how mergeWith can combine the two.
Thanks @brooksbecton!
What do you suggest would be the best way to use this in my project's code? Should I just directly manipulate SimpleSchema._globalMessages
?
Do you think this should be added to the simple-schema code itself? I'm really swamped right now, but if I find some time I could submit a PR.
According to the README
NOTE: "v2" of this package is an NPM package. Please use the NPM package even in Meteor apps. This Meteor package will get only critical fixes...
This seems important, but it is up to the maintainers on whether this is a critical fix or not.
The npm package for simple-schema-js is using extend which does properly spread the default messages with the new messages. So if you can migrate over to it, that would probably be best.
Also wanted to note here that this repo is using underscore.js not lodash.
The Meteor SimpleSchema package is no longer maintained other than critical fixes to keep it running with each latest Meteor release. Closing non-critical issues in this repo. Anyone who cares about this may do one or more of the following:
I just realized that doing this:
...removes all other
regEx
validation error messages and I'm getting a lot of "Unknown validation error" for, for exampleSimpleSchema.RegEx.Email
. Is there a way to append/replace only a singleexp
?