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(
2727 * $ReadOnly<T> => T
2828 */
2929export 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' ) ;
3333 if ( ! typeParameters . hasNode ( ) ) break ;
3434
35- const param = typeParameters . get ( 'params' ) [ 0 ] ;
36-
37- if ( ! param ) break ;
35+ const firstParam = typeParameters . get ( 'params' ) [ 0 ] ;
36+ if ( ! firstParam ) break ;
3837
39- path = param ;
38+ resultPath = firstParam ;
4039 }
4140
42- return path ;
41+ return resultPath ;
4342}
You can’t perform that action at this time.
0 commit comments