Giter VIP home page Giter VIP logo

Comments (6)

antonioru avatar antonioru commented on June 13, 2024 3

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.

antonioru avatar antonioru commented on June 13, 2024 1

@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.

antonioru avatar antonioru commented on June 13, 2024

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.

antonioru avatar antonioru commented on June 13, 2024

Oh btw... yes I will improve the documentation as soon as I finish the refactory

from deep-waters.

carlos-ds avatar carlos-ds commented on June 13, 2024

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.

GregoryLebret-STW avatar GregoryLebret-STW commented on June 13, 2024

@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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.