Giter Site home page Giter Site logo

Comments (5)

SimenB avatar SimenB commented on July 23, 2024 1

All good points. I would prefer to expand the main package, but let's see what @af thinks.

You could provide a PR in the meantime anyways if the code is already written 🙂

from envalid.

SimenB avatar SimenB commented on July 23, 2024

I'm definitely open to more built-in validators. The only custom one we have at work is for directories (checking that it exists on disk), so we haven't needed any not included yet.

And if @af would prefer to keep the built-in ones few and generic, we can certainly have a separate package with some extra ones which are linked in the readme

from envalid.

kachkaev avatar kachkaev commented on July 23, 2024

In the second scenario, I guess email and url would need to go to that separate package too, because they are more than just type checkers. It feels like they belong to the same logical group as port, host and other use-case-specific validators.

If all validators are kept in the main package, it's necessary to make sure that they can be tree-shaked. Otherwise client-size bundles (like for react-native) will be bloated. The package might need to contain a es6 version for this in parallel to the node one, but I might be wrong.

from envalid.

kachkaev avatar kachkaev commented on July 23, 2024

I'll need to clean it up a bit – will try submitting a PR this weekend. But if anyone wants to go ahead before then, feel free to do so!

from envalid.

af avatar af commented on July 23, 2024

I'm +1 on adding these validators– the filesize difference should be negligible and port/host should be pretty commonly used too. Good idea!

from envalid.

Related Issues (20)

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.