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

fix(types): stop before try to evaluate any as a path #907

Merged
merged 2 commits into from May 18, 2022
Merged

fix(types): stop before try to evaluate any as a path #907

merged 2 commits into from May 18, 2022

Conversation

micalevisk
Copy link
Member

@micalevisk micalevisk commented Mar 27, 2022

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Issue Number: fixes #906

image

What is the new behavior?

we can have keys with the type any when using ConfigService#get typed. See:

image

image

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

The second commit is just a minor performance improvement not related with the original Issue. It was made to avoid computing PathImpl2<T> twice by using the infer keyword to cache the first result.
I can drop that commit if you prefer the old version in favor of readability.

@micalevisk micalevisk marked this pull request as draft March 27, 2022 06:08
@micalevisk
Copy link
Member Author

micalevisk commented May 18, 2022

ping @kamilmysliwiec this one should be pretty easy to review 😸

@kamilmysliwiec kamilmysliwiec merged commit d2d8bb0 into nestjs:master May 18, 2022
@kamilmysliwiec
Copy link
Member

lgtm

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

Successfully merging this pull request may close these issues.

ConfigService#get error 'Type instantiation is excessively deep and possibly infinite' when using any
2 participants