json2dart-generator 0.0.1 → 0.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.
package/README.md CHANGED
@@ -16,16 +16,32 @@ npm install json2dart-generator -g
16
16
  json2dart options
17
17
 
18
18
  Options:
19
- -d, --dir <dir> json文件夹路径
20
- -e, --excludes <value...> 需要排除的文件,可指定多个
21
- -o, --output <file> 输出序列化模型路径, 默认 lib/models
19
+ -d, --dir <dir> json文件夹路径,默认 json_models
20
+ -o, --output <file> 输出序列化模型路径,默认 lib/models
21
+ -e, --excludes <value...> 需要排除的文件,可指定多个文件
22
22
  --nullsafety 启用空安全
23
23
  ```
24
24
 
25
+ - 帮助文档
26
+
27
+ ```bash
28
+ json2dart --help
29
+ ```
30
+
31
+ - 执行命令
32
+
33
+ ```bash
34
+ json2dart --dir ./json_models -o lib/models --nullsafety
35
+ ```
36
+
37
+ - 备注:
38
+ - 根类名为`json`的文件名(首字母自动转为大写)。
39
+
25
40
  ### 示例
26
41
 
42
+ - commonLang.json
43
+
27
44
  ```json
28
- // commonLang.json
29
45
  {
30
46
  "id": "467366309705273344",
31
47
  "parentId": "0",
@@ -45,6 +61,8 @@ Options:
45
61
  }
46
62
  ```
47
63
 
64
+ - commonLang.dart
65
+
48
66
  ```dart
49
67
  class CommonLang {
50
68
  String? id;
@@ -122,5 +140,4 @@ class CommonLangData {
122
140
  };
123
141
  }
124
142
 
