Code Monkey home page Code Monkey logo

Comments (5)

SimenB avatar SimenB commented on May 20, 2024

Having it throw has caught bugs before hitting production for us, which is a use case I think is more important than debuggability.

That said, we have added extra stuff allowing you to e.g. console.log the object, so if you can send a PR to make it support lodash's size that would be great.

I can also support adding a second mode which was the original "strict" (just exposing predefined variables, but on a plain object), but that's up to @af

from envalid.

billdybas avatar billdybas commented on May 20, 2024

I think there are 2 use cases here:

  1. The original "strict" mode - only reading in those env variables which are defined
  2. Warning / erroring if trying to access environment variables that don't exist

Gating these both behind one configuration flag seems too much.

I propose reverting "strict" mode back to what it originally did, and creating a separate config option that sanity checks accessing properties (by throwing errors). This could also be done by making "strict" non-binary (eg. "off", "strict", "super-strict")

from envalid.

af avatar af commented on May 20, 2024

Eh, I don't think this justifies adding an extra config option– IMO there's more than enough configuration already. I'd be more interested in adding a dummy length attribute in the proxy so this doesn't throw, like @SimenB is suggesting

from envalid.

af avatar af commented on May 20, 2024

Btw if you want strict mode without the throwing behaviour, you can always use v3 of the library, which is mostly the same otherwise.

from envalid.

af avatar af commented on May 20, 2024

@billdybas I believe the linked commit should fix this issue with lodash. Could you try the latest master and re-open the issue if the problem persists?

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.