UNPKG

smart-error-explanator

Version:

A Node.js SDK that explains cryptic error messages using OpenAI's API.

1 lines 1.57 kB
const a2_0x5a893d=a2_0x534f;(function(_0x4c3222,_0x532dc9){const _0x208688=a2_0x534f,_0x42e278=_0x4c3222();while(!![]){try{const _0x31d164=-parseInt(_0x208688(0x103))/0x1*(parseInt(_0x208688(0x108))/0x2)+-parseInt(_0x208688(0x102))/0x3+parseInt(_0x208688(0x107))/0x4+-parseInt(_0x208688(0x105))/0x5+-parseInt(_0x208688(0x106))/0x6+parseInt(_0x208688(0xfe))/0x7*(-parseInt(_0x208688(0x109))/0x8)+parseInt(_0x208688(0xfd))/0x9;if(_0x31d164===_0x532dc9)break;else _0x42e278['push'](_0x42e278['shift']());}catch(_0x1632d1){_0x42e278['push'](_0x42e278['shift']());}}}(a2_0x5617,0x38f2f));import{wrapFunction}from'./debugWrapper.js';import{setApiKey}from'./errorHandler.js';import{config}from'dotenv';config(),setApiKey(process[a2_0x5a893d(0xff)][a2_0x5a893d(0x104)]);function a2_0x534f(_0x12beb0,_0x520bac){const _0x561709=a2_0x5617();return a2_0x534f=function(_0x534fec,_0xcbfe62){_0x534fec=_0x534fec-0xfc;let _0x5d2291=_0x561709[_0x534fec];return _0x5d2291;},a2_0x534f(_0x12beb0,_0x520bac);}function a2_0x5617(){const _0x48ba54=['log','380907ayIpNT','10111zQycYF','OPENAI_API_KEY','739900lCZNqO','754704bHEiVD','541788uKxbdP','50eGKkbU','296mWMFny','Alice','city','9987687QmjOaP','67809HdGCHG','env','name'];a2_0x5617=function(){return _0x48ba54;};return a2_0x5617();}const buggyFunction=async _0xd416c4=>{const _0x2e2fe5=a2_0x5a893d;console[_0x2e2fe5(0x101)]('User\x20details:',_0xd416c4[_0x2e2fe5(0x100)]),console['log']('City:',_0xd416c4['address'][_0x2e2fe5(0xfc)]);},safeFunction=wrapFunction(buggyFunction),userInput={'name':a2_0x5a893d(0x10a)};safeFunction(userInput);