index.cjs.map
1.78 KB
{"version":3,"names":["babel","require","handleMessage","parentPort","addListener","signal","port","action","payload","response","init","result","error","errorData","postMessage","Error","close","Atomics","store","notify"],"sources":["../../src/worker/index.cjs"],"sourcesContent":["const babel = require(\"./babel-core.cjs\");\nconst handleMessage = require(\"./handle-message.cjs\");\n\nconst { parentPort } = require(\"worker_threads\");\n\nparentPort.addListener(\"message\", async ({ signal, port, action, payload }) => {\n let response;\n\n try {\n if (babel.init) await babel.init;\n\n response = { result: await handleMessage(action, payload) };\n } catch (error) {\n response = { error, errorData: { ...error } };\n }\n\n try {\n port.postMessage(response);\n } catch {\n port.postMessage({\n error: new Error(\"Cannot serialize worker response\"),\n });\n } finally {\n port.close();\n Atomics.store(signal, 0, 1);\n Atomics.notify(signal, 0);\n }\n});\n"],"mappings":";;;;AAAA,MAAMA,KAAK,GAAGC,OAAO,CAAC,kBAAD,CAArB;;AACA,MAAMC,aAAa,GAAGD,OAAO,CAAC,sBAAD,CAA7B;;AAEA,MAAM;EAAEE;AAAF,IAAiBF,OAAO,CAAC,gBAAD,CAA9B;;AAEAE,UAAU,CAACC,WAAX,CAAuB,SAAvB,oBAAkC,WAAO;EAAEC,MAAF;EAAUC,IAAV;EAAgBC,MAAhB;EAAwBC;AAAxB,CAAP,EAA6C;EAC7E,IAAIC,QAAJ;;EAEA,IAAI;IACF,IAAIT,KAAK,CAACU,IAAV,EAAgB,MAAMV,KAAK,CAACU,IAAZ;IAEhBD,QAAQ,GAAG;MAAEE,MAAM,QAAQT,aAAa,CAACK,MAAD,EAASC,OAAT;IAA7B,CAAX;EACD,CAJD,CAIE,OAAOI,KAAP,EAAc;IACdH,QAAQ,GAAG;MAAEG,KAAF;MAASC,SAAS,oBAAOD,KAAP;IAAlB,CAAX;EACD;;EAED,IAAI;IACFN,IAAI,CAACQ,WAAL,CAAiBL,QAAjB;EACD,CAFD,CAEE,gBAAM;IACNH,IAAI,CAACQ,WAAL,CAAiB;MACfF,KAAK,EAAE,IAAIG,KAAJ,CAAU,kCAAV;IADQ,CAAjB;EAGD,CAND,SAMU;IACRT,IAAI,CAACU,KAAL;IACAC,OAAO,CAACC,KAAR,CAAcb,MAAd,EAAsB,CAAtB,EAAyB,CAAzB;IACAY,OAAO,CAACE,MAAR,CAAed,MAAf,EAAuB,CAAvB;EACD;AACF,CAtBD"}