-
-
Notifications
You must be signed in to change notification settings - Fork 571
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
Change Paths
option maxRecursionDepth
default value
#1029
base: main
Are you sure you want to change the base?
Conversation
Paths
option maxRecursionDepth
default value.Paths
option maxRecursionDepth
default value
@@ -53,7 +53,7 @@ export type PathsOptions = { | |||
}; | |||
|
|||
type DefaultPathsOptions = { | |||
maxRecursionDepth: 10; | |||
maxRecursionDepth: 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Emiyaaaaa This only affects cases where depth is greater than 5, right?
And this would also be a breaking change for cases where depth is greater than 5, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
breaking change
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only affects cases where depth is greater than 5
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My idea, similar to what is mentioned in the description, is that when the depth recursion reaches a certain number (I think it can be 5), it can be assumed that the user input type is an infinite nested type and we can stop the recursion early, the previous 10 is ts maximum limit of recursion for our implementation code
If that's okay, I need to figure out how to explain the a option in the comments.
This is a breaking change and should probably be done in v5, right? |
yes |
For performance improvements in most cases, I think we could reduce the default values of
maxRecursionDepth
PS: In TypeScript, also have a similar function to determine whether a type is deeply-nested or not, that value is
5
(reduced to3
after [email protected])