125
-
126
143
  ```
@@ -1 +1 @@
1
- 'use strict';function a0_0x4a61(_0x2e9eee,_0x1b2013){const _0x5cd4c0=a0_0x5cd4();return a0_0x4a61=function(_0x4a61bb,_0x50a5cc){_0x4a61bb=_0x4a61bb-0x127;let _0x33ccd9=_0x5cd4c0[_0x4a61bb];return _0x33ccd9;},a0_0x4a61(_0x2e9eee,_0x1b2013);}const a0_0x12dbfc=a0_0x4a61;(function(_0x3bb3eb,_0x151060){const _0x1bc9a4=a0_0x4a61,_0x53d323=_0x3bb3eb();while(!![]){try{const _0x577928=-parseInt(_0x1bc9a4(0x134))/0x1+-parseInt(_0x1bc9a4(0x14a))/0x2+parseInt(_0x1bc9a4(0x16b))/0x3*(parseInt(_0x1bc9a4(0x15d))/0x4)+-parseInt(_0x1bc9a4(0x12e))/0x5*(-parseInt(_0x1bc9a4(0x158))/0x6)+parseInt(_0x1bc9a4(0x130))/0x7*(parseInt(_0x1bc9a4(0x16f))/0x8)+parseInt(_0x1bc9a4(0x17a))/0x9+-parseInt(_0x1bc9a4(0x14e))/0xa*(-parseInt(_0x1bc9a4(0x160))/0xb);if(_0x577928===_0x151060)break;else _0x53d323['push'](_0x53d323['shift']());}catch(_0x2246a0){_0x53d323['push'](_0x53d323['shift']());}}}(a0_0x5cd4,0x6a07c));Object['defineProperty'](exports,a0_0x12dbfc(0x164),{'value':!![]}),exports[a0_0x12dbfc(0x142)]=jsonToDart;function a0_0x5cd4(){const _0x18f402=['3095496rBXsjx','else','extends','\x20\x20Map<String,\x20dynamic>\x20toJson()\x20=>\x20{\x0a','\x20\x20\x20\x20','super','uppercaseFirst',')?.toList()','test','includes','Function','isArray','?.map((e)\x20=>\x20','catch','?.toString()','deferred','yield','static','bool','return','5rjfuVv','default','28qpenXF','rethrow','show','continue','522763DOrEUZ','isBoolean','new','interface','\x20\x20}','\x20as\x20List<dynamic>)?.map((e)\x20=>\x20',')\x20:\x20null','async','?.toJson()','void','WARNING\x20:\x20','isNumber','\x20)?.toList()','try','jsonToDart','int','factory','.fromJson(Map<String,\x20dynamic>\x20json)\x20{\x0a','typedef','\x20!=\x20null\x20?\x20','({\x0a','break','29958pqSpps','library','class','?.toString()\x20??\x20\x27\x27)','31830JzzYLr','isString','const','js-utils-plus','with','json[','assert','await','\x20\x20\x20\x20\x20\x20\x20\x20','snakeToCamel','882192XXkmMS','push','num','log','switch','2404vHddpy','join','while','957ZXhuoM','case','\x20has\x20Property\x20is\x20null,which\x20will\x20be\x20treated\x20as\x20String\x20type','\x20\x20});','__esModule','>.from(','class\x20','true','String','false','final','951CkHVry','mixin','double.tryParse(','double','27256OuRGti','sync','null','for','entries','implements','var','finally','set','List<','enum'];a0_0x5cd4=function(){return _0x18f402;};return a0_0x5cd4();}const js_utils_plus_1=require(a0_0x12dbfc(0x151));function modelTypeGenerator(_0x1ae679,_0x5276d4,_0x40707d){const _0x4e6841=a0_0x12dbfc;if((0x0,js_utils_plus_1[_0x4e6841(0x135)])(_0x1ae679))return{'type':_0x4e6841(0x12c),'typeTo':_0x11ee79=>_0x11ee79,'typeFrom':_0x1b754d=>''+_0x1b754d};if((0x0,js_utils_plus_1[_0x4e6841(0x14f)])(_0x1ae679))return{'type':_0x4e6841(0x168),'typeTo':_0x53dfb4=>_0x53dfb4,'typeFrom':_0x41cca0=>_0x41cca0+_0x4e6841(0x128)};if((0x0,js_utils_plus_1[_0x4e6841(0x13f)])(_0x1ae679))return(0x0,js_utils_plus_1['isInt'])(_0x1ae679)?{'type':_0x4e6841(0x143),'typeTo':_0x5d64d3=>_0x5d64d3,'typeFrom':_0x5ee4c7=>'int.tryParse('+_0x5ee4c7+_0x4e6841(0x14d)}:{'type':_0x4e6841(0x16e),'typeTo':_0x1a6304=>_0x1a6304,'typeFrom':_0x15bac5=>_0x4e6841(0x16d)+_0x15bac5+_0x4e6841(0x14d)};if((0x0,js_utils_plus_1['isObject'])(_0x1ae679))return{'type':_0x5276d4,'typeTo':_0x543be9=>_0x543be9+_0x4e6841(0x13c),'typeFrom':_0x4972f4=>_0x4972f4+_0x4e6841(0x147)+_0x5276d4+'.fromJson('+_0x4972f4+_0x4e6841(0x13a),'subLines':jsonToDart(_0x1ae679,_0x5276d4,_0x40707d)};if((0x0,js_utils_plus_1[_0x4e6841(0x185)])(_0x1ae679)){const _0x1f3fef=_0x1ae679[0x0];if(!_0x1f3fef)console[_0x4e6841(0x15b)](_0x4e6841(0x13e)+_0x5276d4+'\x20has\x20Property\x20is\x20null,which\x20will\x20be\x20treated\x20as\x20String\x20type');const {type:_0x1c8988,typeTo:_0x4918b1,typeFrom:_0x3a5e23,subLines:_0x3d80a2}=modelTypeGenerator(_0x1f3fef||'',_0x5276d4,_0x40707d);if([_0x4e6841(0x12c),'String','int',_0x4e6841(0x16e)]['includes'](_0x1c8988))return{'type':'List<'+_0x1c8988+(_0x40707d?'?':'')+'>','typeTo':_0x23d337=>_0x23d337,'typeFrom':_0x51fbc0=>_0x4e6841(0x178)+_0x1c8988+_0x4e6841(0x165)+_0x51fbc0+'\x20??\x20[])'};return{'type':_0x4e6841(0x178)+_0x1c8988+(_0x40707d?'?':'')+'>','typeTo':_0x523078=>_0x523078+_0x4e6841(0x186)+_0x4918b1('e')+_0x4e6841(0x181),'typeFrom':_0x339073=>'('+_0x339073+_0x4e6841(0x139)+_0x3a5e23('e')+_0x4e6841(0x140),'subLines':_0x3d80a2};}return console[_0x4e6841(0x15b)](_0x4e6841(0x13e)+_0x5276d4+_0x4e6841(0x162)),{'type':_0x4e6841(0x168),'typeTo':_0x1acf11=>_0x1acf11,'typeFrom':_0x4ec155=>_0x4ec155+_0x4e6841(0x128)};}function modelKeywordDefence(_0x4544aa){const _0x2b1963=a0_0x12dbfc;let _0x3692c7=[_0x2b1963(0x15a),'double',_0x2b1963(0x143),_0x2b1963(0x168),'bool','List','abstract','dynamic',_0x2b1963(0x174),_0x2b1963(0x132),'as',_0x2b1963(0x17b),'import',_0x2b1963(0x12b),_0x2b1963(0x154),_0x2b1963(0x179),'in',_0x2b1963(0x17f),_0x2b1963(0x13b),'export',_0x2b1963(0x137),_0x2b1963(0x15c),_0x2b1963(0x155),_0x2b1963(0x17c),'is',_0x2b1963(0x170),_0x2b1963(0x149),'external',_0x2b1963(0x14b),'this',_0x2b1963(0x161),_0x2b1963(0x144),_0x2b1963(0x16c),'throw',_0x2b1963(0x127),_0x2b1963(0x169),_0x2b1963(0x136),_0x2b1963(0x167),_0x2b1963(0x14c),_0x2b1963(0x16a),_0x2b1963(0x171),_0x2b1963(0x141),_0x2b1963(0x150),_0x2b1963(0x176),'on',_0x2b1963(0x146),_0x2b1963(0x133),_0x2b1963(0x172),'operator',_0x2b1963(0x175),'covariant',_0x2b1963(0x184),'part',_0x2b1963(0x13d),_0x2b1963(0x12f),'get',_0x2b1963(0x131),_0x2b1963(0x15f),_0x2b1963(0x129),'hide',_0x2b1963(0x12d),_0x2b1963(0x152),'do','if',_0x2b1963(0x177),_0x2b1963(0x12a)];if(_0x3692c7[_0x2b1963(0x183)](_0x4544aa)||/^\d/[_0x2b1963(0x182)](_0x4544aa))return'the'+(0x0,js_utils_plus_1['uppercaseFirst'])(_0x4544aa);return(0x0,js_utils_plus_1['snakeToCamel'])(_0x4544aa);}function jsonToDart(_0x1f298b,_0xe8d6fd,_0x5488a6){const _0x3edef0=a0_0x12dbfc;_0xe8d6fd=(0x0,js_utils_plus_1[_0x3edef0(0x180)])((0x0,js_utils_plus_1[_0x3edef0(0x157)])(_0xe8d6fd));let _0x5220ed=[],_0x1b0127=[],_0x5903df=[],_0x49731a=[],_0x4b02bc=[],_0x497793=[];_0x5220ed[_0x3edef0(0x159)](_0x3edef0(0x166)+_0xe8d6fd+'\x20{'),_0x5903df[_0x3edef0(0x159)]('\x20\x20'+_0xe8d6fd+_0x3edef0(0x148)),_0x49731a['push']('\x20\x20'+_0xe8d6fd+_0x3edef0(0x145)),_0x4b02bc[_0x3edef0(0x159)](_0x3edef0(0x17d));for(const [_0x5576c8,_0x19fcfc]of Object[_0x3edef0(0x173)](_0x1f298b)){let _0x395eb7='\x27'+_0x5576c8+'\x27',_0x1ef5fc=modelKeywordDefence(_0x5576c8);const _0x5ebaca=''+_0xe8d6fd+(0x0,js_utils_plus_1[_0x3edef0(0x180)])((0x0,js_utils_plus_1[_0x3edef0(0x157)])(_0x5576c8)),{type:_0x352abf,typeTo:_0x372307,typeFrom:_0x45fb4f,subLines:_0x538098}=modelTypeGenerator(_0x19fcfc,_0x5ebaca,_0x5488a6);if(_0x538098)_0x497793['push'](_0x538098);_0x5903df['push']('\x20\x20\x20\x20this.'+_0x1ef5fc+',\x0a'),_0x1b0127['push']('\x20\x20'+_0x352abf+(_0x5488a6?'?':'')+'\x20'+_0x1ef5fc+';\x0a'),_0x49731a['push'](_0x3edef0(0x17e)+_0x1ef5fc+'\x20=\x20'+_0x45fb4f(_0x3edef0(0x153)+_0x395eb7+']')+';\x0a'),_0x4b02bc[_0x3edef0(0x159)](_0x3edef0(0x156)+_0x395eb7+':\x20'+_0x372307(_0x1ef5fc)+',\x0a');}return _0x5903df['push'](_0x3edef0(0x163)),_0x49731a['push'](_0x3edef0(0x138)),_0x4b02bc[_0x3edef0(0x159)]('\x20\x20\x20\x20\x20\x20};'),_0x5220ed[_0x3edef0(0x159)](_0x1b0127[_0x3edef0(0x15e)]('')),_0x5220ed[_0x3edef0(0x159)](_0x5903df['join']('')),_0x5220ed[_0x3edef0(0x159)](_0x49731a['join']('')),_0x5220ed[_0x3edef0(0x159)](_0x4b02bc[_0x3edef0(0x15e)]('')),_0x5220ed[_0x3edef0(0x159)]('}\x0a'),_0x5220ed[_0x3edef0(0x159)](_0x497793[_0x3edef0(0x15e)]('')),_0x5220ed[_0x3edef0(0x15e)]('\x0d\x0a');}
1
+ 'use strict';function a0_0xe4cb(){const _0xbe97ed=['isNumber','isString','1368sYWbWl','assert','isArray','push','bool','extends','.fromJson(Map<String,\x20dynamic>\x20json)\x20{\x0a','.fromJson(','includes','num','operator','test','double.tryParse(','\x20!=\x20null\x20?\x20','part','json[','?.toString()\x20??\x20\x27\x27)','9664ucyviH','670368bNThta','return','169206gnUcEd','var','async','?.toString()','the','await','469hvtHAm','\x20\x20\x20\x20this.','rethrow','>.from(','\x20as\x20List<dynamic>)?.map((e)\x20=>\x20','finally','\x20\x20}','class\x20','\x20\x20Map<String,\x20dynamic>\x20toJson()\x20=>\x20{\x0a','set','isBoolean','show','44JJtsfT','implements','({\x0a','get','while','interface','yield','?.map((e)\x20=>\x20','export','final','String','\x20\x20});','double','log','WARNING\x20:\x20','222840HPiFhD','int','static','deferred','mixin','5vLSAzf','\x20\x20\x20\x20','entries','class','external','__esModule','6cesMsF','\x20has\x20Property\x20is\x20null,which\x20will\x20be\x20treated\x20as\x20String\x20type','14330pMFnfQ','import','break','super','join',')\x20:\x20null','List<','abstract','sync','const','uppercaseFirst','Function','covariant','520092KGGXWC','case','else','\x20\x20\x20\x20\x20\x20};','catch','factory','List','snakeToCamel','void','172641bCkKVf','isInt','isObject','jsonToDart'];a0_0xe4cb=function(){return _0xbe97ed;};return a0_0xe4cb();}const a0_0x130589=a0_0xf6d0;(function(_0x58f418,_0x108b81){const _0x39ce3d=a0_0xf6d0,_0x531330=_0x58f418();while(!![]){try{const _0x59b940=parseInt(_0x39ce3d(0xc4))/0x1+parseInt(_0x39ce3d(0xac))/0x2*(-parseInt(_0x39ce3d(0xa1))/0x3)+-parseInt(_0x39ce3d(0x7e))/0x4+-parseInt(_0x39ce3d(0xa6))/0x5*(-parseInt(_0x39ce3d(0x80))/0x6)+parseInt(_0x39ce3d(0x86))/0x7*(-parseInt(_0x39ce3d(0x7d))/0x8)+parseInt(_0x39ce3d(0x6c))/0x9*(parseInt(_0x39ce3d(0xae))/0xa)+-parseInt(_0x39ce3d(0x92))/0xb*(-parseInt(_0x39ce3d(0xbb))/0xc);if(_0x59b940===_0x108b81)break;else _0x531330['push'](_0x531330['shift']());}catch(_0x2f73be){_0x531330['push'](_0x531330['shift']());}}}(a0_0xe4cb,0x1d74e));Object['defineProperty'](exports,a0_0x130589(0xab),{'value':!![]}),exports[a0_0x130589(0x69)]=jsonToDart;function a0_0xf6d0(_0x124080,_0x488c14){const _0xe4cb6d=a0_0xe4cb();return a0_0xf6d0=function(_0xf6d084,_0x4441e3){_0xf6d084=_0xf6d084-0x67;let _0x1ba953=_0xe4cb6d[_0xf6d084];return _0x1ba953;},a0_0xf6d0(_0x124080,_0x488c14);}const js_utils_plus_1=require('js-utils-plus');function modelTypeGenerator(_0x1846ee,_0x4fae06,_0x431f7a){const _0x1c6c3b=a0_0x130589;if((0x0,js_utils_plus_1[_0x1c6c3b(0x90)])(_0x1846ee))return{'type':_0x1c6c3b(0x70),'typeTo':_0x3b5145=>_0x3b5145,'typeFrom':_0x43fd96=>''+_0x43fd96};if((0x0,js_utils_plus_1[_0x1c6c3b(0x6b)])(_0x1846ee))return{'type':'String','typeTo':_0x1d9fd3=>_0x1d9fd3,'typeFrom':_0x6d4c26=>_0x6d4c26+'?.toString()'};if((0x0,js_utils_plus_1[_0x1c6c3b(0x6a)])(_0x1846ee))return(0x0,js_utils_plus_1[_0x1c6c3b(0x67)])(_0x1846ee)?{'type':_0x1c6c3b(0xa2),'typeTo':_0x58f3e5=>_0x58f3e5,'typeFrom':_0x4f6e68=>'int.tryParse('+_0x4f6e68+_0x1c6c3b(0x7c)}:{'type':'double','typeTo':_0x2c3efb=>_0x2c3efb,'typeFrom':_0xc16f3c=>_0x1c6c3b(0x78)+_0xc16f3c+_0x1c6c3b(0x7c)};if((0x0,js_utils_plus_1[_0x1c6c3b(0x68)])(_0x1846ee))return{'type':_0x4fae06,'typeTo':_0x85503b=>_0x85503b+'?.toJson()','typeFrom':_0xe3ac11=>_0xe3ac11+_0x1c6c3b(0x79)+_0x4fae06+_0x1c6c3b(0x73)+_0xe3ac11+_0x1c6c3b(0xb3),'subLines':jsonToDart(_0x1846ee,_0x4fae06,_0x431f7a)};if((0x0,js_utils_plus_1[_0x1c6c3b(0x6e)])(_0x1846ee)){const _0x186778=_0x1846ee[0x0];if(!_0x186778)console[_0x1c6c3b(0x9f)](_0x1c6c3b(0xa0)+_0x4fae06+'\x20has\x20Property\x20is\x20null,which\x20will\x20be\x20treated\x20as\x20String\x20type');const {type:_0x149469,typeTo:_0x363521,typeFrom:_0x411aaf,subLines:_0x453370}=modelTypeGenerator(_0x186778||'',_0x4fae06,_0x431f7a);if([_0x1c6c3b(0x70),_0x1c6c3b(0x9c),_0x1c6c3b(0xa2),_0x1c6c3b(0x9e)][_0x1c6c3b(0x74)](_0x149469))return{'type':_0x1c6c3b(0xb4)+_0x149469+(_0x431f7a?'?':'')+'>','typeTo':_0x3e3bcb=>_0x3e3bcb,'typeFrom':_0x25a933=>_0x1c6c3b(0xb4)+_0x149469+_0x1c6c3b(0x89)+_0x25a933+'\x20??\x20[])'};return{'type':_0x1c6c3b(0xb4)+_0x149469+(_0x431f7a?'?':'')+'>','typeTo':_0x594f21=>_0x594f21+_0x1c6c3b(0x99)+_0x363521('e')+')?.toList()','typeFrom':_0x4a0216=>'('+_0x4a0216+_0x1c6c3b(0x8a)+_0x411aaf('e')+'\x20)?.toList()','subLines':_0x453370};}return console[_0x1c6c3b(0x9f)](_0x1c6c3b(0xa0)+_0x4fae06+_0x1c6c3b(0xad)),{'type':'String','typeTo':_0x2385f6=>_0x2385f6,'typeFrom':_0x3719c7=>_0x3719c7+_0x1c6c3b(0x83)};}function modelKeywordDefence(_0x1d24d0){const _0x1b9e16=a0_0x130589;let _0x25fe6b=[_0x1b9e16(0x75),_0x1b9e16(0x9e),_0x1b9e16(0xa2),_0x1b9e16(0x9c),_0x1b9e16(0x70),_0x1b9e16(0xc1),_0x1b9e16(0xb5),'dynamic',_0x1b9e16(0x93),_0x1b9e16(0x91),'as',_0x1b9e16(0xbd),_0x1b9e16(0xaf),_0x1b9e16(0xa3),_0x1b9e16(0x6d),'enum','in',_0x1b9e16(0xb1),_0x1b9e16(0x82),_0x1b9e16(0x9a),_0x1b9e16(0x97),'switch',_0x1b9e16(0x85),_0x1b9e16(0x71),'is',_0x1b9e16(0xb6),_0x1b9e16(0xb0),_0x1b9e16(0xaa),'library','this',_0x1b9e16(0xbc),_0x1b9e16(0xc0),_0x1b9e16(0xa5),'throw',_0x1b9e16(0xbf),'false','new','true',_0x1b9e16(0xa9),_0x1b9e16(0x9b),'null','try',_0x1b9e16(0xb7),_0x1b9e16(0x8b),'on','typedef','continue','for',_0x1b9e16(0x76),_0x1b9e16(0x81),_0x1b9e16(0xba),_0x1b9e16(0xb9),_0x1b9e16(0x7a),_0x1b9e16(0xc3),'default',_0x1b9e16(0x95),_0x1b9e16(0x88),_0x1b9e16(0x96),_0x1b9e16(0xa4),'hide',_0x1b9e16(0x7f),'with','do','if',_0x1b9e16(0x8f),_0x1b9e16(0x98)];if(_0x25fe6b[_0x1b9e16(0x74)](_0x1d24d0)||/^\d/[_0x1b9e16(0x77)](_0x1d24d0))return _0x1b9e16(0x84)+(0x0,js_utils_plus_1['uppercaseFirst'])(_0x1d24d0);return(0x0,js_utils_plus_1[_0x1b9e16(0xc2)])(_0x1d24d0);}function jsonToDart(_0x40d55c,_0x3135d2,_0x169ecf){const _0x51c62c=a0_0x130589;_0x3135d2=(0x0,js_utils_plus_1[_0x51c62c(0xb8)])((0x0,js_utils_plus_1['snakeToCamel'])(_0x3135d2));let _0x3c896f=[],_0x53dd90=[],_0x4434d9=[],_0x2adc5a=[],_0x1feaee=[],_0x380f11=[];_0x3c896f[_0x51c62c(0x6f)](_0x51c62c(0x8d)+_0x3135d2+'\x20{'),_0x4434d9[_0x51c62c(0x6f)]('\x20\x20'+_0x3135d2+_0x51c62c(0x94)),_0x2adc5a[_0x51c62c(0x6f)]('\x20\x20'+_0x3135d2+_0x51c62c(0x72)),_0x1feaee['push'](_0x51c62c(0x8e));for(const [_0x42a249,_0x276f14]of Object[_0x51c62c(0xa8)](_0x40d55c)){let _0x5f2750='\x27'+_0x42a249+'\x27',_0x3c009d=modelKeywordDefence(_0x42a249);const _0x32a18f=''+_0x3135d2+(0x0,js_utils_plus_1[_0x51c62c(0xb8)])((0x0,js_utils_plus_1[_0x51c62c(0xc2)])(_0x42a249)),{type:_0x582b50,typeTo:_0x8d0409,typeFrom:_0x32c396,subLines:_0x72a150}=modelTypeGenerator(_0x276f14,_0x32a18f,_0x169ecf);if(_0x72a150)_0x380f11[_0x51c62c(0x6f)](_0x72a150);_0x4434d9[_0x51c62c(0x6f)](_0x51c62c(0x87)+_0x3c009d+',\x0a'),_0x53dd90['push']('\x20\x20'+_0x582b50+(_0x169ecf?'?':'')+'\x20'+_0x3c009d+';\x0a'),_0x2adc5a[_0x51c62c(0x6f)](_0x51c62c(0xa7)+_0x3c009d+'\x20=\x20'+_0x32c396(_0x51c62c(0x7b)+_0x5f2750+']')+';\x0a'),_0x1feaee[_0x51c62c(0x6f)]('\x20\x20\x20\x20\x20\x20\x20\x20'+_0x5f2750+':\x20'+_0x8d0409(_0x3c009d)+',\x0a');}return _0x4434d9[_0x51c62c(0x6f)](_0x51c62c(0x9d)),_0x2adc5a[_0x51c62c(0x6f)](_0x51c62c(0x8c)),_0x1feaee[_0x51c62c(0x6f)](_0x51c62c(0xbe)),_0x3c896f['push'](_0x53dd90[_0x51c62c(0xb2)]('')),_0x3c896f[_0x51c62c(0x6f)](_0x4434d9[_0x51c62c(0xb2)]('')),_0x3c896f[_0x51c62c(0x6f)](_0x2adc5a[_0x51c62c(0xb2)]('')),_0x3c896f[_0x51c62c(0x6f)](_0x1feaee[_0x51c62c(0xb2)]('')),_0x3c896f['push']('}\x0a'),_0x3c896f[_0x51c62c(0x6f)](_0x380f11[_0x51c62c(0xb2)]('')),_0x3c896f[_0x51c62c(0xb2)]('\x0d\x0a');}
package/main/index.js CHANGED
@@ -1 +1 @@
1
- 'use strict';const a1_0x45525b=a1_0x1e94;function a1_0x1e94(_0x2732ac,_0x85edc8){const _0x14c271=a1_0x14c2();return a1_0x1e94=function(_0x1e9416,_0x2ccc49){_0x1e9416=_0x1e9416-0xd1;let _0x170b0a=_0x14c271[_0x1e9416];return _0x170b0a;},a1_0x1e94(_0x2732ac,_0x85edc8);}(function(_0x2ff6c7,_0x569ad3){const _0x90765a=a1_0x1e94,_0x7bda4=_0x2ff6c7();while(!![]){try{const _0x1b9e42=-parseInt(_0x90765a(0xe4))/0x1*(parseInt(_0x90765a(0xf7))/0x2)+parseInt(_0x90765a(0xfa))/0x3*(parseInt(_0x90765a(0xeb))/0x4)+parseInt(_0x90765a(0xf4))/0x5*(-parseInt(_0x90765a(0xd2))/0x6)+-parseInt(_0x90765a(0xe6))/0x7+-parseInt(_0x90765a(0xe7))/0x8*(parseInt(_0x90765a(0xe0))/0x9)+-parseInt(_0x90765a(0xd9))/0xa+parseInt(_0x90765a(0xf2))/0xb;if(_0x1b9e42===_0x569ad3)break;else _0x7bda4['push'](_0x7bda4['shift']());}catch(_0x3f0943){_0x7bda4['push'](_0x7bda4['shift']());}}}(a1_0x14c2,0xe1a94));function a1_0x14c2(){const _0x456b4a=['option','jsonToDart','json文件夹路径','5652130QQXCZc','writeFile','default','js-utils-plus','--nullsafety','cwd','__importDefault','172647RHSLRK','-\x20执行文件:','__esModule','name','2393gcFBYs','-d,\x20--dir\x20<dir>','8249857HKOwwX','40bTuVmZ','log','defineProperty','readFile','69108XVGstM','readDirFiles','parse','启用空安全','forEach','join','opts','61695271poDvfi','/lib/models/','7375055pBhChn','输出序列化模型路径,\x20默认lib/models','dir','1318ztbKHJ','requiredOption','json','36uKgQNz','需要排除的文件,可指定多个','6HrtIwG','excludes','-o,\x20--output\x20<dir>','.dart'];a1_0x14c2=function(){return _0x456b4a;};return a1_0x14c2();}var __importDefault=this&&this[a1_0x45525b(0xdf)]||function(_0x18d274){const _0x1bb767=a1_0x45525b;return _0x18d274&&_0x18d274[_0x1bb767(0xe2)]?_0x18d274:{'default':_0x18d274};};Object[a1_0x45525b(0xe9)](exports,a1_0x45525b(0xe2),{'value':!![]});const json2dart_1=require('./core/json2dart'),js_utils_plus_1=require(a1_0x45525b(0xdc)),commander_1=require('commander'),path_1=__importDefault(require('path')),program=new commander_1['Command'](),_path=process[a1_0x45525b(0xde)]();program[a1_0x45525b(0xf8)](a1_0x45525b(0xe5),a1_0x45525b(0xd8))[a1_0x45525b(0xd6)](a1_0x45525b(0xd4),a1_0x45525b(0xf5))[a1_0x45525b(0xd6)]('-e,\x20--excludes\x20<value...>',a1_0x45525b(0xd1))[a1_0x45525b(0xd6)](a1_0x45525b(0xdd),a1_0x45525b(0xee)),program[a1_0x45525b(0xed)]();const options=program[a1_0x45525b(0xf1)]();function run(){const _0x101ba8=a1_0x45525b,_0x2b02c0=path_1['default'][_0x101ba8(0xf0)](_path,options[_0x101ba8(0xf6)]),_0x1e9bbd=(0x0,js_utils_plus_1[_0x101ba8(0xec)])(_0x2b02c0,_0x101ba8(0xf9),options[_0x101ba8(0xd3)]||[]);console[_0x101ba8(0xe8)](new Array(0x50)[_0x101ba8(0xf0)]('-')),_0x1e9bbd[_0x101ba8(0xef)](function(_0x5bcf3){const _0xe8e732=_0x101ba8,_0x4f763d=(0x0,js_utils_plus_1[_0xe8e732(0xea)])(_0x5bcf3);if(!_0x4f763d||!(0x0,js_utils_plus_1['isJsonString'])(_0x4f763d)){console['error'](_0xe8e732(0xe1)+_0x5bcf3);return;}console[_0xe8e732(0xe8)](_0xe8e732(0xe1)+_0x5bcf3);const _0x435b7f=JSON[_0xe8e732(0xed)](_0x4f763d),_0xc7248e=path_1[_0xe8e732(0xdb)][_0xe8e732(0xed)](_0x5bcf3),_0x52d160=(0x0,json2dart_1[_0xe8e732(0xd7)])(_0x435b7f,_0xc7248e[_0xe8e732(0xe3)],options['nullsafety']),_0x1422aa=path_1[_0xe8e732(0xdb)][_0xe8e732(0xf0)](_path,options['output']||_0xe8e732(0xf3),_0xc7248e[_0xe8e732(0xe3)]+_0xe8e732(0xd5));(0x0,js_utils_plus_1[_0xe8e732(0xda)])(_0x1422aa,_0x52d160);});}run();
1
+ 'use strict';const a1_0x2f0332=a1_0x5a42;(function(_0x3e262b,_0x5459c1){const _0x4a4ff7=a1_0x5a42,_0xe06a96=_0x3e262b();while(!![]){try{const _0x4693ae=-parseInt(_0x4a4ff7(0x146))/0x1+parseInt(_0x4a4ff7(0x147))/0x2*(parseInt(_0x4a4ff7(0x132))/0x3)+parseInt(_0x4a4ff7(0x14d))/0x4+-parseInt(_0x4a4ff7(0x148))/0x5*(-parseInt(_0x4a4ff7(0x154))/0x6)+parseInt(_0x4a4ff7(0x14a))/0x7*(parseInt(_0x4a4ff7(0x13a))/0x8)+parseInt(_0x4a4ff7(0x151))/0x9+-parseInt(_0x4a4ff7(0x138))/0xa;if(_0x4693ae===_0x5459c1)break;else _0xe06a96['push'](_0xe06a96['shift']());}catch(_0x100360){_0xe06a96['push'](_0xe06a96['shift']());}}}(a1_0x4d4e,0x710b4));function a1_0x5a42(_0x36f8e0,_0x5c9bfd){const _0x4d4e2c=a1_0x4d4e();return a1_0x5a42=function(_0x5a4214,_0x201f74){_0x5a4214=_0x5a4214-0x12d;let _0x1d9153=_0x4d4e2c[_0x5a4214];return _0x1d9153;},a1_0x5a42(_0x36f8e0,_0x5c9bfd);}function a1_0x4d4e(){const _0x415de8=['11323160Haxork','jsonToDart','45200jApStx','output','default','commander','json','-e,\x20--excludes\x20<value...>','writeFile','requiredOption','isJsonString','./core/json2dart','path','readDirFiles','438726RWaRpH','2lTuogY','1774170ctpdxL','join','651VDJuFZ','option','--nullsafety','1102384tLwRwj','.dart','nullsafety','输出序列化模型路径,\x20默认lib/models','2907504UQTJzU','-o,\x20--output\x20<dir>','name','6VTqShO','启用空安全','json文件夹路径','dir','js-utils-plus','error','parse','1665402jKDzQe','-\x20执行文件:','forEach','__esModule','-d,\x20--dir\x20<dir>','log'];a1_0x4d4e=function(){return _0x415de8;};return a1_0x4d4e();}var __importDefault=this&&this['__importDefault']||function(_0x2835c2){const _0x780284=a1_0x5a42;return _0x2835c2&&_0x2835c2[_0x780284(0x135)]?_0x2835c2:{'default':_0x2835c2};};Object['defineProperty'](exports,a1_0x2f0332(0x135),{'value':!![]});const json2dart_1=require(a1_0x2f0332(0x143)),js_utils_plus_1=require(a1_0x2f0332(0x12f)),commander_1=require(a1_0x2f0332(0x13d)),path_1=__importDefault(require(a1_0x2f0332(0x144))),program=new commander_1['Command'](),_path=process['cwd']();program[a1_0x2f0332(0x141)](a1_0x2f0332(0x136),a1_0x2f0332(0x12d))[a1_0x2f0332(0x14b)](a1_0x2f0332(0x152),a1_0x2f0332(0x150))[a1_0x2f0332(0x14b)](a1_0x2f0332(0x13f),'需要排除的文件,可指定多个')[a1_0x2f0332(0x14b)](a1_0x2f0332(0x14c),a1_0x2f0332(0x155)),program[a1_0x2f0332(0x131)]();const options=program['opts']();function run(){const _0x54a0f0=a1_0x2f0332,_0x17cac8=path_1[_0x54a0f0(0x13c)][_0x54a0f0(0x149)](_path,options[_0x54a0f0(0x12e)]),_0x1cd629=(0x0,js_utils_plus_1[_0x54a0f0(0x145)])(_0x17cac8,_0x54a0f0(0x13e),options['excludes']||[]);console[_0x54a0f0(0x137)](new Array(0x50)[_0x54a0f0(0x149)]('-')),_0x1cd629[_0x54a0f0(0x134)](function(_0x3e6aa6){const _0x406934=_0x54a0f0,_0xfbce60=(0x0,js_utils_plus_1['readFile'])(_0x3e6aa6);if(!_0xfbce60||!(0x0,js_utils_plus_1[_0x406934(0x142)])(_0xfbce60)){console[_0x406934(0x130)](_0x406934(0x133)+_0x3e6aa6);return;}console[_0x406934(0x137)]('-\x20执行文件:'+_0x3e6aa6);const _0x4312eb=JSON['parse'](_0xfbce60),_0x5b3753=path_1[_0x406934(0x13c)][_0x406934(0x131)](_0x3e6aa6),_0x17305b=(0x0,json2dart_1[_0x406934(0x139)])(_0x4312eb,_0x5b3753['name'],options[_0x406934(0x14f)]),_0x2e8d7f=path_1[_0x406934(0x13c)][_0x406934(0x149)](_path,options[_0x406934(0x13b)]||'/lib/models/',_0x5b3753[_0x406934(0x153)]+_0x406934(0x14e));(0x0,js_utils_plus_1[_0x406934(0x140)])(_0x2e8d7f,_0x17305b);});}run();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "json2dart-generator",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "json to dart model generator",
5
5
  "main": "main/index.js",
6
6
  "bin": {