@@ -4,10 +4,6 @@ import { isURL, maybeAddRelativeLocalPrefix } from "./general-utils";
4
4
import { isModulePathsMatch } from "./ts-helpers" ;
5
5
import { resolveModuleName } from "./resolve-module-name" ;
6
6
7
- /* ****************************************************************************************************************** */
8
- // region: Node Updater Utility
9
- /* ****************************************************************************************************************** */
10
-
11
7
/** Gets proper path and calls updaterFn to get the new node if it should be updated */
12
8
export function resolvePathAndUpdateNode (
13
9
context : VisitorContext ,
@@ -69,7 +65,8 @@ export function resolvePathAndUpdateNode(
69
65
const trivia = targetNode . getFullText ( sourceFile ) . slice ( 0 , targetNode . getLeadingTriviaWidth ( sourceFile ) ) ;
70
66
const regex = / ^ \s * \/ \/ \/ ? \s * @ ( t r a n s f o r m - p a t h | n o - t r a n s f o r m - p a t h ) (?: [ ^ \S \r \n ] ( .+ ?) ) ? $ / gim;
71
67
72
- for ( let match = regex . exec ( trivia ) ; match ; match = regex . exec ( trivia ) ) commentTags . set ( match [ 1 ] , match [ 2 ] ) ;
68
+ for ( let match = regex . exec ( trivia ) ; match ; match = regex . exec ( trivia ) )
69
+ if ( match [ 1 ] ) commentTags . set ( match [ 1 ] , match [ 2 ] ) ;
73
70
} catch { }
74
71
}
75
72
@@ -83,7 +80,7 @@ export function resolvePathAndUpdateNode(
83
80
84
81
function findTag ( expected : string ) : boolean | string | undefined {
85
82
if ( commentTags . has ( expected ) ) return commentTags . get ( expected ) || true ;
86
- if ( ! jsDocTags ?. length ) return void 0 ;
83
+ if ( ! jsDocTags ?. length ) return undefined ;
87
84
88
85
for ( const tag of jsDocTags ) {
89
86
const tagName = tag . tagName . text . toLowerCase ( ) ;
@@ -103,8 +100,8 @@ export function resolvePathAndUpdateNode(
103
100
: void 0 ;
104
101
}
105
102
}
103
+
104
+ return undefined ;
106
105
}
107
106
}
108
107
}
109
-
110
- // endregion
0 commit comments