Comments (6)
Some interesting (I hope) new features I'm introducing with the refactory:
- the pre existing validators are all memoized functions
- createValidator utility to create new memoized validators
- switchCase function to compose with conditions
- ResponseMonad to create your own composing function
- withError to override the standard error messages
from deep-waters.
@GregoryLebret-STW thanks for pointing this out
I'm currently working on a huge refactory that shall allow validators to return error messages and developers to compose their own error messages.
@carlos-ds pointed out that the isURL
validator already has some bugs so I took the opportunity to completely rewrite it by using (@dperini) Diego Perini's regex which is one of the most accurate I've found so far, you can find the new isURL
version along with the refactory here:
https://github.com/antonioru/deep-waters/blob/feature/with-error/src/isURL.js
This will be part of the release 1.0.0 which is due as soon as possible...
from deep-waters.
Hello @carlos-ds
thank you very much.
I am flatted of your attention and yes I shall put everything that needs to keep this project as promising as it looks like.
Regarding the bug: I think you're right, I've been a little too shallow in writing that validator and I apologise I haven't noticed stack overflow already mentioned it wasn't a good regex to use.
I would be glad if you want to contribute by changing that validator and its tests.
At the moment I am working on a quite-big refectory of the library in order to allow validators to return a proper customisable and composable error message so I can't promise I will be able to fix this validator soon, I apologise.
Please let me know if you'll fix the this validator tho :)
cheers
from deep-waters.
Oh btw... yes I will improve the documentation as soon as I finish the refactory
from deep-waters.
Alright, but then perhaps it's best I have a go at that isURL function after you've done the necessary refactoring. When you come with more details on that refactoring, I might be able to help.
from deep-waters.
@antonioru Great job on this library. I noticed isURL fails if there is a colon in the url, which is valid.
It's probably better to completely refactor this function instead of patching with PRs.
Thanks again for the hard work.
from deep-waters.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deep-waters.