json2dart-generator 0.2.0 → 1.0.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
@@ -18,7 +18,7 @@ json2dart options
18
18
  Options:
19
19
  -d, --dir <dir> json文件夹路径,默认 .json_models/
20
20
  -o, --output <dir> dart模型输出路径,默认 lib/models
21
- -s, --suffix <value> 自定义dart模型类名后缀,默认 Entity
21
+ -s, --suffix <value> 自定义dart模型类名后缀,如 Entity、Model
22
22
  -e, --excludes <value...> 需要排除的文件或文件夹,可指定多个文件
23
23
  --numparse 使用num数据类型而不是double/int
24
24
  --nullsafety 是否启用空安全
@@ -38,7 +38,7 @@ json2dart --help
38
38
  - 执行命令
39
39
 
40
40
  ```bash
41
- json2dart --dir .json_models -o lib/models --nullsafety
41
+ json2dart --dir .json_models -o lib/models --nullsafety --numparse
42
42
  ```
43
43
 
44
44
  ### 示例
@@ -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';const a0_0x1a80e2=a0_0x181a;(function(_0x2b7598,_0x53950e){const _0x585b6e=a0_0x181a,_0x16b32a=_0x2b7598();while(!![]){try{const _0x3a1b11=-parseInt(_0x585b6e(0x222))/0x1*(-parseInt(_0x585b6e(0x209))/0x2)+-parseInt(_0x585b6e(0x1d7))/0x3+parseInt(_0x585b6e(0x220))/0x4+parseInt(_0x585b6e(0x1fe))/0x5*(parseInt(_0x585b6e(0x1e3))/0x6)+-parseInt(_0x585b6e(0x203))/0x7*(-parseInt(_0x585b6e(0x1e6))/0x8)+parseInt(_0x585b6e(0x1e7))/0x9+-parseInt(_0x585b6e(0x1c6))/0xa;if(_0x3a1b11===_0x53950e)break;else _0x16b32a['push'](_0x16b32a['shift']());}catch(_0x3c49de){_0x16b32a['push'](_0x16b32a['shift']());}}}(a0_0x57c3,0xbdd99));Object[a0_0x1a80e2(0x1cf)](exports,a0_0x1a80e2(0x1d1),{'value':!![]}),exports[a0_0x1a80e2(0x1e0)]=jsonToDart;const js_utils_plus_1=require(a0_0x1a80e2(0x1f0));function modelTypeGenerator(_0x55bbac,_0x18f563,_0x182082,_0x855864){const _0x5298ee=a0_0x1a80e2;if((0x0,js_utils_plus_1[_0x5298ee(0x1fd)])(_0x55bbac))return{'type':_0x5298ee(0x1f6),'typeTo':_0x2f144e=>_0x2f144e,'typeFrom':_0x44d2fa=>_0x44d2fa+'\x20is\x20bool\x20?\x20'+_0x44d2fa+_0x5298ee(0x21e)};if((0x0,js_utils_plus_1[_0x5298ee(0x1e5)])(_0x55bbac))return{'type':_0x5298ee(0x224),'typeTo':_0x48caea=>_0x48caea,'typeFrom':_0x228c07=>_0x228c07+_0x5298ee(0x1f9)};if((0x0,js_utils_plus_1['isNumber'])(_0x55bbac)){if(_0x855864)return{'type':_0x5298ee(0x223),'typeTo':_0x2d02ba=>_0x2d02ba,'typeFrom':_0x2bbb77=>_0x5298ee(0x1d3)+_0x2bbb77+'?.toString()\x20??\x20\x27\x27)'};return(0x0,js_utils_plus_1[_0x5298ee(0x1e9)])(_0x55bbac)?{'type':_0x5298ee(0x221),'typeTo':_0x530f8d=>_0x530f8d,'typeFrom':_0x26d703=>_0x5298ee(0x1c9)+_0x26d703+'?.toString()\x20??\x20\x27\x27)'}:{'type':_0x5298ee(0x1c5),'typeTo':_0x10e074=>_0x10e074,'typeFrom':_0xfb046a=>_0x5298ee(0x1f1)+_0xfb046a+_0x5298ee(0x1f4)};}if((0x0,js_utils_plus_1[_0x5298ee(0x227)])(_0x55bbac))return{'type':_0x18f563,'typeTo':_0xfdc7d9=>_0xfdc7d9+_0x5298ee(0x1fc),'typeFrom':_0x2b5ba5=>'('+_0x2b5ba5+'\x20!=\x20null\x20&&\x20'+_0x2b5ba5+'\x20is\x20Map<String,\x20dynamic>)\x20?\x20'+_0x18f563+_0x5298ee(0x1c8)+_0x2b5ba5+')\x20:\x20null','subLines':jsonToDart(_0x55bbac,_0x18f563,_0x182082,_0x855864)};if((0x0,js_utils_plus_1[_0x5298ee(0x20c)])(_0x55bbac)){const _0x4e7c67=_0x55bbac[0x0];if(!_0x4e7c67)console[_0x5298ee(0x1d8)]('-\x20警告!:'+_0x18f563+'\x20类包含值为\x22空\x22的属性,将被默认视为”String“类型');const {type:_0x2a91c8,typeTo:_0x5b38e6,typeFrom:_0x4273fa,subLines:_0x388c6e}=modelTypeGenerator(_0x4e7c67||'',_0x18f563,_0x182082,_0x855864);return{'type':_0x5298ee(0x1fb)+_0x2a91c8+(_0x182082?'?':'')+'>','typeTo':_0x8d467d=>_0x8d467d+_0x5298ee(0x21d)+_0x5b38e6('e')+_0x5298ee(0x216),'typeFrom':_0x30a361=>'('+_0x30a361+_0x5298ee(0x1ed)+_0x30a361+_0x5298ee(0x226)+_0x30a361+'.map((e)\x20=>\x20'+_0x4273fa('e')+_0x5298ee(0x1da),'subLines':_0x388c6e};}return console['log'](_0x5298ee(0x1e1)+_0x18f563+_0x5298ee(0x20d)),{'type':_0x5298ee(0x224),'typeTo':_0x2055ae=>_0x2055ae,'typeFrom':_0x2914ac=>_0x2914ac+'?.toString()'};}function modelKeywordDefence(_0x3ba6a7){const _0x3f4ed5=a0_0x1a80e2;let _0x3bdadc=[_0x3f4ed5(0x223),_0x3f4ed5(0x1c5),_0x3f4ed5(0x221),_0x3f4ed5(0x224),'bool',_0x3f4ed5(0x215),_0x3f4ed5(0x21a),_0x3f4ed5(0x1d6),'implements',_0x3f4ed5(0x1dc),'as',_0x3f4ed5(0x1ef),_0x3f4ed5(0x1d9),_0x3f4ed5(0x207),_0x3f4ed5(0x1e2),_0x3f4ed5(0x20b),'in',_0x3f4ed5(0x1d0),_0x3f4ed5(0x20f),_0x3f4ed5(0x208),_0x3f4ed5(0x1ee),'switch','await',_0x3f4ed5(0x21f),'is',_0x3f4ed5(0x210),_0x3f4ed5(0x21b),_0x3f4ed5(0x213),_0x3f4ed5(0x21c),_0x3f4ed5(0x206),_0x3f4ed5(0x1ce),'factory',_0x3f4ed5(0x1cd),_0x3f4ed5(0x1eb),_0x3f4ed5(0x20e),_0x3f4ed5(0x1ca),_0x3f4ed5(0x1d2),_0x3f4ed5(0x201),_0x3f4ed5(0x1e4),_0x3f4ed5(0x1f8),_0x3f4ed5(0x200),_0x3f4ed5(0x1f3),_0x3f4ed5(0x1f5),_0x3f4ed5(0x225),'on',_0x3f4ed5(0x217),_0x3f4ed5(0x1e8),_0x3f4ed5(0x1f2),_0x3f4ed5(0x1ff),_0x3f4ed5(0x204),_0x3f4ed5(0x212),_0x3f4ed5(0x1db),_0x3f4ed5(0x219),'void',_0x3f4ed5(0x1ec),_0x3f4ed5(0x1dd),_0x3f4ed5(0x1d4),_0x3f4ed5(0x202),_0x3f4ed5(0x1ea),'hide',_0x3f4ed5(0x211),_0x3f4ed5(0x1f7),'do','if',_0x3f4ed5(0x1c4),'yield'];if(_0x3bdadc['includes'](_0x3ba6a7)||/^\d/['test'](_0x3ba6a7))return _0x3f4ed5(0x20a)+(0x0,js_utils_plus_1['uppercaseFirst'])(_0x3ba6a7);return(0x0,js_utils_plus_1['snakeToCamel'])(_0x3ba6a7);}function a0_0x181a(_0x3b630d,_0x46d470){_0x3b630d=_0x3b630d-0x1c4;const _0x57c330=a0_0x57c3();let _0x181a51=_0x57c330[_0x3b630d];return _0x181a51;}function jsonToDart(_0x57aa5b,_0x13687d,_0x4f225c,_0x34157c){const _0x4a2082=a0_0x1a80e2;_0x13687d=(0x0,js_utils_plus_1[_0x4a2082(0x1fa)])((0x0,js_utils_plus_1['snakeToCamel'])(_0x13687d));let _0x4b6991=[],_0x438a4b=[],_0x57096b=[],_0x235124=[],_0x1a497f=[],_0x4c8915=[];_0x4b6991['push']('class\x20'+_0x13687d+'\x20{'),_0x57096b[_0x4a2082(0x1cc)]('\x20\x20'+_0x13687d+'({\x0a'),_0x235124[_0x4a2082(0x1cc)]('\x20\x20'+_0x13687d+_0x4a2082(0x1cb)),_0x1a497f['push'](_0x4a2082(0x205));for(const [_0x358663,_0x2a7473]of Object['entries'](_0x57aa5b)){let _0x53027f='\x27'+_0x358663+'\x27',_0x250527=modelKeywordDefence(_0x358663);const _0x4daf26=''+_0x13687d+(0x0,js_utils_plus_1['uppercaseFirst'])((0x0,js_utils_plus_1[_0x4a2082(0x218)])(_0x358663)),{type:_0x5731bf,typeTo:_0x3278d5,typeFrom:_0x5e8206,subLines:_0x21330e}=modelTypeGenerator(_0x2a7473,_0x4daf26,_0x4f225c,_0x34157c);if(_0x21330e)_0x4c8915['push'](_0x21330e);_0x57096b[_0x4a2082(0x1cc)]('\x20\x20\x20\x20this.'+_0x250527+',\x0a'),_0x438a4b[_0x4a2082(0x1cc)]('\x20\x20'+_0x5731bf+(_0x4f225c?'?':'')+'\x20'+_0x250527+';\x0a'),_0x235124[_0x4a2082(0x1cc)](_0x4a2082(0x1de)+_0x250527+'\x20=\x20'+_0x5e8206(_0x4a2082(0x1c7)+_0x53027f+']')+';\x0a'),_0x1a497f[_0x4a2082(0x1cc)]('\x20\x20\x20\x20\x20\x20\x20\x20'+_0x53027f+':\x20'+_0x3278d5(_0x250527)+',\x0a');}return _0x57096b[_0x4a2082(0x1cc)](_0x4a2082(0x1d5)),_0x235124[_0x4a2082(0x1cc)]('\x20\x20}'),_0x1a497f[_0x4a2082(0x1cc)](_0x4a2082(0x1df)),_0x4b6991['push'](_0x438a4b[_0x4a2082(0x214)]('')),_0x4b6991[_0x4a2082(0x1cc)](_0x57096b[_0x4a2082(0x214)]('')),_0x4b6991[_0x4a2082(0x1cc)](_0x235124['join']('')),_0x4b6991['push'](_0x1a497f[_0x4a2082(0x214)]('')),_0x4b6991[_0x4a2082(0x1cc)]('}\x0a'),_0x4b6991[_0x4a2082(0x1cc)](_0x4c8915[_0x4a2082(0x214)]('')),_0x4b6991[_0x4a2082(0x214)]('\x0d\x0a');}function a0_0x57c3(){const _0x53daf4=['sync','return','covariant','external','join','List',')?.toList()','typedef','snakeToCamel','part','abstract','break','library','?.map((e)\x20=>\x20','\x20:\x20null','extends','3865656nraWRj','int','728407XbnmSI','num','String','finally','\x20is\x20List)\x20?\x20','isObject','set','double','25524860ejOTjj','json[','.fromJson(','int.tryParse(','false','.fromJson(Map<String,\x20dynamic>\x20json)\x20{\x0a','push','mixin','case','defineProperty','super','__esModule','new','num.tryParse(','rethrow','\x20\x20});','dynamic','2721432zwlKFI','log','import',')?.toList()\x20:\x20null','Function','show','get','\x20\x20\x20\x20','\x20\x20\x20\x20\x20\x20};','jsonToDart','-\x20警告!:','assert','786ffuUYr','class','isString','104008EAQVxC','9256239RsKMit','continue','isInt','deferred','throw','default','\x20!=\x20null\x20&&\x20','interface','else','js-utils-plus','double.tryParse(','for','try','?.toString()\x20??\x20\x27\x27)','const','bool','with','final','?.toString()','uppercaseFirst','List<','?.toJson()','isBoolean','33470NWDLOI','operator','null','true','while','343NZEtSS','var','\x20\x20Map<String,\x20dynamic>\x20toJson()\x20=>\x20{\x0a','this','static','export','2UEAigK','the','enum','isArray','\x20类包含值为\x22空\x22的属性,将被默认视为”String“类型','catch','async'];a0_0x57c3=function(){return _0x53daf4;};return a0_0x57c3();}
1
+ 'use strict';const a0_0x3f5451=a0_0x3767;(function(_0x4ffaf5,_0x3fddff){const _0x4a5a2b=a0_0x3767,_0xe551cc=_0x4ffaf5();while(!![]){try{const _0x2239b1=-parseInt(_0x4a5a2b(0x8f))/0x1+parseInt(_0x4a5a2b(0xb8))/0x2*(-parseInt(_0x4a5a2b(0x9a))/0x3)+parseInt(_0x4a5a2b(0xc6))/0x4+parseInt(_0x4a5a2b(0x7c))/0x5+-parseInt(_0x4a5a2b(0x77))/0x6+parseInt(_0x4a5a2b(0xb1))/0x7*(-parseInt(_0x4a5a2b(0x81))/0x8)+parseInt(_0x4a5a2b(0x90))/0x9;if(_0x2239b1===_0x3fddff)break;else _0xe551cc['push'](_0xe551cc['shift']());}catch(_0x2b2f95){_0xe551cc['push'](_0xe551cc['shift']());}}}(a0_0x146d,0x982b6));function a0_0x146d(){const _0x49930f=['\x20as\x20List<dynamic>?)?.map((e)\x20=>\x20','interface','?.toString()','snakeToCamel','test','\x20as\x20Map<String,\x20dynamic>)','typedef','continue','throw','int','async','399Knvjtx','includes','hide','var','else','case','default','22JIoFDa','enum','static','operator','with','json[','Function','\x20\x20\x20\x20\x20\x20};','null','set','external','while','break','isString','462112jBQVoT','String','factory','js-utils-plus','catch','true','final','return','try','entries','num.tryParse(','class\x20','join','import','2091288rOcjHt','finally','abstract','push','\x20\x20}','3018180jKRWmN','assert','library','log','isNumber','75176iInprb','?.toJson()','mixin','for','-\x20警告!:','implements','defineProperty','get','uppercaseFirst','bool','isBoolean','\x20\x20\x20\x20this.','deferred',').toList()','991353jLKnSJ','26332569tNHXiT','__esModule','super','.fromJson(Map<String,\x20dynamic>\x20json)\x20{\x0a','\x20:\x20null','\x20\x20});','List','num','const','new','312597gGyIrh','extends','isObject','false','\x20类包含值为\x22空\x22的属性,将被默认视为”String“类型','?.toString()\x20??\x20\x27\x27)','dynamic','void','covariant','List<','double','({\x0a'];a0_0x146d=function(){return _0x49930f;};return a0_0x146d();}Object[a0_0x3f5451(0x87)](exports,a0_0x3f5451(0x91),{'value':!![]}),exports['jsonToDart']=jsonToDart;const js_utils_plus_1=require(a0_0x3f5451(0x6c));function modelTypeGenerator(_0x3c635f,_0x127a08,_0x212b8e,_0x41414c,_0x239da4){const _0x48288c=a0_0x3f5451;if((0x0,js_utils_plus_1[_0x48288c(0x8b)])(_0x3c635f))return{'type':_0x48288c(0x8a),'typeTo':_0x5d8a30=>_0x5d8a30,'typeFrom':_0x1eda79=>_0x1eda79+'\x20is\x20bool\x20?\x20'+_0x1eda79+_0x48288c(0x94)};if((0x0,js_utils_plus_1[_0x48288c(0xc5)])(_0x3c635f))return{'type':_0x48288c(0xc7),'typeTo':_0x570da8=>_0x570da8,'typeFrom':_0x5cb617=>_0x5cb617+_0x48288c(0xa8)};if((0x0,js_utils_plus_1[_0x48288c(0x80)])(_0x3c635f)){if(_0x239da4)return{'type':_0x48288c(0x97),'typeTo':_0x5a41ed=>_0x5a41ed,'typeFrom':_0x30a90c=>_0x48288c(0x73)+_0x30a90c+_0x48288c(0x9f)};return(0x0,js_utils_plus_1['isInt'])(_0x3c635f)?{'type':_0x48288c(0xaf),'typeTo':_0x246898=>_0x246898,'typeFrom':_0x238215=>'int.tryParse('+_0x238215+_0x48288c(0x9f)}:{'type':_0x48288c(0xa4),'typeTo':_0x28098e=>_0x28098e,'typeFrom':_0x3a09b8=>'double.tryParse('+_0x3a09b8+_0x48288c(0x9f)};}if((0x0,js_utils_plus_1[_0x48288c(0x9c)])(_0x3c635f))return{'type':''+_0x127a08+_0x212b8e,'typeTo':_0x42daae=>_0x42daae+_0x48288c(0x82),'typeFrom':_0x45c293=>''+_0x127a08+_0x212b8e+'.fromJson('+_0x45c293+_0x48288c(0xab),'subLines':jsonToDart(_0x3c635f,_0x127a08,_0x212b8e,_0x41414c,_0x239da4)};if((0x0,js_utils_plus_1['isArray'])(_0x3c635f)){const _0x41debb=_0x3c635f[0x0];if(!_0x41debb)console[_0x48288c(0x7f)](_0x48288c(0x85)+_0x127a08+_0x212b8e+_0x48288c(0x9e));const {type:_0x223ad9,typeTo:_0x78e243,typeFrom:_0x34e17e,subLines:_0x37937a}=modelTypeGenerator(_0x41debb||'',_0x127a08,_0x212b8e,_0x41414c,_0x239da4);return{'type':_0x48288c(0xa3)+_0x223ad9+(_0x41414c?'?':'')+'>','typeTo':_0x1f84ab=>_0x1f84ab+'?.map((e)\x20=>\x20'+_0x78e243('e')+').toList()','typeFrom':_0x5b54ca=>'('+_0x5b54ca+_0x48288c(0xa6)+_0x34e17e('e')+_0x48288c(0x8e),'subLines':_0x37937a};}return console[_0x48288c(0x7f)](_0x48288c(0x85)+_0x127a08+_0x212b8e+_0x48288c(0x9e)),{'type':_0x48288c(0xc7),'typeTo':_0x323c8b=>_0x323c8b,'typeFrom':_0x4bc9ea=>_0x4bc9ea+_0x48288c(0xa8)};}function modelKeywordDefence(_0x41abe1){const _0x106f35=a0_0x3f5451;let _0x2942a0=[_0x106f35(0x97),_0x106f35(0xa4),_0x106f35(0xaf),'String',_0x106f35(0x8a),_0x106f35(0x96),_0x106f35(0x79),_0x106f35(0xa0),_0x106f35(0x86),'show','as',_0x106f35(0xb5),_0x106f35(0x76),_0x106f35(0xba),_0x106f35(0x7d),_0x106f35(0xb9),'in',_0x106f35(0x92),_0x106f35(0xb0),'export',_0x106f35(0xa7),'switch','await',_0x106f35(0x9b),'is','sync',_0x106f35(0xc4),_0x106f35(0xc2),_0x106f35(0x7e),'this',_0x106f35(0xb6),_0x106f35(0x6b),_0x106f35(0x83),_0x106f35(0xae),_0x106f35(0x6d),_0x106f35(0x9d),_0x106f35(0x99),_0x106f35(0x6e),'class',_0x106f35(0x6f),_0x106f35(0xc0),_0x106f35(0x71),_0x106f35(0x98),_0x106f35(0x78),'on',_0x106f35(0xac),_0x106f35(0xad),_0x106f35(0x84),_0x106f35(0xbb),_0x106f35(0xb4),_0x106f35(0xa2),_0x106f35(0xbe),'part',_0x106f35(0xa1),_0x106f35(0xb7),_0x106f35(0x88),'rethrow',_0x106f35(0xc3),_0x106f35(0x8d),_0x106f35(0xb3),_0x106f35(0x70),_0x106f35(0xbc),'do','if',_0x106f35(0xc1),'yield'];if(_0x2942a0[_0x106f35(0xb2)](_0x41abe1)||/^\d/[_0x106f35(0xaa)](_0x41abe1))return'the'+(0x0,js_utils_plus_1[_0x106f35(0x89)])(_0x41abe1);return(0x0,js_utils_plus_1[_0x106f35(0xa9)])(_0x41abe1);}function a0_0x3767(_0x404b83,_0x4f44d7){_0x404b83=_0x404b83-0x6b;const _0x146da2=a0_0x146d();let _0x3767c4=_0x146da2[_0x404b83];return _0x3767c4;}function jsonToDart(_0x357f4f,_0x111f99,_0x325158,_0x424ff9,_0x38b0a2){const _0x41b709=a0_0x3f5451;_0x111f99=(0x0,js_utils_plus_1[_0x41b709(0x89)])((0x0,js_utils_plus_1['snakeToCamel'])(_0x111f99));let _0x339512=[],_0x1830ea=[],_0x1178c5=[],_0x57b6c5=[],_0x3703bb=[],_0xabd1ea=[];_0x339512[_0x41b709(0x7a)](_0x41b709(0x74)+_0x111f99+_0x325158+'\x20{'),_0x1178c5[_0x41b709(0x7a)]('\x20\x20'+_0x111f99+_0x325158+_0x41b709(0xa5)),_0x57b6c5['push']('\x20\x20'+_0x111f99+_0x325158+_0x41b709(0x93)),_0x3703bb[_0x41b709(0x7a)]('\x20\x20Map<String,\x20dynamic>\x20toJson()\x20=>\x20{\x0a');for(const [_0x29ab85,_0x1fd854]of Object[_0x41b709(0x72)](_0x357f4f)){let _0x2ad6d3='\x27'+_0x29ab85+'\x27',_0x1b577f=modelKeywordDefence(_0x29ab85);const _0x39094a=(0x0,js_utils_plus_1['uppercaseFirst'])((0x0,js_utils_plus_1[_0x41b709(0xa9)])(_0x29ab85)),{type:_0x40d63f,typeTo:_0x55d42d,typeFrom:_0xde2499,subLines:_0x28e301}=modelTypeGenerator(_0x1fd854,_0x39094a,_0x325158,_0x424ff9,_0x38b0a2);if(_0x28e301)_0xabd1ea[_0x41b709(0x7a)](_0x28e301);_0x1178c5[_0x41b709(0x7a)](_0x41b709(0x8c)+_0x1b577f+',\x0a'),_0x1830ea[_0x41b709(0x7a)]('\x20\x20'+_0x40d63f+(_0x424ff9?'?':'')+'\x20'+_0x1b577f+';\x0a'),_0x57b6c5[_0x41b709(0x7a)]('\x20\x20\x20\x20'+_0x1b577f+'\x20=\x20'+_0xde2499(_0x41b709(0xbd)+_0x2ad6d3+']')+';\x0a'),_0x3703bb['push']('\x20\x20\x20\x20\x20\x20\x20\x20'+_0x2ad6d3+':\x20'+_0x55d42d(_0x1b577f)+',\x0a');}return _0x1178c5[_0x41b709(0x7a)](_0x41b709(0x95)),_0x57b6c5['push'](_0x41b709(0x7b)),_0x3703bb['push'](_0x41b709(0xbf)),_0x339512['push'](_0x1830ea['join']('')),_0x339512[_0x41b709(0x7a)](_0x1178c5[_0x41b709(0x75)]('')),_0x339512[_0x41b709(0x7a)](_0x57b6c5[_0x41b709(0x75)]('')),_0x339512[_0x41b709(0x7a)](_0x3703bb[_0x41b709(0x75)]('')),_0x339512[_0x41b709(0x7a)]('}\x0a'),_0x339512[_0x41b709(0x7a)](_0xabd1ea[_0x41b709(0x75)]('')),_0x339512[_0x41b709(0x75)]('\x0d\x0a');}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #! /usr/bin/env node
2
- 'use strict';const a1_0xfb1923=a1_0x3e0a;(function(_0x4eb1a2,_0x4152d3){const _0x4b910c=a1_0x3e0a,_0xeed581=_0x4eb1a2();while(!![]){try{const _0x498109=parseInt(_0x4b910c(0xcd))/0x1+parseInt(_0x4b910c(0xca))/0x2*(parseInt(_0x4b910c(0xc5))/0x3)+parseInt(_0x4b910c(0xd8))/0x4*(parseInt(_0x4b910c(0xc7))/0x5)+-parseInt(_0x4b910c(0xde))/0x6*(parseInt(_0x4b910c(0xda))/0x7)+-parseInt(_0x4b910c(0xce))/0x8*(-parseInt(_0x4b910c(0xe6))/0x9)+parseInt(_0x4b910c(0xdc))/0xa*(-parseInt(_0x4b910c(0xcf))/0xb)+-parseInt(_0x4b910c(0xd4))/0xc;if(_0x498109===_0x4152d3)break;else _0xeed581['push'](_0xeed581['shift']());}catch(_0xceac5e){_0xeed581['push'](_0xeed581['shift']());}}}(a1_0x15b5,0x1c4eb));var __importDefault=this&&this[a1_0xfb1923(0xe4)]||function(_0x15db98){const _0x4d069a=a1_0xfb1923;return _0x15db98&&_0x15db98[_0x4d069a(0xd6)]?_0x15db98:{'default':_0x15db98};};function a1_0x3e0a(_0x3ba330,_0x28d871){_0x3ba330=_0x3ba330-0xbb;const _0x15b551=a1_0x15b5();let _0x3e0a1c=_0x15b551[_0x3ba330];return _0x3e0a1c;}function a1_0x15b5(){const _0x3cd9c9=['error','parse','-e,\x20--excludes\x20<value...>','__className','js-utils-plus','output','suffix','default','.json_models/','-\x20执行文件:','listFilesRecursively','1212qXIHxB','join','5zeCDPB','--nullsafety','forEach','422XNdork','path','Entity','163608LPeUaF','55856NGTXCm','264781HqeYjn','json','-s,\x20--suffix\x20<value>','opts','log','3439824xKajfF','.dart','__esModule','-o,\x20--output\x20<dir>','699740XHzyIa','excludes','8701mYClLz','cwd','10EopIFJ','dart模型输出路径,默认\x20lib/models','222nwpPwJ','defineProperty','option','jsonToDart','-d,\x20--dir\x20<dir>','commander','__importDefault','assign','63gFwfXV','使用num数据类型而不是double/int','writeFileSync','readFileSync'];a1_0x15b5=function(){return _0x3cd9c9;};return a1_0x15b5();}Object[a1_0xfb1923(0xdf)](exports,a1_0xfb1923(0xd6),{'value':!![]});const json2dart_1=require('./core/json2dart'),js_utils_plus_1=require(a1_0xfb1923(0xbe)),commander_1=require(a1_0xfb1923(0xe3)),path_1=__importDefault(require(a1_0xfb1923(0xcb))),program=new commander_1['Command'](),_path=process[a1_0xfb1923(0xdb)]();program[a1_0xfb1923(0xe0)](a1_0xfb1923(0xe2),'json文件夹路径,默认\x20.json_models/')[a1_0xfb1923(0xe0)](a1_0xfb1923(0xd7),a1_0xfb1923(0xdd))['option'](a1_0xfb1923(0xd1),'自定义dart模型类名后缀,\x20默认\x20Entity')[a1_0xfb1923(0xe0)](a1_0xfb1923(0xbc),'需要排除的文件或文件夹,可指定多个文件')['option']('--numparse',a1_0xfb1923(0xe7))[a1_0xfb1923(0xe0)](a1_0xfb1923(0xc8),'是否启用空安全'),program[a1_0xfb1923(0xbb)]();const options=Object[a1_0xfb1923(0xe5)]({'dir':a1_0xfb1923(0xc2),'output':'lib/models','suffix':a1_0xfb1923(0xcc)},program[a1_0xfb1923(0xd2)]());function run(){const _0x31c0d8=a1_0xfb1923,_0x510274=path_1[_0x31c0d8(0xc1)]['join'](_path,options['dir']),_0x24f173=(0x0,js_utils_plus_1[_0x31c0d8(0xc4)])(_0x510274,_0x31c0d8(0xd0),options[_0x31c0d8(0xd9)]||[]);console[_0x31c0d8(0xd3)](new Array(0x50)['join']('-')),_0x24f173[_0x31c0d8(0xc9)](function(_0x5c24e7){const _0x523db5=_0x31c0d8,_0x232a5f=(0x0,js_utils_plus_1[_0x523db5(0xe9)])(_0x5c24e7,!![]);if(!_0x232a5f){console[_0x523db5(0xea)](_0x523db5(0xc3)+_0x5c24e7);return;}console[_0x523db5(0xd3)](_0x523db5(0xc3)+_0x5c24e7);const _0x5d2043=path_1[_0x523db5(0xc1)][_0x523db5(0xbb)](_0x5c24e7);let _0x15caad=_0x232a5f[_0x523db5(0xbd)]||_0x5d2043['name'];if(_0x232a5f[_0x523db5(0xbd)])delete _0x232a5f['__className'];const _0x18311a=(0x0,json2dart_1[_0x523db5(0xe1)])(_0x232a5f,options[_0x523db5(0xc0)]?''+_0x15caad+options[_0x523db5(0xc0)]:_0x15caad,options['nullsafety'],options['numparse']),_0x4f3960=path_1[_0x523db5(0xc1)][_0x523db5(0xc6)](_path,options[_0x523db5(0xbf)],_0x5d2043['name']+_0x523db5(0xd5));(0x0,js_utils_plus_1[_0x523db5(0xe8)])(_0x4f3960,_0x18311a);});}run();
2
+ 'use strict';const a1_0x297422=a1_0x14c6;(function(_0x19f166,_0x4a73a3){const _0x160cec=a1_0x14c6,_0x184868=_0x19f166();while(!![]){try{const _0x5b69ef=parseInt(_0x160cec(0x11a))/0x1+-parseInt(_0x160cec(0x119))/0x2*(parseInt(_0x160cec(0x113))/0x3)+parseInt(_0x160cec(0x10b))/0x4*(parseInt(_0x160cec(0x11f))/0x5)+-parseInt(_0x160cec(0xf4))/0x6*(parseInt(_0x160cec(0xfc))/0x7)+parseInt(_0x160cec(0x11d))/0x8*(-parseInt(_0x160cec(0x105))/0x9)+-parseInt(_0x160cec(0x11c))/0xa*(parseInt(_0x160cec(0x106))/0xb)+-parseInt(_0x160cec(0x114))/0xc*(-parseInt(_0x160cec(0xfe))/0xd);if(_0x5b69ef===_0x4a73a3)break;else _0x184868['push'](_0x184868['shift']());}catch(_0x57b84c){_0x184868['push'](_0x184868['shift']());}}}(a1_0x1ead,0x47c73));var __importDefault=this&&this[a1_0x297422(0x10f)]||function(_0x40335f){const _0x4acf09=a1_0x297422;return _0x40335f&&_0x40335f[_0x4acf09(0x111)]?_0x40335f:{'default':_0x40335f};};Object['defineProperty'](exports,a1_0x297422(0x111),{'value':!![]});const json2dart_1=require(a1_0x297422(0xf2)),js_utils_plus_1=require(a1_0x297422(0x110)),commander_1=require(a1_0x297422(0xf1)),path_1=__importDefault(require('path')),program=new commander_1[(a1_0x297422(0x10c))](),_path=process['cwd']();program[a1_0x297422(0xf8)]('-d,\x20--dir\x20<dir>',a1_0x297422(0x109))['option'](a1_0x297422(0xff),'dart模型输出路径,默认\x20lib/models')[a1_0x297422(0xf8)](a1_0x297422(0xfa),a1_0x297422(0xf6))['option']('-e,\x20--excludes\x20<value...>','需要排除的文件或文件夹,可指定多个文件')['option']('--numparse',a1_0x297422(0x102))[a1_0x297422(0xf8)](a1_0x297422(0x107),a1_0x297422(0x118)),program[a1_0x297422(0x100)]();const options=Object['assign']({'dir':a1_0x297422(0x108),'output':a1_0x297422(0x116),'suffix':''},program[a1_0x297422(0x115)]());function run(){const _0x42267f=a1_0x297422,_0x44bb97=path_1[_0x42267f(0xf5)][_0x42267f(0x103)](_path,options[_0x42267f(0xf3)]),_0x41672d=(0x0,js_utils_plus_1[_0x42267f(0x10a)])(_0x44bb97,_0x42267f(0x10d),options[_0x42267f(0x112)]||[]);console[_0x42267f(0x104)](new Array(0x50)[_0x42267f(0x103)]('-')),_0x41672d[_0x42267f(0x101)](function(_0x1e8897){const _0x562d22=_0x42267f,_0x2c5f8b=(0x0,js_utils_plus_1[_0x562d22(0x117)])(_0x1e8897,!![]);if(!_0x2c5f8b){console['error']('-\x20执行文件:'+_0x1e8897);return;}console[_0x562d22(0x104)](_0x562d22(0x10e)+_0x1e8897);const _0x5bdb9d=path_1['default'][_0x562d22(0x100)](_0x1e8897);let _0x4b952d=_0x2c5f8b[_0x562d22(0xf9)]||_0x5bdb9d[_0x562d22(0xfb)];if(_0x2c5f8b['__className'])delete _0x2c5f8b[_0x562d22(0xf9)];const _0x47cc9d=(0x0,json2dart_1['jsonToDart'])(_0x2c5f8b,_0x4b952d,options['suffix'],options[_0x562d22(0x11b)],options[_0x562d22(0x11e)]),_0x57cbd9=path_1[_0x562d22(0xf5)][_0x562d22(0x103)](_path,options[_0x562d22(0xf7)],_0x5bdb9d[_0x562d22(0xfb)]+_0x562d22(0xfd));(0x0,js_utils_plus_1['writeFileSync'])(_0x57cbd9,_0x47cc9d);});}function a1_0x14c6(_0x15014b,_0x172146){_0x15014b=_0x15014b-0xf1;const _0x1eadb9=a1_0x1ead();let _0x14c6a0=_0x1eadb9[_0x15014b];return _0x14c6a0;}run();function a1_0x1ead(){const _0x1bda45=['Command','json','-\x20执行文件:','__importDefault','js-utils-plus','__esModule','excludes','1305780WxFaKJ','3876hVVIXQ','opts','lib/models','readFileSync','是否启用空安全','2MAClGj','454739GXnDIM','nullsafety','810hzFEuS','41064Uhmsnu','numparse','15eVnOUL','commander','./core/json2dart','dir','6wJEbxK','default','自定义dart模型类名后缀,\x20如\x20Entity、Model','output','option','__className','-s,\x20--suffix\x20<value>','name','300867MysTLS','.dart','17862yCAvmB','-o,\x20--output\x20<dir>','parse','forEach','使用num数据类型而不是double/int','join','log','81ogGLEV','39699qvxfZV','--nullsafety','.json_models/','json文件夹路径,默认\x20.json_models/','listFilesRecursively','282972MTUKxc'];a1_0x1ead=function(){return _0x1bda45;};return a1_0x1ead();}
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "json2dart-generator",
3
- "version": "0.2.0",
4
- "description": "json to dart model generator",
3
+ "version": "1.0.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",