File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
packages/react-docgen/src/utils Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -27,17 +27,16 @@ export function isSupportedUtilityType(
27
27
* $ReadOnly<T> => T
28
28
*/
29
29
export function unwrapUtilityType ( path : NodePath ) : NodePath {
30
- while ( isSupportedUtilityType ( path ) ) {
31
- const typeParameters = path . get ( 'typeParameters' ) ;
32
-
30
+ let resultPath : NodePath = path ;
31
+ while ( isSupportedUtilityType ( resultPath ) ) {
32
+ const typeParameters = resultPath . get ( 'typeParameters' ) ;
33
33
if ( ! typeParameters . hasNode ( ) ) break ;
34
34
35
- const param = typeParameters . get ( 'params' ) [ 0 ] ;
36
-
37
- if ( ! param ) break ;
35
+ const firstParam = typeParameters . get ( 'params' ) [ 0 ] ;
36
+ if ( ! firstParam ) break ;
38
37
39
- path = param ;
38
+ resultPath = firstParam ;
40
39
}
41
40
42
- return path ;
41
+ return resultPath ;
43
42
}
You can’t perform that action at this time.
0 commit comments