@typecad/typecad
Version:
🤖programmatically 💥create 🛰️hardware
1 lines • 4.3 kB
JavaScript
var __classPrivateFieldSet=this&&this[a2_0x1b9605(0x6f,0x71)]||function(_0x401ae3,_0x325c90,_0x4ec48f,_0x3b47e9,_0x4b4096){if(_0x3b47e9==='m')throw new TypeError(_0x506c74(0x2fe,0x2ff));function _0x506c74(_0x60b7c7,_0xd6efd){return a2_0x382b(_0x60b7c7-0x2fd,_0xd6efd);}if(_0x3b47e9==='a'&&!_0x4b4096)throw new TypeError('Private\x20accessor\x20was\x20defined\x20without\x20a\x20setter');if(typeof _0x325c90===_0x506c74(0x2ff,0x305)?_0x401ae3!==_0x325c90||!_0x4b4096:!_0x325c90['has'](_0x401ae3))throw new TypeError(_0x506c74(0x300,0x304));return _0x3b47e9==='a'?_0x4b4096['call'](_0x401ae3,_0x4ec48f):_0x4b4096?_0x4b4096['value']=_0x4ec48f:_0x325c90['set'](_0x401ae3,_0x4ec48f),_0x4ec48f;},__classPrivateFieldGet=this&&this['__classPrivateFieldGet']||function(_0x24cb1b,_0x2bc4b1,_0x52f287,_0x591e86){function _0xb01eb0(_0x3f2cab,_0x3a53a9){return a2_0x382b(_0x3f2cab- -0x100,_0x3a53a9);}if(_0x52f287==='a'&&!_0x591e86)throw new TypeError(_0xb01eb0(-0xfc,-0xfe));if(typeof _0x2bc4b1==='function'?_0x24cb1b!==_0x2bc4b1||!_0x591e86:!_0x2bc4b1['has'](_0x24cb1b))throw new TypeError('Cannot\x20read\x20private\x20member\x20from\x20an\x20object\x20whose\x20class\x20did\x20not\x20declare\x20it');return _0x52f287==='m'?_0x591e86:_0x52f287==='a'?_0x591e86[_0xb01eb0(-0xfb,-0x102)](_0x24cb1b):_0x591e86?_0x591e86['value']:_0x2bc4b1[_0xb01eb0(-0xfa,-0xf4)](_0x24cb1b);},_Config_instances,_Config_contents,_Config_open;import a2_0x5444f8 from'node:fs';import a2_0x270df0 from'node:process';function a2_0x178a(){var _0x5b004c=['__classPrivateFieldSet','Private\x20method\x20is\x20not\x20writable','function','Cannot\x20write\x20private\x20member\x20to\x20an\x20object\x20whose\x20class\x20did\x20not\x20declare\x20it','Private\x20accessor\x20was\x20defined\x20without\x20a\x20getter','call','get','add','set','/typecad.json','utf8','log','red'];a2_0x178a=function(){return _0x5b004c;};return a2_0x178a();}function a2_0x1b9605(_0x368b55,_0x2ae6c9){return a2_0x382b(_0x368b55-0x6f,_0x2ae6c9);}import a2_0x475da7 from'chalk';export class Config{constructor(){_Config_instances[_0x1feca7(-0x265,-0x26b)](this);function _0x1feca7(_0x2e1f1a,_0x1fcac5){return a2_0x382b(_0x1fcac5- -0x272,_0x2e1f1a);}_Config_contents[_0x1feca7(-0x26a,-0x26a)](this,'');}['get'](_0x13f706){__classPrivateFieldGet(this,_Config_instances,'m',_Config_open)[_0x5aeb49(0x1db,0x1dc)](this);function _0x5aeb49(_0x50f479,_0x2f7699){return a2_0x382b(_0x50f479-0x1d6,_0x2f7699);}if(__classPrivateFieldGet(this,_Config_contents,'f')=='')return'';return _0x13f706 in __classPrivateFieldGet(this,_Config_contents,'f')?__classPrivateFieldGet(this,_Config_contents,'f')[_0x13f706]:'';}['set'](_0x126fbc,_0x38210c){__classPrivateFieldGet(this,_Config_instances,'m',_Config_open)[_0x5d7ae5(-0x28c,-0x287)](this);if(__classPrivateFieldGet(this,_Config_contents,'f')=='')__classPrivateFieldSet(this,_Config_contents,{},'f');_0x126fbc in __classPrivateFieldGet(this,_Config_contents,'f')?__classPrivateFieldGet(this,_Config_contents,'f')[_0x126fbc]=_0x38210c:__classPrivateFieldGet(this,_Config_contents,'f')[_0x126fbc]=_0x38210c;try{a2_0x5444f8['writeFileSync'](a2_0x270df0['cwd']()+'/typecad.json',JSON['stringify'](__classPrivateFieldGet(this,_Config_contents,'f')));}catch(_0x375697){return console['error'](_0x375697),![];}function _0x5d7ae5(_0x58c6ba,_0x5084b9){return a2_0x382b(_0x5084b9- -0x28c,_0x58c6ba);}return!![];}}function a2_0x382b(_0x178aa5,_0x382b17){var _0x34e40a=a2_0x178a();return a2_0x382b=function(_0x9d5a73,_0x45e6da){_0x9d5a73=_0x9d5a73-0x0;var _0x44bf7f=_0x34e40a[_0x9d5a73];return _0x44bf7f;},a2_0x382b(_0x178aa5,_0x382b17);}_Config_contents=new WeakMap(),_Config_instances=new WeakSet(),_Config_open=function _Config_open(){function _0x317c32(_0x202fbe,_0x39ab1a){return a2_0x382b(_0x39ab1a-0xec,_0x202fbe);}try{if(a2_0x5444f8['existsSync'](a2_0x270df0['cwd']()+'/typecad.json')==![])return __classPrivateFieldSet(this,_Config_contents,'','f');let _0x294ea0=a2_0x5444f8['readFileSync'](a2_0x270df0['cwd']()+_0x317c32(0xf1,0xf5),_0x317c32(0xf6,0xf6));__classPrivateFieldSet(this,_Config_contents,JSON['parse'](_0x294ea0),'f');}catch(_0x4e119e){console[_0x317c32(0xf0,0xf7)]('-\x20',a2_0x475da7[_0x317c32(0xf9,0xf8)]['bold']('ERROR:\x20cannot\x20read/process\x20typecad.json.\x20Try\x20editing\x20or\x20deleting\x20the\x20file.'));}};