Giter Site home page Giter Site logo

Comments (8)

af avatar af commented on July 3, 2024 1

We already support isDev, and removing that would require a major version bump for what is (IMO) a very minor feature. I don't think the migration would be worth upgrading for most people. So I think removing isDev is out.

I'm ok with adding an isDevelopment alias (and isProd to prevent things like #66). Having the duplicate properties is a minor annoyance but if it makes the library more convenient for folks I think it's worth it.

from envalid.

SimenB avatar SimenB commented on July 3, 2024

I think that makes sense. Hasn't been too long since I was confused about it: #66

from envalid.

rfgamaral avatar rfgamaral commented on July 3, 2024

Let me know if you'd rather I open a merge request :)

from envalid.

af avatar af commented on July 3, 2024

Personally I like that isDev is shorter, and has no loss of readability. However, the NODE_ENV convention is 'development' so I can see how this would be confusing. Maybe we should support both?

from envalid.

SimenB avatar SimenB commented on July 3, 2024

It should either be isDev & isProd or isDevelopment & isProduction. Or all of them, of course 🙂 But having one short and one long is confusing

from envalid.

rfgamaral avatar rfgamaral commented on July 3, 2024

I know most people prefer shorter naming but my personal opinion is that this is code, and it should be as readable and as clear as possible in conveying it's meaning. Thus my vote goes for isDevelopment and isProduction.

Also, it always look weird to have isDev, isProd and isTest (although less used). Two of them are diminutives, the other is the exact word. Again, no consistency.

Supporting all of them is the alternative and I'm not sure what to think of that. If it was my package, my code base, I would prefer to just support one mode, the longer one. But that's just me. In the end, it's your call :)

from envalid.

SimenB avatar SimenB commented on July 3, 2024

My vote is adding both isDevelopment and isProd now so all is supported, and whenever the next major version comes out, remove the short ones. Not worth a major at this point, though

from envalid.

rfgamaral avatar rfgamaral commented on July 3, 2024

Awesome. Thank guys.

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.