@univer-cli/config 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.mjs +1 -1
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- const _0x265f13=_0x67b4;(function(_0x1db407,_0x43a725){const _0x4a19f5=_0x67b4,_0x51b5c2=_0x1db407();while(!![]){try{const _0x44ff4e=-parseInt(_0x4a19f5(0x17e))/0x1+parseInt(_0x4a19f5(0x141))/0x2*(parseInt(_0x4a19f5(0x182))/0x3)+-parseInt(_0x4a19f5(0x175))/0x4+parseInt(_0x4a19f5(0x188))/0x5*(parseInt(_0x4a19f5(0x15e))/0x6)+-parseInt(_0x4a19f5(0x186))/0x7*(-parseInt(_0x4a19f5(0x147))/0x8)+-parseInt(_0x4a19f5(0x192))/0x9*(parseInt(_0x4a19f5(0x139))/0xa)+-parseInt(_0x4a19f5(0x143))/0xb*(-parseInt(_0x4a19f5(0x17c))/0xc);if(_0x44ff4e===_0x43a725)break;else _0x51b5c2['push'](_0x51b5c2['shift']());}catch(_0xdcb15b){_0x51b5c2['push'](_0x51b5c2['shift']());}}}(_0x1f8e,0x8c7ee));import _0x53c900 from'conf';import{mkdirSync as _0x46bd4b}from'node:fs';import{isAbsolute as _0x2e03e6,parse as _0x222072,resolve as _0x4ca1f8}from'node:path';var a={'nonEmptyString'(){return{'parse':o,'parseText':o};},'boolean'(){return{'parse'(_0x117628){const _0x5d0608=_0x67b4;if(typeof _0x117628!='boolean')throw Error(_0x5d0608(0x150));return _0x117628;},'parseText'(_0x4c6488){const _0xe48c28=_0x67b4;if(_0x4c6488==='true')return!0x0;if(_0x4c6488===_0xe48c28(0x196))return!0x1;throw Error(_0xe48c28(0x171));}};},'integer'(_0x30a18d={}){let _0x2f54ce=_0x34c0d2=>{const _0x298acc=_0x67b4;if(typeof _0x34c0d2!=_0x298acc(0x164)||!Number[_0x298acc(0x163)](_0x34c0d2))throw Error(_0x298acc(0x14b));if(_0x30a18d[_0x298acc(0x170)]!==void 0x0&&_0x34c0d2<_0x30a18d['minimum'])throw Error(_0x298acc(0x167)+_0x30a18d[_0x298acc(0x170)]+'.');if(_0x30a18d['maximum']!==void 0x0&&_0x34c0d2>_0x30a18d[_0x298acc(0x195)])throw Error(_0x298acc(0x169)+_0x30a18d[_0x298acc(0x195)]+'.');return _0x34c0d2;};return{'parse':_0x2f54ce,'parseText'(_0x7cc370){const _0x289cee=_0x67b4;if(!/^-?(?:0|[1-9]\d*)$/u[_0x289cee(0x187)](_0x7cc370))throw Error(_0x289cee(0x199));return _0x2f54ce(Number(_0x7cc370));}};},'enumeration'(_0x38cb0b){let _0x479e6f=_0x428b93=>{const _0x589e58=_0x67b4;if(typeof _0x428b93!='string'||!_0x38cb0b[_0x589e58(0x137)](_0x428b93))throw Error(_0x589e58(0x16d)+_0x38cb0b[_0x589e58(0x146)](',\x20')+'.');return _0x428b93;};return{'parse':_0x479e6f,'parseText':_0x479e6f};},'httpUrl'(){return{'parse':s,'parseText':s};},'httpOrigin'(){const _0x380aac=_0x67b4;let _0x528c31=_0x5b159a=>new URL(s(_0x5b159a))[_0x380aac(0x162)];return{'parse':_0x528c31,'parseText':_0x528c31};}};function o(_0x543457){const _0x53daa8=_0x67b4;if(typeof _0x543457!=_0x53daa8(0x165)||_0x543457[_0x53daa8(0x174)]===0x0||_0x543457[_0x53daa8(0x14d)]()!==_0x543457)throw Error(_0x53daa8(0x18b));return _0x543457;}function s(_0x3b1d03){const _0x519aa1=_0x67b4;let _0x450d1d=o(_0x3b1d03),_0x4cc9b6;try{_0x4cc9b6=new URL(_0x450d1d);}catch{throw Error(_0x519aa1(0x14c));}if(_0x4cc9b6[_0x519aa1(0x138)]!=='http:'&&_0x4cc9b6[_0x519aa1(0x138)]!==_0x519aa1(0x180))throw Error(_0x519aa1(0x14c));return _0x4cc9b6[_0x519aa1(0x190)]();}function c(_0x5484fb){l(_0x5484fb,new Set());}function _0x67b4(_0x246ead,_0x2e1c44){_0x246ead=_0x246ead-0x135;const _0x1f8efe=_0x1f8e();let _0x67b4a3=_0x1f8efe[_0x246ead];return _0x67b4a3;}function l(_0x2853e3,_0x210598){const _0x1babdd=_0x67b4;if(_0x2853e3===null||typeof _0x2853e3==_0x1babdd(0x165)||typeof _0x2853e3==_0x1babdd(0x16f))return;if(typeof _0x2853e3==_0x1babdd(0x164)){if(!Number[_0x1babdd(0x140)](_0x2853e3))throw Error(_0x1babdd(0x185));return;}if(typeof _0x2853e3!=_0x1babdd(0x157))throw Error(_0x1babdd(0x15c));if(_0x210598[_0x1babdd(0x194)](_0x2853e3))throw Error('Expected\x20an\x20acyclic\x20JSON-compatible\x20value.');if(_0x210598['add'](_0x2853e3),Array[_0x1babdd(0x151)](_0x2853e3)){for(let _0xc9af7b of _0x2853e3)l(_0xc9af7b,_0x210598);_0x210598[_0x1babdd(0x142)](_0x2853e3);return;}let _0x5665fa=Object[_0x1babdd(0x17a)](_0x2853e3);if(_0x5665fa!==Object[_0x1babdd(0x156)]&&_0x5665fa!==null)throw Error(_0x1babdd(0x15a));for(let _0x29330f of Object[_0x1babdd(0x152)](_0x2853e3))l(_0x29330f,_0x210598);_0x210598[_0x1babdd(0x142)](_0x2853e3);}var u=class extends Error{['code'];['details'];constructor(_0x4bea9f,_0x2207c7,_0x1f6652={},_0x5c8c9e){const _0x550881=_0x67b4;super(_0x2207c7,_0x5c8c9e),this['name']=_0x550881(0x179),this[_0x550881(0x18d)]=_0x4bea9f,this[_0x550881(0x13d)]=_0x1f6652;}};function d(_0x447e89){const _0x2951cf=_0x67b4;return _0x447e89 instanceof Error?_0x447e89[_0x2951cf(0x148)]:String(_0x447e89);}var f=new Set([_0x265f13(0x144),_0x265f13(0x15f),_0x265f13(0x156)]);function p(_0x25449e){const _0x25a93b=_0x265f13;let _0x1f3e3e={};for(let [_0x32c4a7,_0x39458d]of Object[_0x25a93b(0x193)](_0x25449e)){m(_0x32c4a7);let _0x1a7dc9=_0x39458d[_0x25a93b(0x149)][_0x25a93b(0x14d)]();if(_0x1a7dc9==='')throw h(_0x32c4a7,_0x25a93b(0x17d));if(typeof _0x39458d['codec']?.[_0x25a93b(0x181)]!=_0x25a93b(0x16b)||typeof _0x39458d['codec'][_0x25a93b(0x153)]!=_0x25a93b(0x16b))throw h(_0x32c4a7,_0x25a93b(0x13e));let _0x499e2a;if(Object[_0x25a93b(0x15d)](_0x39458d,_0x25a93b(0x16c)))try{_0x499e2a=_0x39458d[_0x25a93b(0x183)][_0x25a93b(0x181)](_0x39458d[_0x25a93b(0x16c)]),c(_0x499e2a);}catch(_0x115f68){throw h(_0x32c4a7,_0x25a93b(0x159)+d(_0x115f68),_0x115f68);}_0x1f3e3e[_0x32c4a7]=Object[_0x25a93b(0x135)]({'codec':_0x39458d['codec'],'description':_0x1a7dc9,...Object[_0x25a93b(0x15d)](_0x39458d,_0x25a93b(0x16c))?{'defaultValue':_0x499e2a}:{}});}return Object[_0x25a93b(0x135)](_0x1f3e3e);}function m(_0x358f98){const _0x1514e6=_0x265f13;let _0x2f9e27=_0x358f98[_0x1514e6(0x17b)]('.');if(_0x358f98[_0x1514e6(0x174)]===0x0||_0x358f98['trim']()!==_0x358f98||_0x2f9e27[_0x1514e6(0x136)](_0x38c573=>_0x38c573[_0x1514e6(0x174)]===0x0||f[_0x1514e6(0x194)](_0x38c573)||!/^[A-Za-z][A-Za-z0-9_-]*$/u[_0x1514e6(0x187)](_0x38c573)))throw h(_0x358f98,_0x1514e6(0x16a));}function h(_0x210e4d,_0x2b06d0,_0x26097d){return new u('CONFIG_INVALID_DEFINITION','Invalid\x20config\x20definition\x20'+_0x210e4d+':\x20'+_0x2b06d0,{'key':_0x210e4d},_0x26097d===void 0x0?void 0x0:{'cause':_0x26097d});}function g(_0x2712bb){const _0x27f900=_0x265f13;if(!_0x2e03e6(_0x2712bb['path']))throw Error(_0x27f900(0x191));let _0x41ab8e=_0x4ca1f8(_0x2712bb['path']),_0x1c4328=_0x222072(_0x41ab8e);if(_0x1c4328[_0x27f900(0x184)]!=='.json')throw Error(_0x27f900(0x173));try{_0x46bd4b(_0x1c4328[_0x27f900(0x13f)],{'mode':0x1c0,'recursive':!0x0});}catch(_0x5bc102){throw D('CONFIG_WRITE_FAILED',_0x41ab8e,_0x5bc102);}let _0x17ca5a;try{_0x17ca5a=new _0x53c900({'configFileMode':0x180,'configName':_0x1c4328[_0x27f900(0x168)],'cwd':_0x1c4328[_0x27f900(0x13f)],'fileExtension':_0x27f900(0x197)});}catch(_0x35b3e2){throw D(_0x27f900(0x13a),_0x41ab8e,_0x35b3e2);}let _0x5a29e6=Promise[_0x27f900(0x18c)](),_0x4ea719=()=>{const _0x10d15a=_0x27f900;try{return _0x17ca5a[_0x10d15a(0x160)];}catch(_0x3381af){throw D('CONFIG_READ_FAILED',_0x41ab8e,_0x3381af);}},_0xef868b=_0x34f3c1=>{const _0x5cc9fe=_0x27f900;try{_0x17ca5a['store']=_0x34f3c1;}catch(_0x5a2616){throw D(_0x5cc9fe(0x18a),_0x41ab8e,_0x5a2616);}},_0x266761=_0x21d312=>{const _0x20ca4d=_0x27f900;let _0x4d49f3=_(_0x2712bb,_0x21d312),_0x3502bd=x(_0x4ea719(),_0x21d312);return _0x3502bd[_0x20ca4d(0x177)]?v(_0x21d312,_0x4d49f3,_0x3502bd['value']):b(_0x21d312,_0x4d49f3);},_0x431ae6=async(_0x253bb4,_0x29d8d8)=>{const _0x5ec697=_0x27f900;let _0x354ef6=_0x5a29e6[_0x5ec697(0x15b)](()=>{const _0x3f0baf=_0x5ec697;let _0x381761=_0x4ea719();if(_0x29d8d8===void 0x0&&!x(_0x381761,_0x253bb4)[_0x3f0baf(0x177)])return _0x266761(_0x253bb4);let _0x258d74=_0x29d8d8===void 0x0?C(_0x381761,_0x253bb4):S(_0x381761,_0x253bb4,_0x29d8d8);return _0xef868b(_0x258d74),_0x266761(_0x253bb4);});return _0x5a29e6=_0x354ef6[_0x5ec697(0x15b)](()=>void 0x0,()=>void 0x0),await _0x354ef6;};return{'path':_0x17ca5a[_0x27f900(0x145)],async 'get'(_0x55e06f){const _0x1e421e=_0x27f900;return _0x266761(_0x55e06f[_0x1e421e(0x189)]);},async 'list'(){const _0x48b916=_0x27f900;return Object[_0x48b916(0x158)](_0x2712bb[_0x48b916(0x198)])[_0x48b916(0x14a)](_0x251b64=>_0x266761(_0x251b64));},async 'set'(_0x3d5e48){const _0x430243=_0x27f900;let _0x54e4f4=_(_0x2712bb,_0x3d5e48[_0x430243(0x189)]);return await _0x431ae6(_0x3d5e48[_0x430243(0x189)],y(_0x3d5e48['key'],()=>_0x54e4f4[_0x430243(0x183)][_0x430243(0x181)](_0x3d5e48[_0x430243(0x17f)])));},async 'setFromText'(_0x324115){const _0xcd8163=_0x27f900;let _0x290055=_(_0x2712bb,_0x324115[_0xcd8163(0x189)]);return await _0x431ae6(_0x324115[_0xcd8163(0x189)],y(_0x324115[_0xcd8163(0x189)],()=>_0x290055[_0xcd8163(0x183)]['parseText'](_0x324115[_0xcd8163(0x166)])));},async 'unset'(_0x2dd53e){const _0x39fa4c=_0x27f900;return _(_0x2712bb,_0x2dd53e['key']),await _0x431ae6(_0x2dd53e[_0x39fa4c(0x189)],void 0x0);}};}function _(_0x5e086f,_0x26f47c){const _0x554799=_0x265f13;let _0xb71a65=_0x5e086f['definitions'][_0x26f47c];if(_0xb71a65===void 0x0)throw new u(_0x554799(0x176),'Config\x20key\x20is\x20not\x20available:\x20'+_0x26f47c+'.',{'availableKeys':Object['keys'](_0x5e086f[_0x554799(0x198)]),'key':_0x26f47c});return _0xb71a65;}function v(_0x557532,_0x609430,_0x278a3a){const _0x1c2b13=_0x265f13;let _0x116fac=y(_0x557532,()=>_0x609430['codec'][_0x1c2b13(0x181)](_0x278a3a));return{'description':_0x609430[_0x1c2b13(0x149)],'key':_0x557532,'source':_0x1c2b13(0x178),'value':_0x116fac,...Object['hasOwn'](_0x609430,_0x1c2b13(0x16c))?{'defaultValue':_0x609430[_0x1c2b13(0x16c)]}:{}};}function y(_0x20fd8d,_0x218636){const _0x54b600=_0x265f13;try{let _0x368473=_0x218636();return c(_0x368473),_0x368473;}catch(_0x1f30d8){throw new u('CONFIG_INVALID_VALUE',_0x54b600(0x18f)+_0x20fd8d+':\x20'+d(_0x1f30d8),{'key':_0x20fd8d},{'cause':_0x1f30d8});}}function b(_0x4ffc05,_0x24f57f){const _0x41f9e0=_0x265f13;return Object[_0x41f9e0(0x15d)](_0x24f57f,_0x41f9e0(0x16c))?{'defaultValue':_0x24f57f[_0x41f9e0(0x16c)],'description':_0x24f57f['description'],'key':_0x4ffc05,'source':_0x41f9e0(0x18e),'value':_0x24f57f[_0x41f9e0(0x16c)]}:{'description':_0x24f57f[_0x41f9e0(0x149)],'key':_0x4ffc05,'source':_0x41f9e0(0x16e)};}function x(_0x313704,_0x4a63c8){const _0x2f0aa8=_0x265f13;let _0x21a022=_0x313704;for(let _0x2b1f73 of _0x4a63c8[_0x2f0aa8(0x17b)]('.')){if(!w(_0x21a022))throw E(_0x4a63c8);if(!Object['hasOwn'](_0x21a022,_0x2b1f73))return{'found':!0x1};_0x21a022=_0x21a022[_0x2b1f73];}return{'found':!0x0,'value':_0x21a022};}function S(_0x490238,_0x50f1dc,_0x1920f2){const _0x5aeba3=_0x265f13;let _0x99241f={...structuredClone(_0x490238)},_0x7d3bd5=_0x50f1dc['split']('.'),_0x507e1b=_0x99241f;for(let _0x402c1a of _0x7d3bd5[_0x5aeba3(0x14f)](0x0,-0x1)){let _0x39b4f8=_0x507e1b[_0x402c1a];if(_0x39b4f8===void 0x0){let _0x284e47={};_0x507e1b[_0x402c1a]=_0x284e47,_0x507e1b=_0x284e47;}else{if(T(_0x39b4f8))_0x507e1b=_0x39b4f8;else throw E(_0x50f1dc);}}return _0x507e1b[_0x7d3bd5['at'](-0x1)]=structuredClone(_0x1920f2),_0x99241f;}function C(_0x3f27bf,_0x51dd9e){const _0x2be939=_0x265f13;let _0x24fb75={...structuredClone(_0x3f27bf)},_0x59cf25=_0x51dd9e[_0x2be939(0x17b)]('.'),_0x428d01=[],_0x58233f=_0x24fb75;for(let _0x36e500 of _0x59cf25[_0x2be939(0x14f)](0x0,-0x1)){let _0x48d82e=_0x58233f[_0x36e500];if(_0x48d82e===void 0x0)return _0x24fb75;if(!T(_0x48d82e))throw E(_0x51dd9e);_0x428d01[_0x2be939(0x172)]({'object':_0x58233f,'segment':_0x36e500}),_0x58233f=_0x48d82e;}delete _0x58233f[_0x59cf25['at'](-0x1)];for(let _0x1ab1ac of _0x428d01['reverse']()){let _0x40ce50=_0x1ab1ac[_0x2be939(0x157)][_0x1ab1ac[_0x2be939(0x14e)]];if(w(_0x40ce50)&&Object[_0x2be939(0x158)](_0x40ce50)[_0x2be939(0x174)]===0x0)delete _0x1ab1ac[_0x2be939(0x157)][_0x1ab1ac[_0x2be939(0x14e)]];else break;}return _0x24fb75;}function w(_0x4fc64a){const _0x4773f1=_0x265f13;return typeof _0x4fc64a==_0x4773f1(0x157)&&!!_0x4fc64a&&!Array[_0x4773f1(0x151)](_0x4fc64a);}function _0x1f8e(){const _0x11dd58=['store','Config\x20document\x20conflicts\x20with\x20registered\x20key\x20','origin','isSafeInteger','number','string','text','Expected\x20an\x20integer\x20greater\x20than\x20or\x20equal\x20to\x20','name','Expected\x20an\x20integer\x20less\x20than\x20or\x20equal\x20to\x20','Key\x20must\x20contain\x20safe\x20dot-separated\x20identifier\x20segments.','function','defaultValue','Expected\x20one\x20of:\x20','unset','boolean','minimum','Expected\x20\x22true\x22\x20or\x20\x22false\x22.','push','Config\x20path\x20must\x20use\x20the\x20.json\x20extension.','length','858524AYLxLx','CONFIG_UNKNOWN_KEY','found','config','ConfigError','getPrototypeOf','split','5180508yofPUZ','Description\x20must\x20not\x20be\x20empty.','872212AdGetB','value','https:','parse','98775tSMxNt','codec','ext','Expected\x20a\x20finite\x20JSON\x20number.','35lPqHmE','test','139265ETWhHt','key','CONFIG_WRITE_FAILED','Expected\x20a\x20non-empty\x20string\x20without\x20surrounding\x20whitespace.','resolve','code','default','Invalid\x20value\x20for\x20config\x20key\x20','toString','Config\x20path\x20must\x20be\x20absolute.','9SMBwSn','entries','has','maximum','false','json','definitions','Expected\x20an\x20integer.','freeze','some','includes','protocol','7844710XyvRGD','CONFIG_READ_FAILED','read','CONFIG_INVALID_DOCUMENT','details','Codec\x20must\x20provide\x20parse\x20and\x20parseText\x20functions.','dir','isFinite','58umGYfX','delete','22IDYmEF','__proto__','path','join','916536SOaSyu','message','description','map','Expected\x20a\x20safe\x20integer.','Expected\x20an\x20absolute\x20HTTP\x20or\x20HTTPS\x20URL.','trim','segment','slice','Expected\x20a\x20boolean.','isArray','values','parseText','write','Failed\x20to\x20','prototype','object','keys','Invalid\x20default\x20value:\x20','Expected\x20a\x20plain\x20JSON\x20object.','then','Expected\x20a\x20JSON-compatible\x20value.','hasOwn','12VMNzUR','constructor'];_0x1f8e=function(){return _0x11dd58;};return _0x1f8e();}function T(_0x330409){return w(_0x330409);}function E(_0x206eb6){const _0x1e4ff0=_0x265f13;return new u(_0x1e4ff0(0x13c),_0x1e4ff0(0x161)+_0x206eb6+'.',{'key':_0x206eb6});}function D(_0x1ac7b9,_0x7514b9,_0x29b7bb){const _0x5d40fa=_0x265f13;return new u(_0x1ac7b9,_0x5d40fa(0x155)+(_0x1ac7b9==='CONFIG_READ_FAILED'?_0x5d40fa(0x13b):_0x5d40fa(0x154))+'\x20config\x20file\x20'+_0x7514b9+':\x20'+d(_0x29b7bb),{'path':_0x7514b9},{'cause':_0x29b7bb});}export{u as ConfigError,a as configCodecs,g as createFileConfig,p as defineConfig};
1
+ const _0x430175=_0x3dd4;(function(_0x3b073c,_0x4e3d7e){const _0x13ec4c=_0x3dd4,_0xed1241=_0x3b073c();while(!![]){try{const _0x50cb60=-parseInt(_0x13ec4c(0x147))/0x1+parseInt(_0x13ec4c(0x12f))/0x2*(parseInt(_0x13ec4c(0x12c))/0x3)+-parseInt(_0x13ec4c(0x101))/0x4+-parseInt(_0x13ec4c(0x141))/0x5+parseInt(_0x13ec4c(0x146))/0x6+-parseInt(_0x13ec4c(0x102))/0x7+parseInt(_0x13ec4c(0x138))/0x8;if(_0x50cb60===_0x4e3d7e)break;else _0xed1241['push'](_0xed1241['shift']());}catch(_0x335fa1){_0xed1241['push'](_0xed1241['shift']());}}}(_0x26ad,0x4d5da));import _0x2baae1 from'conf';function _0x26ad(){const _0x3d3920=['1573824aSAolj','172058OGLfJS','minimum','boolean','constructor','segment','json','name','includes','toString','CONFIG_INVALID_DEFINITION','Expected\x20\x22true\x22\x20or\x20\x22false\x22.','push','write','map','object','text','trim','Expected\x20one\x20of:\x20','some','then','getPrototypeOf','Failed\x20to\x20','ext','2114808zBJfnB','504077PGxQXQ','function','Config\x20document\x20conflicts\x20with\x20registered\x20key\x20','definitions','Expected\x20a\x20JSON-compatible\x20value.','config','message','found','string','CONFIG_WRITE_FAILED','codec','ConfigError','values','path','delete','hasOwn','description','CONFIG_UNKNOWN_KEY','true','slice','Expected\x20an\x20integer\x20greater\x20than\x20or\x20equal\x20to\x20','__proto__','join','add','read','Invalid\x20config\x20definition\x20','Config\x20path\x20must\x20be\x20absolute.','length','test','key','Expected\x20a\x20finite\x20JSON\x20number.','prototype','keys','parse','Expected\x20an\x20acyclic\x20JSON-compatible\x20value.','CONFIG_READ_FAILED','defaultValue','isArray','http:','origin','reverse','Expected\x20an\x20absolute\x20HTTP\x20or\x20HTTPS\x20URL.','2553qasczL','Expected\x20a\x20safe\x20integer.','code','324uwlatD','number','value','split','parseText','protocol','resolve','Invalid\x20value\x20for\x20config\x20key\x20','Expected\x20a\x20plain\x20JSON\x20object.','8022872WLzFsT','dir','maximum','isSafeInteger','isFinite','Expected\x20an\x20integer.','\x20config\x20file\x20','CONFIG_INVALID_DOCUMENT','Codec\x20must\x20provide\x20parse\x20and\x20parseText\x20functions.','1566820oMuZOs','false','freeze','has','Config\x20path\x20must\x20use\x20the\x20.json\x20extension.'];_0x26ad=function(){return _0x3d3920;};return _0x26ad();}import{mkdirSync as _0x12054a}from'node:fs';import{isAbsolute as _0x2c3cf4,parse as _0x36deab,resolve as _0x3505a2}from'node:path';var a={'nonEmptyString'(){return{'parse':o,'parseText':o};},'boolean'(){return{'parse'(_0x107cdd){const _0x425d21=_0x3dd4;if(typeof _0x107cdd!=_0x425d21(0x149))throw Error('Expected\x20a\x20boolean.');return _0x107cdd;},'parseText'(_0xec33be){const _0x342b88=_0x3dd4;if(_0xec33be===_0x342b88(0x114))return!0x0;if(_0xec33be===_0x342b88(0x142))return!0x1;throw Error(_0x342b88(0x151));}};},'integer'(_0x15e203={}){let _0x3cab9f=_0x7945ad=>{const _0x95d0d3=_0x3dd4;if(typeof _0x7945ad!=_0x95d0d3(0x130)||!Number[_0x95d0d3(0x13b)](_0x7945ad))throw Error(_0x95d0d3(0x12d));if(_0x15e203['minimum']!==void 0x0&&_0x7945ad<_0x15e203[_0x95d0d3(0x148)])throw Error(_0x95d0d3(0x116)+_0x15e203['minimum']+'.');if(_0x15e203[_0x95d0d3(0x13a)]!==void 0x0&&_0x7945ad>_0x15e203[_0x95d0d3(0x13a)])throw Error('Expected\x20an\x20integer\x20less\x20than\x20or\x20equal\x20to\x20'+_0x15e203[_0x95d0d3(0x13a)]+'.');return _0x7945ad;};return{'parse':_0x3cab9f,'parseText'(_0xdb8532){const _0x32cdbd=_0x3dd4;if(!/^-?(?:0|[1-9]\d*)$/u['test'](_0xdb8532))throw Error(_0x32cdbd(0x13d));return _0x3cab9f(Number(_0xdb8532));}};},'enumeration'(_0x29ea72){let _0x5176b5=_0xc5e026=>{const _0x1dac00=_0x3dd4;if(typeof _0xc5e026!='string'||!_0x29ea72[_0x1dac00(0x14e)](_0xc5e026))throw Error(_0x1dac00(0xfb)+_0x29ea72[_0x1dac00(0x118)](',\x20')+'.');return _0xc5e026;};return{'parse':_0x5176b5,'parseText':_0x5176b5};},'httpUrl'(){return{'parse':s,'parseText':s};},'httpOrigin'(){const _0x52c916=_0x3dd4;let _0x2457ad=_0x189563=>new URL(s(_0x189563))[_0x52c916(0x129)];return{'parse':_0x2457ad,'parseText':_0x2457ad};}};function o(_0x174dbf){const _0x514ce0=_0x3dd4;if(typeof _0x174dbf!=_0x514ce0(0x10a)||_0x174dbf[_0x514ce0(0x11d)]===0x0||_0x174dbf[_0x514ce0(0xfa)]()!==_0x174dbf)throw Error('Expected\x20a\x20non-empty\x20string\x20without\x20surrounding\x20whitespace.');return _0x174dbf;}function s(_0x1d20a6){const _0x1e10fe=_0x3dd4;let _0x52c2cf=o(_0x1d20a6),_0x1d7748;try{_0x1d7748=new URL(_0x52c2cf);}catch{throw Error(_0x1e10fe(0x12b));}if(_0x1d7748[_0x1e10fe(0x134)]!==_0x1e10fe(0x128)&&_0x1d7748['protocol']!=='https:')throw Error(_0x1e10fe(0x12b));return _0x1d7748[_0x1e10fe(0x14f)]();}function _0x3dd4(_0x5b00b3,_0xedf15f){_0x5b00b3=_0x5b00b3-0xf8;const _0x26ad5a=_0x26ad();let _0x3dd46c=_0x26ad5a[_0x5b00b3];return _0x3dd46c;}function c(_0x2bd234){l(_0x2bd234,new Set());}function l(_0x3e1371,_0x3e8bc3){const _0x37568d=_0x3dd4;if(_0x3e1371===null||typeof _0x3e1371=='string'||typeof _0x3e1371==_0x37568d(0x149))return;if(typeof _0x3e1371==_0x37568d(0x130)){if(!Number[_0x37568d(0x13c)](_0x3e1371))throw Error(_0x37568d(0x120));return;}if(typeof _0x3e1371!=_0x37568d(0xf8))throw Error(_0x37568d(0x106));if(_0x3e8bc3[_0x37568d(0x144)](_0x3e1371))throw Error(_0x37568d(0x124));if(_0x3e8bc3[_0x37568d(0x119)](_0x3e1371),Array[_0x37568d(0x127)](_0x3e1371)){for(let _0x4dc66c of _0x3e1371)l(_0x4dc66c,_0x3e8bc3);_0x3e8bc3[_0x37568d(0x110)](_0x3e1371);return;}let _0x37fa71=Object[_0x37568d(0xfe)](_0x3e1371);if(_0x37fa71!==Object[_0x37568d(0x121)]&&_0x37fa71!==null)throw Error(_0x37568d(0x137));for(let _0x15ff62 of Object[_0x37568d(0x10e)](_0x3e1371))l(_0x15ff62,_0x3e8bc3);_0x3e8bc3[_0x37568d(0x110)](_0x3e1371);}var u=class extends Error{[_0x430175(0x12e)];['details'];constructor(_0x2011e8,_0x7978f3,_0x25201f={},_0x487102){const _0x2275da=_0x430175;super(_0x7978f3,_0x487102),this[_0x2275da(0x14d)]=_0x2275da(0x10d),this['code']=_0x2011e8,this['details']=_0x25201f;}};function d(_0x543615){const _0xddf83f=_0x430175;return _0x543615 instanceof Error?_0x543615[_0xddf83f(0x108)]:String(_0x543615);}var f=new Set([_0x430175(0x117),_0x430175(0x14a),'prototype']);function p(_0x48f726){const _0x54ea8c=_0x430175;let _0x38447c={};for(let [_0x45c193,_0x31f7a5]of Object['entries'](_0x48f726)){m(_0x45c193);let _0x29dc1e=_0x31f7a5[_0x54ea8c(0x112)][_0x54ea8c(0xfa)]();if(_0x29dc1e==='')throw h(_0x45c193,'Description\x20must\x20not\x20be\x20empty.');if(typeof _0x31f7a5[_0x54ea8c(0x10c)]?.['parse']!='function'||typeof _0x31f7a5[_0x54ea8c(0x10c)][_0x54ea8c(0x133)]!=_0x54ea8c(0x103))throw h(_0x45c193,_0x54ea8c(0x140));let _0x29d988;if(Object[_0x54ea8c(0x111)](_0x31f7a5,_0x54ea8c(0x126)))try{_0x29d988=_0x31f7a5[_0x54ea8c(0x10c)][_0x54ea8c(0x123)](_0x31f7a5[_0x54ea8c(0x126)]),c(_0x29d988);}catch(_0x223302){throw h(_0x45c193,'Invalid\x20default\x20value:\x20'+d(_0x223302),_0x223302);}_0x38447c[_0x45c193]=Object[_0x54ea8c(0x143)]({'codec':_0x31f7a5['codec'],'description':_0x29dc1e,...Object[_0x54ea8c(0x111)](_0x31f7a5,_0x54ea8c(0x126))?{'defaultValue':_0x29d988}:{}});}return Object['freeze'](_0x38447c);}function m(_0x96b276){const _0x30529d=_0x430175;let _0x484948=_0x96b276[_0x30529d(0x132)]('.');if(_0x96b276[_0x30529d(0x11d)]===0x0||_0x96b276[_0x30529d(0xfa)]()!==_0x96b276||_0x484948[_0x30529d(0xfc)](_0x49cb23=>_0x49cb23['length']===0x0||f['has'](_0x49cb23)||!/^[A-Za-z][A-Za-z0-9_-]*$/u[_0x30529d(0x11e)](_0x49cb23)))throw h(_0x96b276,'Key\x20must\x20contain\x20safe\x20dot-separated\x20identifier\x20segments.');}function h(_0x328651,_0xf1d9b2,_0x5c3f7d){const _0x487311=_0x430175;return new u(_0x487311(0x150),_0x487311(0x11b)+_0x328651+':\x20'+_0xf1d9b2,{'key':_0x328651},_0x5c3f7d===void 0x0?void 0x0:{'cause':_0x5c3f7d});}function g(_0x21b993){const _0x32ab78=_0x430175;if(!_0x2c3cf4(_0x21b993['path']))throw Error(_0x32ab78(0x11c));let _0x1abef9=_0x3505a2(_0x21b993['path']),_0x2cfa99=_0x36deab(_0x1abef9);if(_0x2cfa99[_0x32ab78(0x100)]!=='.json')throw Error(_0x32ab78(0x145));try{_0x12054a(_0x2cfa99['dir'],{'mode':0x1c0,'recursive':!0x0});}catch(_0x3943f7){throw D(_0x32ab78(0x10b),_0x1abef9,_0x3943f7);}let _0x5da45f;try{_0x5da45f=new _0x2baae1({'configFileMode':0x180,'configName':_0x2cfa99[_0x32ab78(0x14d)],'cwd':_0x2cfa99[_0x32ab78(0x139)],'fileExtension':_0x32ab78(0x14c)});}catch(_0x21e06c){throw D(_0x32ab78(0x125),_0x1abef9,_0x21e06c);}let _0x29c3c6=Promise[_0x32ab78(0x135)](),_0x13ab2e=()=>{const _0x7d303e=_0x32ab78;try{return _0x5da45f['store'];}catch(_0x2b44ed){throw D(_0x7d303e(0x125),_0x1abef9,_0x2b44ed);}},_0x16aac0=_0x161575=>{try{_0x5da45f['store']=_0x161575;}catch(_0x51f3c7){throw D('CONFIG_WRITE_FAILED',_0x1abef9,_0x51f3c7);}},_0xc5509=_0x170727=>{const _0x29c1af=_0x32ab78;let _0x168eb8=_(_0x21b993,_0x170727),_0x45c592=x(_0x13ab2e(),_0x170727);return _0x45c592[_0x29c1af(0x109)]?v(_0x170727,_0x168eb8,_0x45c592[_0x29c1af(0x131)]):b(_0x170727,_0x168eb8);},_0x192119=async(_0x2ee3ae,_0x5514d6)=>{const _0x33dc5b=_0x32ab78;let _0x65789b=_0x29c3c6[_0x33dc5b(0xfd)](()=>{const _0x2038e9=_0x33dc5b;let _0x5e650a=_0x13ab2e();if(_0x5514d6===void 0x0&&!x(_0x5e650a,_0x2ee3ae)[_0x2038e9(0x109)])return _0xc5509(_0x2ee3ae);let _0x36021d=_0x5514d6===void 0x0?C(_0x5e650a,_0x2ee3ae):S(_0x5e650a,_0x2ee3ae,_0x5514d6);return _0x16aac0(_0x36021d),_0xc5509(_0x2ee3ae);});return _0x29c3c6=_0x65789b[_0x33dc5b(0xfd)](()=>void 0x0,()=>void 0x0),await _0x65789b;};return{'path':_0x5da45f[_0x32ab78(0x10f)],async 'get'(_0xd0c49){const _0x1c75d0=_0x32ab78;return _0xc5509(_0xd0c49[_0x1c75d0(0x11f)]);},async 'list'(){const _0x37095d=_0x32ab78;return Object[_0x37095d(0x122)](_0x21b993[_0x37095d(0x105)])[_0x37095d(0x154)](_0x3d5a41=>_0xc5509(_0x3d5a41));},async 'set'(_0x5afa76){const _0x3468de=_0x32ab78;let _0x24d06f=_(_0x21b993,_0x5afa76[_0x3468de(0x11f)]);return await _0x192119(_0x5afa76[_0x3468de(0x11f)],y(_0x5afa76[_0x3468de(0x11f)],()=>_0x24d06f['codec']['parse'](_0x5afa76[_0x3468de(0x131)])));},async 'setFromText'(_0x5419d9){const _0x5d5dd3=_0x32ab78;let _0x47f325=_(_0x21b993,_0x5419d9['key']);return await _0x192119(_0x5419d9[_0x5d5dd3(0x11f)],y(_0x5419d9[_0x5d5dd3(0x11f)],()=>_0x47f325[_0x5d5dd3(0x10c)][_0x5d5dd3(0x133)](_0x5419d9[_0x5d5dd3(0xf9)])));},async 'unset'(_0x5f22fb){const _0x2a383c=_0x32ab78;return _(_0x21b993,_0x5f22fb[_0x2a383c(0x11f)]),await _0x192119(_0x5f22fb[_0x2a383c(0x11f)],void 0x0);}};}function _(_0x3e4c46,_0x597f12){const _0x46e01b=_0x430175;let _0x48b213=_0x3e4c46['definitions'][_0x597f12];if(_0x48b213===void 0x0)throw new u(_0x46e01b(0x113),'Config\x20key\x20is\x20not\x20available:\x20'+_0x597f12+'.',{'availableKeys':Object[_0x46e01b(0x122)](_0x3e4c46[_0x46e01b(0x105)]),'key':_0x597f12});return _0x48b213;}function v(_0x6cb139,_0x2479b7,_0x486630){const _0x2f0010=_0x430175;let _0x115c8b=y(_0x6cb139,()=>_0x2479b7[_0x2f0010(0x10c)]['parse'](_0x486630));return{'description':_0x2479b7['description'],'key':_0x6cb139,'source':_0x2f0010(0x107),'value':_0x115c8b,...Object[_0x2f0010(0x111)](_0x2479b7,_0x2f0010(0x126))?{'defaultValue':_0x2479b7[_0x2f0010(0x126)]}:{}};}function y(_0xceb109,_0x11c928){const _0x369b35=_0x430175;try{let _0x3392f7=_0x11c928();return c(_0x3392f7),_0x3392f7;}catch(_0x8dc443){throw new u('CONFIG_INVALID_VALUE',_0x369b35(0x136)+_0xceb109+':\x20'+d(_0x8dc443),{'key':_0xceb109},{'cause':_0x8dc443});}}function b(_0x2f43d8,_0x5ce810){const _0x1b089c=_0x430175;return Object[_0x1b089c(0x111)](_0x5ce810,_0x1b089c(0x126))?{'defaultValue':_0x5ce810['defaultValue'],'description':_0x5ce810[_0x1b089c(0x112)],'key':_0x2f43d8,'source':'default','value':_0x5ce810[_0x1b089c(0x126)]}:{'description':_0x5ce810[_0x1b089c(0x112)],'key':_0x2f43d8,'source':'unset'};}function x(_0x3bea2,_0x577890){const _0x3887ec=_0x430175;let _0x4d0344=_0x3bea2;for(let _0x23c4a7 of _0x577890[_0x3887ec(0x132)]('.')){if(!w(_0x4d0344))throw E(_0x577890);if(!Object[_0x3887ec(0x111)](_0x4d0344,_0x23c4a7))return{'found':!0x1};_0x4d0344=_0x4d0344[_0x23c4a7];}return{'found':!0x0,'value':_0x4d0344};}function S(_0x650572,_0x1670c6,_0x56029c){const _0xf32c51=_0x430175;let _0x14b144={...structuredClone(_0x650572)},_0xecc220=_0x1670c6[_0xf32c51(0x132)]('.'),_0x853cf=_0x14b144;for(let _0x299f1d of _0xecc220[_0xf32c51(0x115)](0x0,-0x1)){let _0x467c76=_0x853cf[_0x299f1d];if(_0x467c76===void 0x0){let _0x18d873={};_0x853cf[_0x299f1d]=_0x18d873,_0x853cf=_0x18d873;}else{if(T(_0x467c76))_0x853cf=_0x467c76;else throw E(_0x1670c6);}}return _0x853cf[_0xecc220['at'](-0x1)]=structuredClone(_0x56029c),_0x14b144;}function C(_0x583804,_0x38b570){const _0x1556d6=_0x430175;let _0x5d272f={...structuredClone(_0x583804)},_0x1111fb=_0x38b570[_0x1556d6(0x132)]('.'),_0x4f3f58=[],_0x52d370=_0x5d272f;for(let _0x4d73ee of _0x1111fb[_0x1556d6(0x115)](0x0,-0x1)){let _0x3b0ac4=_0x52d370[_0x4d73ee];if(_0x3b0ac4===void 0x0)return _0x5d272f;if(!T(_0x3b0ac4))throw E(_0x38b570);_0x4f3f58[_0x1556d6(0x152)]({'object':_0x52d370,'segment':_0x4d73ee}),_0x52d370=_0x3b0ac4;}delete _0x52d370[_0x1111fb['at'](-0x1)];for(let _0x3d9afd of _0x4f3f58[_0x1556d6(0x12a)]()){let _0x153ab0=_0x3d9afd[_0x1556d6(0xf8)][_0x3d9afd[_0x1556d6(0x14b)]];if(w(_0x153ab0)&&Object[_0x1556d6(0x122)](_0x153ab0)[_0x1556d6(0x11d)]===0x0)delete _0x3d9afd[_0x1556d6(0xf8)][_0x3d9afd[_0x1556d6(0x14b)]];else break;}return _0x5d272f;}function w(_0x2a8c83){const _0x3c5ff8=_0x430175;return typeof _0x2a8c83==_0x3c5ff8(0xf8)&&!!_0x2a8c83&&!Array['isArray'](_0x2a8c83);}function T(_0x102343){return w(_0x102343);}function E(_0x384315){const _0x1c69e4=_0x430175;return new u(_0x1c69e4(0x13f),_0x1c69e4(0x104)+_0x384315+'.',{'key':_0x384315});}function D(_0x3e2fde,_0x3a86db,_0x24b067){const _0x4da107=_0x430175;return new u(_0x3e2fde,_0x4da107(0xff)+(_0x3e2fde===_0x4da107(0x125)?_0x4da107(0x11a):_0x4da107(0x153))+_0x4da107(0x13e)+_0x3a86db+':\x20'+d(_0x24b067),{'path':_0x3a86db},{'cause':_0x24b067});}export{u as ConfigError,a as configCodecs,g as createFileConfig,p as defineConfig};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@univer-cli/config",
3
3
  "type": "module",
4
- "version": "1.0.0",
4
+ "version": "1.0.2",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",