File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -20,13 +20,15 @@ const transpileErrorDiagnostic = (error: TranspileError): ts.Diagnostic => ({
2020export function createVisitorMap ( customVisitors : Visitors [ ] ) : VisitorMap {
2121 const visitorMap : VisitorMap = new Map ( ) ;
2222 for ( const visitors of [ standardVisitors , ...customVisitors ] ) {
23+ const priority = visitors === standardVisitors ? - Infinity : 0 ;
2324 for ( const [ syntaxKindKey , visitor ] of Object . entries ( visitors ) ) {
2425 if ( ! visitor ) continue ;
2526
2627 const syntaxKind = Number ( syntaxKindKey ) as ts . SyntaxKind ;
2728 const nodeVisitors = getOrUpdate ( visitorMap , syntaxKind , ( ) => [ ] ) ;
2829
29- const objectVisitor : ObjectVisitor < any > = typeof visitor === "function" ? { transform : visitor } : visitor ;
30+ const objectVisitor : ObjectVisitor < any > =
31+ typeof visitor === "function" ? { transform : visitor , priority } : visitor ;
3032 nodeVisitors . push ( objectVisitor ) ;
3133 }
3234 }
You can’t perform that action at this time.
0 commit comments