json2dart-generator 0.1.1 → 0.3.0

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.
package/README.md CHANGED
@@ -25,8 +25,8 @@ Options:
25
25
  ```
26
26
 
27
27
  - 备注:
28
- - 根类名为`json`的文件名(首字母自动转为大写,并且蛇形自动转驼峰)。
29
- - 类的属性名自动蛇形转驼峰,当属性名为`dart关键字`时将在名称前面加`the`。
28
+ - 默认`json`的文件名为模型类名,也可通过键`__className`指定类名。
29
+ - 类和属性名称自动蛇形转驼峰,当属性名为`dart关键字`时将在名称前面加`the`。
30
30
  - 当`json`的值类型不存在或空时,自动默认处理为`String`类型并控制台输出警告。
31
31
 
32
32
  - 帮助文档
@@ -1 +1 @@
1
- export declare function jsonToDart(value: any, className: string, nullSafety: boolean, numparse: boolean): string;
1
+ export declare function jsonToDart(value: any, className: string, suffix: string, nullSafety: boolean, numparse: boolean): string;
@@ -1 +1 @@
1
- 'use strict';function a0_0x4079(){const _0x767d5d=['covariant','\x20!=\x20null\x20&&\x20','class\x20','\x20\x20\x20\x20this.','3178434bxgWaQ','.fromJson(','\x20类包含值为\x22空\x22的属性,将被默认视为”String“类型','typedef','bool','?.toString()','double','async','var','operator','void','mixin','log','library','external','261FCaZhk','implements','includes','\x20is\x20bool\x20?\x20','4007479OjwtsG','1350675fYBSSn','null','906251KiUWPc','isNumber','static','const','num','extends','import','finally','factory','String','rethrow','else','isInt','entries','join','export',')?.toList()','dynamic','uppercaseFirst','1048508AkTktD','\x20is\x20List)\x20?\x20','int','throw','super','try','\x20\x20}','?.toString()\x20??\x20\x27\x27)','case','false','switch','16TZGOsC','return','show','1130jpGIIE','({\x0a','\x20\x20\x20\x20','the','.fromJson(Map<String,\x20dynamic>\x20json)\x20{\x0a','part','\x20\x20Map<String,\x20dynamic>\x20toJson()\x20=>\x20{\x0a','js-utils-plus','243730mMPrDh','for','class','double.tryParse(','while','default','push','assert','test','catch','isArray','new','set','?.map((e)\x20=>\x20','await','__esModule',')?.toList()\x20:\x20null','interface','isString','json[','with','abstract','jsonToDart','sync','-\x20警告!:','final','enum','deferred','1196nsdnWx','\x20\x20\x20\x20\x20\x20\x20\x20',')\x20:\x20null','\x20is\x20Map<String,\x20dynamic>)\x20?\x20','get','?.toJson()','snakeToCamel','\x20\x20});','hide'];a0_0x4079=function(){return _0x767d5d;};return a0_0x4079();}const a0_0x4554e2=a0_0x2f6d;(function(_0x53428c,_0x552cc9){const _0x4054e0=a0_0x2f6d,_0x232131=_0x53428c();while(!![]){try{const _0x451fea=parseInt(_0x4054e0(0x114))/0x1+-parseInt(_0x4054e0(0xbf))/0x2+parseInt(_0x4054e0(0x112))/0x3+-parseInt(_0x4054e0(0xf1))/0x4*(-parseInt(_0x4054e0(0xcd))/0x5)+-parseInt(_0x4054e0(0xfe))/0x6+parseInt(_0x4054e0(0x111))/0x7*(parseInt(_0x4054e0(0xca))/0x8)+parseInt(_0x4054e0(0x10d))/0x9*(-parseInt(_0x4054e0(0xd5))/0xa);if(_0x451fea===_0x552cc9)break;else _0x232131['push'](_0x232131['shift']());}catch(_0x3a322d){_0x232131['push'](_0x232131['shift']());}}}(a0_0x4079,0xc552a));function a0_0x2f6d(_0x136436,_0x55b601){_0x136436=_0x136436-0xbd;const _0x407960=a0_0x4079();let _0x2f6df5=_0x407960[_0x136436];return _0x2f6df5;}Object['defineProperty'](exports,a0_0x4554e2(0xe4),{'value':!![]}),exports[a0_0x4554e2(0xeb)]=jsonToDart;const js_utils_plus_1=require(a0_0x4554e2(0xd4));function modelTypeGenerator(_0xe6203c,_0x1d4ee4,_0x4cef86,_0x4a076a){const _0x3b510c=a0_0x4554e2;if((0x0,js_utils_plus_1['isBoolean'])(_0xe6203c))return{'type':_0x3b510c(0x102),'typeTo':_0x2038d8=>_0x2038d8,'typeFrom':_0x14cfb7=>_0x14cfb7+_0x3b510c(0x110)+_0x14cfb7+'\x20:\x20null'};if((0x0,js_utils_plus_1[_0x3b510c(0xe7)])(_0xe6203c))return{'type':_0x3b510c(0x11d),'typeTo':_0x30ba31=>_0x30ba31,'typeFrom':_0x22d7fd=>_0x22d7fd+'?.toString()'};if((0x0,js_utils_plus_1[_0x3b510c(0x115)])(_0xe6203c)){if(_0x4a076a)return{'type':_0x3b510c(0x118),'typeTo':_0x1d02cd=>_0x1d02cd,'typeFrom':_0x3e026c=>'num.tryParse('+_0x3e026c+_0x3b510c(0xc6)};return(0x0,js_utils_plus_1[_0x3b510c(0x120)])(_0xe6203c)?{'type':'int','typeTo':_0x16423e=>_0x16423e,'typeFrom':_0xbad24=>'int.tryParse('+_0xbad24+_0x3b510c(0xc6)}:{'type':_0x3b510c(0x104),'typeTo':_0x58f7e0=>_0x58f7e0,'typeFrom':_0x397d5f=>_0x3b510c(0xd8)+_0x397d5f+_0x3b510c(0xc6)};}if((0x0,js_utils_plus_1['isObject'])(_0xe6203c))return{'type':_0x1d4ee4,'typeTo':_0x54dfca=>_0x54dfca+_0x3b510c(0xf6),'typeFrom':_0x57a323=>'('+_0x57a323+_0x3b510c(0xfb)+_0x57a323+_0x3b510c(0xf4)+_0x1d4ee4+_0x3b510c(0xff)+_0x57a323+_0x3b510c(0xf3),'subLines':jsonToDart(_0xe6203c,_0x1d4ee4,_0x4cef86,_0x4a076a)};if((0x0,js_utils_plus_1[_0x3b510c(0xdf)])(_0xe6203c)){const _0x4dfa49=_0xe6203c[0x0];if(!_0x4dfa49)console['log']('-\x20警告!:'+_0x1d4ee4+_0x3b510c(0x100));const {type:_0x2ab343,typeTo:_0x53fbf7,typeFrom:_0x76d3a0,subLines:_0x47190c}=modelTypeGenerator(_0x4dfa49||'',_0x1d4ee4,_0x4cef86,_0x4a076a);return{'type':'List<'+_0x2ab343+(_0x4cef86?'?':'')+'>','typeTo':_0x2f2c6a=>_0x2f2c6a+_0x3b510c(0xe2)+_0x53fbf7('e')+_0x3b510c(0x124),'typeFrom':_0x45e843=>'('+_0x45e843+_0x3b510c(0xfb)+_0x45e843+_0x3b510c(0xc0)+_0x45e843+'.map((e)\x20=>\x20'+_0x76d3a0('e')+_0x3b510c(0xe5),'subLines':_0x47190c};}return console[_0x3b510c(0x10a)](_0x3b510c(0xed)+_0x1d4ee4+_0x3b510c(0x100)),{'type':_0x3b510c(0x11d),'typeTo':_0x359eb0=>_0x359eb0,'typeFrom':_0x407681=>_0x407681+_0x3b510c(0x103)};}function modelKeywordDefence(_0x229b9f){const _0x134eb5=a0_0x4554e2;let _0x4ced9c=[_0x134eb5(0x118),_0x134eb5(0x104),_0x134eb5(0xc1),'String','bool','List',_0x134eb5(0xea),_0x134eb5(0xbd),_0x134eb5(0x10e),_0x134eb5(0xcc),'as',_0x134eb5(0x11f),_0x134eb5(0x11a),_0x134eb5(0x116),_0x134eb5(0xdc),_0x134eb5(0xef),'in',_0x134eb5(0xc3),_0x134eb5(0x105),_0x134eb5(0x123),_0x134eb5(0xe6),_0x134eb5(0xc9),_0x134eb5(0xe3),_0x134eb5(0x119),'is',_0x134eb5(0xec),'break',_0x134eb5(0x10c),_0x134eb5(0x10b),'this',_0x134eb5(0xc7),_0x134eb5(0x11c),_0x134eb5(0x109),_0x134eb5(0xc2),_0x134eb5(0xde),_0x134eb5(0xc8),_0x134eb5(0xe0),'true',_0x134eb5(0xd7),_0x134eb5(0xee),_0x134eb5(0x113),_0x134eb5(0xc4),_0x134eb5(0x117),_0x134eb5(0x11b),'on',_0x134eb5(0x101),'continue',_0x134eb5(0xd6),_0x134eb5(0x107),_0x134eb5(0x106),_0x134eb5(0xfa),'Function',_0x134eb5(0xd2),_0x134eb5(0x108),_0x134eb5(0xda),_0x134eb5(0xf5),_0x134eb5(0x11e),_0x134eb5(0xd9),_0x134eb5(0xf0),_0x134eb5(0xf9),_0x134eb5(0xcb),_0x134eb5(0xe9),'do','if',_0x134eb5(0xe1),'yield'];if(_0x4ced9c[_0x134eb5(0x10f)](_0x229b9f)||/^\d/[_0x134eb5(0xdd)](_0x229b9f))return _0x134eb5(0xd0)+(0x0,js_utils_plus_1[_0x134eb5(0xbe)])(_0x229b9f);return(0x0,js_utils_plus_1['snakeToCamel'])(_0x229b9f);}function jsonToDart(_0x1e5d87,_0x37e814,_0x5e3719,_0x3d39e8){const _0x377c7f=a0_0x4554e2;_0x37e814=(0x0,js_utils_plus_1[_0x377c7f(0xbe)])((0x0,js_utils_plus_1[_0x377c7f(0xf7)])(_0x37e814));let _0x5037b5=[],_0x446803=[],_0x2e65c0=[],_0x2b97e4=[],_0x26ee00=[],_0x4ec6e7=[];_0x5037b5[_0x377c7f(0xdb)](_0x377c7f(0xfc)+_0x37e814+'\x20{'),_0x2e65c0['push']('\x20\x20'+_0x37e814+_0x377c7f(0xce)),_0x2b97e4[_0x377c7f(0xdb)]('\x20\x20'+_0x37e814+_0x377c7f(0xd1)),_0x26ee00[_0x377c7f(0xdb)](_0x377c7f(0xd3));for(const [_0x351067,_0x8b9665]of Object[_0x377c7f(0x121)](_0x1e5d87)){let _0x59edb9='\x27'+_0x351067+'\x27',_0x56e41b=modelKeywordDefence(_0x351067);const _0x1036de=''+_0x37e814+(0x0,js_utils_plus_1[_0x377c7f(0xbe)])((0x0,js_utils_plus_1[_0x377c7f(0xf7)])(_0x351067)),{type:_0x2e9c27,typeTo:_0x36899c,typeFrom:_0x147ae4,subLines:_0x4a8a4e}=modelTypeGenerator(_0x8b9665,_0x1036de,_0x5e3719,_0x3d39e8);if(_0x4a8a4e)_0x4ec6e7[_0x377c7f(0xdb)](_0x4a8a4e);_0x2e65c0[_0x377c7f(0xdb)](_0x377c7f(0xfd)+_0x56e41b+',\x0a'),_0x446803[_0x377c7f(0xdb)]('\x20\x20'+_0x2e9c27+(_0x5e3719?'?':'')+'\x20'+_0x56e41b+';\x0a'),_0x2b97e4[_0x377c7f(0xdb)](_0x377c7f(0xcf)+_0x56e41b+'\x20=\x20'+_0x147ae4(_0x377c7f(0xe8)+_0x59edb9+']')+';\x0a'),_0x26ee00['push'](_0x377c7f(0xf2)+_0x59edb9+':\x20'+_0x36899c(_0x56e41b)+',\x0a');}return _0x2e65c0['push'](_0x377c7f(0xf8)),_0x2b97e4[_0x377c7f(0xdb)](_0x377c7f(0xc5)),_0x26ee00['push']('\x20\x20\x20\x20\x20\x20};'),_0x5037b5['push'](_0x446803['join']('')),_0x5037b5['push'](_0x2e65c0[_0x377c7f(0x122)]('')),_0x5037b5[_0x377c7f(0xdb)](_0x2b97e4['join']('')),_0x5037b5[_0x377c7f(0xdb)](_0x26ee00[_0x377c7f(0x122)]('')),_0x5037b5[_0x377c7f(0xdb)]('}\x0a'),_0x5037b5[_0x377c7f(0xdb)](_0x4ec6e7[_0x377c7f(0x122)]('')),_0x5037b5['join']('\x0d\x0a');}
1
+ 'use strict';const a0_0x5b58f1=a0_0x2827;function a0_0x4342(){const _0x5b8c97=['catch','case','jsonToDart','num','?.toString()\x20??\x20\x27\x27)','\x20\x20Map<String,\x20dynamic>\x20toJson()\x20=>\x20{\x0a','rethrow','List','isBoolean','bool','the','null','operator','static','Function','const','516986pEbMpu','isInt','js-utils-plus','sync','covariant','num.tryParse(','int','implements','\x20is\x20bool\x20?\x20','this','entries','external','continue','194529NrkMFu','\x20\x20});','.fromJson(Map<String,\x20dynamic>\x20json)\x20{\x0a','extends','__esModule','push','async','3242915NwmIIN','await','json[','({\x0a','yield','try','\x20\x20\x20\x20\x20\x20\x20\x20','299844XshHTp','class\x20','part','interface','dynamic','String','abstract','\x20\x20\x20\x20','factory','isNumber','2594753KrKhhZ','?.toJson()','3709088eMmJto','\x20as\x20List<dynamic>?)?.map((e)\x20=>\x20','typedef','isString','else','\x20=\x20','import','new','\x20as\x20Map<String,\x20dynamic>)','final','throw','List<','set','deferred','6XQIiCH','join','true','?.toString()','show','includes','\x20类包含值为\x22空\x22的属性,将被默认视为”String“类型','enum','return','?.map((e)\x20=>\x20','default','super','double.tryParse(','uppercaseFirst','snakeToCamel','get','\x20\x20\x20\x20this.','finally','-\x20警告!:','double','isArray','mixin','251478wDAKdB'];a0_0x4342=function(){return _0x5b8c97;};return a0_0x4342();}(function(_0x54f7f0,_0x3a04cc){const _0x21e2ba=a0_0x2827,_0x104c24=_0x54f7f0();while(!![]){try{const _0x4cfbc9=-parseInt(_0x21e2ba(0x240))/0x1+parseInt(_0x21e2ba(0x22f))/0x2+-parseInt(_0x21e2ba(0x1f1))/0x3+parseInt(_0x21e2ba(0x1ff))/0x4+parseInt(_0x21e2ba(0x1f8))/0x5+parseInt(_0x21e2ba(0x219))/0x6*(-parseInt(_0x21e2ba(0x209))/0x7)+parseInt(_0x21e2ba(0x20b))/0x8;if(_0x4cfbc9===_0x3a04cc)break;else _0x104c24['push'](_0x104c24['shift']());}catch(_0x20095a){_0x104c24['push'](_0x104c24['shift']());}}}(a0_0x4342,0x57fdb));function a0_0x2827(_0x4c63e5,_0x70aa53){_0x4c63e5=_0x4c63e5-0x1f1;const _0x434286=a0_0x4342();let _0x2827aa=_0x434286[_0x4c63e5];return _0x2827aa;}Object['defineProperty'](exports,a0_0x5b58f1(0x1f5),{'value':!![]}),exports[a0_0x5b58f1(0x232)]=jsonToDart;const js_utils_plus_1=require(a0_0x5b58f1(0x242));function modelTypeGenerator(_0x4248f1,_0x41d67e,_0x4b9f21,_0x120067,_0x27b786){const _0x2b17b2=a0_0x5b58f1;if((0x0,js_utils_plus_1[_0x2b17b2(0x238)])(_0x4248f1))return{'type':_0x2b17b2(0x239),'typeTo':_0x364a9f=>_0x364a9f,'typeFrom':_0x2743d9=>_0x2743d9+_0x2b17b2(0x248)+_0x2743d9+'\x20:\x20null'};if((0x0,js_utils_plus_1[_0x2b17b2(0x20e)])(_0x4248f1))return{'type':_0x2b17b2(0x204),'typeTo':_0x4ca854=>_0x4ca854,'typeFrom':_0x318ef8=>_0x318ef8+_0x2b17b2(0x21c)};if((0x0,js_utils_plus_1[_0x2b17b2(0x208)])(_0x4248f1)){if(_0x27b786)return{'type':_0x2b17b2(0x233),'typeTo':_0x142b96=>_0x142b96,'typeFrom':_0x12f47f=>_0x2b17b2(0x245)+_0x12f47f+_0x2b17b2(0x234)};return(0x0,js_utils_plus_1[_0x2b17b2(0x241)])(_0x4248f1)?{'type':'int','typeTo':_0x4a91d8=>_0x4a91d8,'typeFrom':_0x1c8c5f=>'int.tryParse('+_0x1c8c5f+_0x2b17b2(0x234)}:{'type':_0x2b17b2(0x22c),'typeTo':_0x2fb85a=>_0x2fb85a,'typeFrom':_0x121629=>_0x2b17b2(0x225)+_0x121629+_0x2b17b2(0x234)};}if((0x0,js_utils_plus_1['isObject'])(_0x4248f1))return{'type':''+_0x41d67e+_0x4b9f21,'typeTo':_0x200581=>_0x200581+_0x2b17b2(0x20a),'typeFrom':_0x2fb3ea=>''+_0x41d67e+_0x4b9f21+'.fromJson('+_0x2fb3ea+_0x2b17b2(0x213),'subLines':jsonToDart(_0x4248f1,_0x41d67e,_0x4b9f21,_0x120067,_0x27b786)};if((0x0,js_utils_plus_1[_0x2b17b2(0x22d)])(_0x4248f1)){const _0x1d3d3a=_0x4248f1[0x0];if(!_0x1d3d3a)console['log'](_0x2b17b2(0x22b)+_0x41d67e+_0x4b9f21+_0x2b17b2(0x21f));const {type:_0x549b5b,typeTo:_0x3de577,typeFrom:_0x173618,subLines:_0x21001e}=modelTypeGenerator(_0x1d3d3a||'',_0x41d67e,_0x4b9f21,_0x120067,_0x27b786);return{'type':_0x2b17b2(0x216)+_0x549b5b+(_0x120067?'?':'')+'>','typeTo':_0x6c64ad=>_0x6c64ad+_0x2b17b2(0x222)+_0x3de577('e')+').toList()','typeFrom':_0x459eaa=>'('+_0x459eaa+_0x2b17b2(0x20c)+_0x173618('e')+').toList()','subLines':_0x21001e};}return console['log'](_0x2b17b2(0x22b)+_0x41d67e+_0x4b9f21+_0x2b17b2(0x21f)),{'type':_0x2b17b2(0x204),'typeTo':_0x3b16a5=>_0x3b16a5,'typeFrom':_0x36ee9b=>_0x36ee9b+'?.toString()'};}function modelKeywordDefence(_0x9fc1f9){const _0x1d8821=a0_0x5b58f1;let _0xce9ec8=[_0x1d8821(0x233),_0x1d8821(0x22c),_0x1d8821(0x246),_0x1d8821(0x204),'bool',_0x1d8821(0x237),_0x1d8821(0x205),_0x1d8821(0x203),_0x1d8821(0x247),_0x1d8821(0x21d),'as',_0x1d8821(0x20f),_0x1d8821(0x211),_0x1d8821(0x23d),'assert',_0x1d8821(0x220),'in',_0x1d8821(0x224),_0x1d8821(0x1f7),'export',_0x1d8821(0x202),'switch',_0x1d8821(0x1f9),_0x1d8821(0x1f4),'is',_0x1d8821(0x243),'break',_0x1d8821(0x24b),'library',_0x1d8821(0x249),_0x1d8821(0x231),_0x1d8821(0x207),_0x1d8821(0x22e),_0x1d8821(0x215),_0x1d8821(0x230),'false',_0x1d8821(0x212),_0x1d8821(0x21b),'class',_0x1d8821(0x214),_0x1d8821(0x23b),_0x1d8821(0x1fd),_0x1d8821(0x23f),_0x1d8821(0x22a),'on',_0x1d8821(0x20d),_0x1d8821(0x24c),'for',_0x1d8821(0x23c),'var',_0x1d8821(0x244),_0x1d8821(0x23e),_0x1d8821(0x201),'void',_0x1d8821(0x223),_0x1d8821(0x228),_0x1d8821(0x236),'while',_0x1d8821(0x218),'hide',_0x1d8821(0x221),'with','do','if',_0x1d8821(0x217),_0x1d8821(0x1fc)];if(_0xce9ec8[_0x1d8821(0x21e)](_0x9fc1f9)||/^\d/['test'](_0x9fc1f9))return _0x1d8821(0x23a)+(0x0,js_utils_plus_1[_0x1d8821(0x226)])(_0x9fc1f9);return(0x0,js_utils_plus_1['snakeToCamel'])(_0x9fc1f9);}function jsonToDart(_0x40e941,_0x5bf2e0,_0x55b5a7,_0x4077f8,_0x2eab6b){const _0x41317b=a0_0x5b58f1;_0x5bf2e0=(0x0,js_utils_plus_1[_0x41317b(0x226)])((0x0,js_utils_plus_1[_0x41317b(0x227)])(_0x5bf2e0));let _0x32604e=[],_0x5b7a2d=[],_0x1d2c9e=[],_0x2b21f5=[],_0x23bed4=[],_0x90b613=[];_0x32604e[_0x41317b(0x1f6)](_0x41317b(0x200)+_0x5bf2e0+_0x55b5a7+'\x20{'),_0x1d2c9e[_0x41317b(0x1f6)]('\x20\x20'+_0x5bf2e0+_0x55b5a7+_0x41317b(0x1fb)),_0x2b21f5[_0x41317b(0x1f6)]('\x20\x20'+_0x5bf2e0+_0x55b5a7+_0x41317b(0x1f3)),_0x23bed4[_0x41317b(0x1f6)](_0x41317b(0x235));for(const [_0x2a404b,_0x561c05]of Object[_0x41317b(0x24a)](_0x40e941)){let _0x2d1df3='\x27'+_0x2a404b+'\x27',_0xc03618=modelKeywordDefence(_0x2a404b);const _0x26ee1e=''+_0x5bf2e0+(0x0,js_utils_plus_1[_0x41317b(0x226)])((0x0,js_utils_plus_1[_0x41317b(0x227)])(_0x2a404b)),{type:_0x3ab224,typeTo:_0x445c94,typeFrom:_0x3fdad1,subLines:_0x4ad7d9}=modelTypeGenerator(_0x561c05,_0x26ee1e,_0x55b5a7,_0x4077f8,_0x2eab6b);if(_0x4ad7d9)_0x90b613['push'](_0x4ad7d9);_0x1d2c9e[_0x41317b(0x1f6)](_0x41317b(0x229)+_0xc03618+',\x0a'),_0x5b7a2d[_0x41317b(0x1f6)]('\x20\x20'+_0x3ab224+(_0x4077f8?'?':'')+'\x20'+_0xc03618+';\x0a'),_0x2b21f5[_0x41317b(0x1f6)](_0x41317b(0x206)+_0xc03618+_0x41317b(0x210)+_0x3fdad1(_0x41317b(0x1fa)+_0x2d1df3+']')+';\x0a'),_0x23bed4[_0x41317b(0x1f6)](_0x41317b(0x1fe)+_0x2d1df3+':\x20'+_0x445c94(_0xc03618)+',\x0a');}return _0x1d2c9e[_0x41317b(0x1f6)](_0x41317b(0x1f2)),_0x2b21f5['push']('\x20\x20}'),_0x23bed4['push']('\x20\x20\x20\x20\x20\x20};'),_0x32604e[_0x41317b(0x1f6)](_0x5b7a2d[_0x41317b(0x21a)]('')),_0x32604e[_0x41317b(0x1f6)](_0x1d2c9e['join']('')),_0x32604e[_0x41317b(0x1f6)](_0x2b21f5[_0x41317b(0x21a)]('')),_0x32604e['push'](_0x23bed4['join']('')),_0x32604e[_0x41317b(0x1f6)]('}\x0a'),_0x32604e[_0x41317b(0x1f6)](_0x90b613['join']('')),_0x32604e[_0x41317b(0x21a)]('\x0d\x0a');}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #! /usr/bin/env node
2
- 'use strict';const a1_0x291f0c=a1_0x3fd9;(function(_0x2eb39c,_0x563a37){const _0x1639ac=a1_0x3fd9,_0x434a28=_0x2eb39c();while(!![]){try{const _0x2d47f6=-parseInt(_0x1639ac(0xf6))/0x1+parseInt(_0x1639ac(0x10d))/0x2*(parseInt(_0x1639ac(0xf4))/0x3)+parseInt(_0x1639ac(0x11d))/0x4*(-parseInt(_0x1639ac(0xfa))/0x5)+-parseInt(_0x1639ac(0x11a))/0x6+-parseInt(_0x1639ac(0x105))/0x7*(-parseInt(_0x1639ac(0x102))/0x8)+parseInt(_0x1639ac(0x10b))/0x9*(-parseInt(_0x1639ac(0x118))/0xa)+parseInt(_0x1639ac(0x10a))/0xb;if(_0x2d47f6===_0x563a37)break;else _0x434a28['push'](_0x434a28['shift']());}catch(_0x1683ff){_0x434a28['push'](_0x434a28['shift']());}}}(a1_0x5255,0xc35d7));var __importDefault=this&&this[a1_0x291f0c(0x108)]||function(_0x152969){return _0x152969&&_0x152969['__esModule']?_0x152969:{'default':_0x152969};};Object[a1_0x291f0c(0x119)](exports,'__esModule',{'value':!![]});const json2dart_1=require(a1_0x291f0c(0xff)),js_utils_plus_1=require(a1_0x291f0c(0xf9)),commander_1=require('commander'),path_1=__importDefault(require(a1_0x291f0c(0x109))),program=new commander_1[(a1_0x291f0c(0x11b))](),_path=process[a1_0x291f0c(0x113)]();program[a1_0x291f0c(0xfc)]('-d,\x20--dir\x20<dir>',a1_0x291f0c(0x104))['option'](a1_0x291f0c(0xf0),a1_0x291f0c(0x11e))[a1_0x291f0c(0xfc)](a1_0x291f0c(0x103),a1_0x291f0c(0x112))['option']('-e,\x20--excludes\x20<value...>',a1_0x291f0c(0xf2))[a1_0x291f0c(0xfc)](a1_0x291f0c(0x10c),a1_0x291f0c(0x10e))[a1_0x291f0c(0xfc)](a1_0x291f0c(0x116),a1_0x291f0c(0xf5)),program[a1_0x291f0c(0x11c)]();function a1_0x3fd9(_0x1525f8,_0x5170d6){_0x1525f8=_0x1525f8-0xef;const _0x5255ad=a1_0x5255();let _0x3fd96d=_0x5255ad[_0x1525f8];return _0x3fd96d;}const options=Object[a1_0x291f0c(0x101)]({'dir':a1_0x291f0c(0xef),'output':a1_0x291f0c(0x115),'suffix':a1_0x291f0c(0xfb)},program['opts']());function run(){const _0x40b947=a1_0x291f0c,_0x1a981=path_1[_0x40b947(0x111)][_0x40b947(0x107)](_path,options['dir']),_0x33a81e=(0x0,js_utils_plus_1[_0x40b947(0x100)])(_0x1a981,_0x40b947(0xf1),options[_0x40b947(0x110)]||[]);console[_0x40b947(0x114)](new Array(0x50)[_0x40b947(0x107)]('-')),_0x33a81e['forEach'](function(_0x47a91e){const _0x794f59=_0x40b947,_0x1b109c=(0x0,js_utils_plus_1[_0x794f59(0x106)])(_0x47a91e,!![]);if(!_0x1b109c){console['error']('-\x20执行文件:'+_0x47a91e);return;}console[_0x794f59(0x114)]('-\x20执行文件:'+_0x47a91e);const _0x450c4e=path_1['default']['parse'](_0x47a91e),_0x15ddf0=(0x0,json2dart_1[_0x794f59(0xf3)])(_0x1b109c,options['suffix']?''+_0x450c4e[_0x794f59(0x10f)]+options['suffix']:_0x450c4e[_0x794f59(0x10f)],options[_0x794f59(0xfe)],options[_0x794f59(0xfd)]),_0x56104b=path_1[_0x794f59(0x111)][_0x794f59(0x107)](_path,options[_0x794f59(0x117)],_0x450c4e[_0x794f59(0x10f)]+_0x794f59(0xf7));(0x0,js_utils_plus_1[_0x794f59(0xf8)])(_0x56104b,_0x15ddf0);});}run();function a1_0x5255(){const _0x1d9a20=['assign','8HEihLh','-s,\x20--suffix\x20<value>','json文件夹路径,默认\x20.json_models/','5360397YrClzU','readFileSync','join','__importDefault','path','23492986gkTJUk','18vAoCnC','--numparse','251006nbERHs','使用num数据类型而不是double/int','name','excludes','default','自定义dart模型类名后缀,\x20默认\x20Entity','cwd','log','lib/models','--nullsafety','output','426950ZuRrtx','defineProperty','3094542KRvYny','Command','parse','68960FPjUkB','dart模型输出路径,默认\x20lib/models','.json_models/','-o,\x20--output\x20<dir>','json','需要排除的文件或文件夹,可指定多个文件','jsonToDart','9XNESPI','是否启用空安全','704324ffnNaO','.dart','writeFileSync','js-utils-plus','340ZYmjis','Entity','option','numparse','nullsafety','./core/json2dart','listFilesRecursively'];a1_0x5255=function(){return _0x1d9a20;};return a1_0x5255();}
2
+ 'use strict';const a1_0x4c132e=a1_0x1b5e;(function(_0x42531a,_0x3b17f1){const _0x3ff8a4=a1_0x1b5e,_0x70addc=_0x42531a();while(!![]){try{const _0x1e6744=parseInt(_0x3ff8a4(0x1ed))/0x1+-parseInt(_0x3ff8a4(0x1e8))/0x2*(parseInt(_0x3ff8a4(0x1eb))/0x3)+parseInt(_0x3ff8a4(0x1d6))/0x4*(-parseInt(_0x3ff8a4(0x1ff))/0x5)+-parseInt(_0x3ff8a4(0x1dd))/0x6+parseInt(_0x3ff8a4(0x1f1))/0x7*(parseInt(_0x3ff8a4(0x203))/0x8)+parseInt(_0x3ff8a4(0x1f9))/0x9*(-parseInt(_0x3ff8a4(0x1ec))/0xa)+parseInt(_0x3ff8a4(0x1e2))/0xb;if(_0x1e6744===_0x3b17f1)break;else _0x70addc['push'](_0x70addc['shift']());}catch(_0x1aafbd){_0x70addc['push'](_0x70addc['shift']());}}}(a1_0x141b,0x8007c));var __importDefault=this&&this[a1_0x4c132e(0x1e3)]||function(_0x124a1c){const _0xab5b45=a1_0x4c132e;return _0x124a1c&&_0x124a1c[_0xab5b45(0x207)]?_0x124a1c:{'default':_0x124a1c};};function a1_0x1b5e(_0x1c5e0e,_0x67d9a6){_0x1c5e0e=_0x1c5e0e-0x1d2;const _0x141b1d=a1_0x141b();let _0x1b5eb4=_0x141b1d[_0x1c5e0e];return _0x1b5eb4;}Object[a1_0x4c132e(0x20a)](exports,a1_0x4c132e(0x207),{'value':!![]});const json2dart_1=require(a1_0x4c132e(0x205)),js_utils_plus_1=require(a1_0x4c132e(0x1dc)),commander_1=require('commander'),path_1=__importDefault(require(a1_0x4c132e(0x1fa))),program=new commander_1[(a1_0x4c132e(0x1d5))](),_path=process[a1_0x4c132e(0x1e1)]();program[a1_0x4c132e(0x1e9)](a1_0x4c132e(0x1d3),a1_0x4c132e(0x1f2))['option'](a1_0x4c132e(0x206),a1_0x4c132e(0x1da))[a1_0x4c132e(0x1e9)](a1_0x4c132e(0x1ea),a1_0x4c132e(0x1db))[a1_0x4c132e(0x1e9)](a1_0x4c132e(0x1fc),a1_0x4c132e(0x1ef))[a1_0x4c132e(0x1e9)](a1_0x4c132e(0x1d7),a1_0x4c132e(0x1f6))['option'](a1_0x4c132e(0x1fd),a1_0x4c132e(0x1f7)),program[a1_0x4c132e(0x1f0)]();const options=Object[a1_0x4c132e(0x1fe)]({'dir':a1_0x4c132e(0x1de),'output':a1_0x4c132e(0x200),'suffix':'Entity'},program[a1_0x4c132e(0x1e6)]());function run(){const _0x1ebcdf=a1_0x4c132e,_0x2d02dc=path_1['default'][_0x1ebcdf(0x1ee)](_path,options[_0x1ebcdf(0x1f5)]),_0x50731b=(0x0,js_utils_plus_1[_0x1ebcdf(0x1d2)])(_0x2d02dc,_0x1ebcdf(0x1d9),options[_0x1ebcdf(0x1d4)]||[]);console[_0x1ebcdf(0x1e4)](new Array(0x50)[_0x1ebcdf(0x1ee)]('-')),_0x50731b[_0x1ebcdf(0x1d8)](function(_0x44556a){const _0x56babc=_0x1ebcdf,_0x175108=(0x0,js_utils_plus_1[_0x56babc(0x1f8)])(_0x44556a,!![]);if(!_0x175108){console[_0x56babc(0x1fb)]('-\x20执行文件:'+_0x44556a);return;}console[_0x56babc(0x1e4)](_0x56babc(0x208)+_0x44556a);const _0x31638b=path_1[_0x56babc(0x1e0)]['parse'](_0x44556a);let _0x24f7a9=_0x175108[_0x56babc(0x201)]||_0x31638b['name'];if(_0x175108[_0x56babc(0x201)])delete _0x175108[_0x56babc(0x201)];const _0x4b27d5=(0x0,json2dart_1[_0x56babc(0x209)])(_0x175108,_0x24f7a9,options[_0x56babc(0x204)],options[_0x56babc(0x202)],options[_0x56babc(0x1e7)]),_0x50ad1e=path_1['default'][_0x56babc(0x1ee)](_path,options[_0x56babc(0x1e5)],_0x31638b[_0x56babc(0x1df)]+_0x56babc(0x1f3));(0x0,js_utils_plus_1[_0x56babc(0x1f4)])(_0x50ad1e,_0x4b27d5);});}run();function a1_0x141b(){const _0x1528a2=['--nullsafety','assign','742835xPkHWN','lib/models','__className','nullsafety','8OOMDYE','suffix','./core/json2dart','-o,\x20--output\x20<dir>','__esModule','-\x20执行文件:','jsonToDart','defineProperty','listFilesRecursively','-d,\x20--dir\x20<dir>','excludes','Command','16EiakGq','--numparse','forEach','json','dart模型输出路径,默认\x20lib/models','自定义dart模型类名后缀,\x20默认\x20Entity','js-utils-plus','3574938NoUVmF','.json_models/','name','default','cwd','16903513YtOTDq','__importDefault','log','output','opts','numparse','274TTMjGw','option','-s,\x20--suffix\x20<value>','12063KeqzQa','110oWdbRJ','710784NFhYHN','join','需要排除的文件或文件夹,可指定多个文件','parse','3096744bEzeNX','json文件夹路径,默认\x20.json_models/','.dart','writeFileSync','dir','使用num数据类型而不是double/int','是否启用空安全','readFileSync','347301xQdvYB','path','error','-e,\x20--excludes\x20<value...>'];a1_0x141b=function(){return _0x1528a2;};return a1_0x141b();}
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "json2dart-generator",
3
- "version": "0.1.1",
4
- "description": "json to dart model generator",
3
+ "version": "0.3.0",
4
+ "description": "JSON Dart Model 类构建工具",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
7
7
  "json2dart": "dist/index.js"
8
8
  },
9
9
  "scripts": {
10
10
  "dev": "tsc -w",
11
- "test": "tsc && node dist/index.js -d ./json_models -o ./models -s Entity --nullsafety --numparse",
11
+ "test": "tsc && node dist/index.js -d ./.json_models -o ./models --nullsafety --numparse",
12
12
  "build": "rimraf dist && tsc && javascript-obfuscator dist --output dist"
13
13
  },
14
14
  "author": "evan.lin",