11import babel = require( "./babel-core.cts" ) ;
22import maybeParse = require( "./maybeParse.cts" ) ;
3- import { getVisitorKeys , getTokLabels } from "./ast-info.cts" ;
4- import {
5- normalizeBabelParseConfig ,
6- normalizeBabelParseConfigSync ,
7- } from "./configuration.cts" ;
3+ import astInfo = require( "./ast-info.cts" ) ;
4+ import config = require( "./configuration.cts" ) ;
85
9- import { ACTIONS } from "../client.cts" ;
6+ import Clients = require( "../client.cts" ) ;
7+ import ACTIONS = Clients . ACTIONS ;
108
119export = function handleMessage ( action : ACTIONS , payload : any ) {
1210 switch ( action ) {
@@ -18,18 +16,18 @@ export = function handleMessage(action: ACTIONS, payload: any) {
1816 VISITOR_KEYS : babel . types . VISITOR_KEYS ,
1917 } ;
2018 case ACTIONS . GET_TOKEN_LABELS :
21- return getTokLabels ( ) ;
19+ return astInfo . getTokLabels ( ) ;
2220 case ACTIONS . GET_VISITOR_KEYS :
23- return getVisitorKeys ( ) ;
21+ return astInfo . getVisitorKeys ( ) ;
2422 case ACTIONS . MAYBE_PARSE :
25- return normalizeBabelParseConfig ( payload . options ) . then ( options =>
26- maybeParse ( payload . code , options ) ,
27- ) ;
23+ return config
24+ . normalizeBabelParseConfig ( payload . options )
25+ . then ( options => maybeParse ( payload . code , options ) ) ;
2826 case ACTIONS . MAYBE_PARSE_SYNC :
2927 if ( ! USE_ESM ) {
3028 return maybeParse (
3129 payload . code ,
32- normalizeBabelParseConfigSync ( payload . options ) ,
30+ config . normalizeBabelParseConfigSync ( payload . options ) ,
3331 ) ;
3432 }
3533 }
0 commit comments