Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strict mode: suggest solutions when throwing errors #45

Closed
af opened this issue Aug 14, 2017 · 2 comments
Closed

Strict mode: suggest solutions when throwing errors #45

af opened this issue Aug 14, 2017 · 2 comments

Comments

@af
Copy link
Owner

af commented Aug 14, 2017

  • If an env var was accessed that's not in the schema, but is in process.env, we can suggest adding a validator for that var

  • If an accessed env var was not in the validated object, but a similar one was (ie. the error was likely a typo), we can suggest the similar env var name. We don't have to anything fancy like calculating the levenshtein distance; for now could just check if:

    1. The length of name A is within 1 of name B
    2. The first N chars are the same between A and B
@SimenB
Copy link
Collaborator

SimenB commented Aug 15, 2017

I like this idea!

We don't have to anything fancy like calculating the levenshtein distance;

Isn't using levenshtein distance almost easier than something more manual, as it's just a dependency away?

@SimenB
Copy link
Collaborator

SimenB commented Aug 23, 2017

PR submitted: #50

@af af closed this as completed in #50 Aug 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants