handle-message.cjs.map
2.38 KB
{"version":3,"names":["babel","require","maybeParse","getVisitorKeys","getTokLabels","normalizeBabelParseConfig","normalizeBabelParseConfigSync","module","exports","handleMessage","action","payload","version","FLOW_FLIPPED_ALIAS_KEYS","types","FLIPPED_ALIAS_KEYS","Flow","VISITOR_KEYS","options","then","code","Error"],"sources":["../../src/worker/handle-message.cjs"],"sourcesContent":["const babel = require(\"./babel-core.cjs\");\nconst maybeParse = require(\"./maybeParse.cjs\");\nconst { getVisitorKeys, getTokLabels } = require(\"./ast-info.cjs\");\nconst {\n normalizeBabelParseConfig,\n normalizeBabelParseConfigSync,\n} = require(\"./configuration.cjs\");\n\nmodule.exports = function handleMessage(action, payload) {\n switch (action) {\n case \"GET_VERSION\":\n return babel.version;\n case \"GET_TYPES_INFO\":\n return {\n FLOW_FLIPPED_ALIAS_KEYS: babel.types.FLIPPED_ALIAS_KEYS.Flow,\n VISITOR_KEYS: babel.types.VISITOR_KEYS,\n };\n case \"GET_TOKEN_LABELS\":\n return getTokLabels();\n case \"GET_VISITOR_KEYS\":\n return getVisitorKeys();\n case \"MAYBE_PARSE\":\n return normalizeBabelParseConfig(payload.options).then(options =>\n maybeParse(payload.code, options),\n );\n case \"MAYBE_PARSE_SYNC\":\n if (!USE_ESM) {\n return maybeParse(\n payload.code,\n normalizeBabelParseConfigSync(payload.options),\n );\n }\n }\n\n throw new Error(`Unknown internal parser worker action: ${action}`);\n};\n"],"mappings":"AAAA,MAAMA,KAAK,GAAGC,OAAO,CAAC,kBAAD,CAArB;;AACA,MAAMC,UAAU,GAAGD,OAAO,CAAC,kBAAD,CAA1B;;AACA,MAAM;EAAEE,cAAF;EAAkBC;AAAlB,IAAmCH,OAAO,CAAC,gBAAD,CAAhD;;AACA,MAAM;EACJI,yBADI;EAEJC;AAFI,IAGFL,OAAO,CAAC,qBAAD,CAHX;;AAKAM,MAAM,CAACC,OAAP,GAAiB,SAASC,aAAT,CAAuBC,MAAvB,EAA+BC,OAA/B,EAAwC;EACvD,QAAQD,MAAR;IACE,KAAK,aAAL;MACE,OAAOV,KAAK,CAACY,OAAb;;IACF,KAAK,gBAAL;MACE,OAAO;QACLC,uBAAuB,EAAEb,KAAK,CAACc,KAAN,CAAYC,kBAAZ,CAA+BC,IADnD;QAELC,YAAY,EAAEjB,KAAK,CAACc,KAAN,CAAYG;MAFrB,CAAP;;IAIF,KAAK,kBAAL;MACE,OAAOb,YAAY,EAAnB;;IACF,KAAK,kBAAL;MACE,OAAOD,cAAc,EAArB;;IACF,KAAK,aAAL;MACE,OAAOE,yBAAyB,CAACM,OAAO,CAACO,OAAT,CAAzB,CAA2CC,IAA3C,CAAgDD,OAAO,IAC5DhB,UAAU,CAACS,OAAO,CAACS,IAAT,EAAeF,OAAf,CADL,CAAP;;IAGF,KAAK,kBAAL;MACgB;QACZ,OAAOhB,UAAU,CACfS,OAAO,CAACS,IADO,EAEfd,6BAA6B,CAACK,OAAO,CAACO,OAAT,CAFd,CAAjB;MAID;EAtBL;;EAyBA,MAAM,IAAIG,KAAJ,CAAW,0CAAyCX,MAAO,EAA3D,CAAN;AACD,CA3BD"}