ever had the task to verify if an input is really an email or a url, was empty or maybe a json, perhaps something else altogether and had to make use of complex regex or a variety of
if conditions to do so?
well, no more!
say hello to — validator.gs 🎉
here are the 2 things that i had to modify within the original validator.js library -
- create a whole bunch of private methods/functions: this comes as part of the best practices too but i had a need to not display a whole bunch of "helper" functions to the users when the autocomplete gets triggered and so had to modify the original library a bit to introduce trailing
_s to functions that ought not be seen
- adding jsdoc-style documentation: this is applicable when creating custom functions too — allows the library user to better understand the kind of input that's expected within the editor
well, let's face it — i'm not a skilled coder to have written a library from scratch and i knew that the best pieces of code (along with it's complexity) already existed elsewhere. so i did what i thought was best and reached out to the original license owner of the validator.js library to check if it was okay for me to do what i was about to and within an hour, i had an answer 🤩