json2dart-generator 0.0.6 → 0.2.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/LICENSE +21 -127
- package/README.md +7 -7
- package/dist/core/json2dart.d.ts +1 -0
- package/dist/core/json2dart.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/package.json +18 -17
- package/main/core/json2dart.js +0 -1
- package/main/index.js +0 -1
package/LICENSE
CHANGED
|
@@ -1,127 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可以复制、使用、修改、分发其“贡献”,不论修改与否。
|
|
24
|
-
|
|
25
|
-
2. 授予专利许可
|
|
26
|
-
|
|
27
|
-
每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定撤销除外)专利许可,供您制造、委托制造、使用、许诺销售、销售、进口其“贡献”或以其他方式转移其“贡献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”本身或其“贡献”与许可“贡献”时的“软件”结合而将必然会侵犯的专利权利要求,不包括对“贡献”的修改或包含“贡献”的其他结合。如果您或您的“关联实体”直接或间接地,就“软件”或其中的“贡献”对任何人发起专利侵权诉讼(包括反诉或交叉诉讼)或其他专利维权行动,指控其侵犯专利权,则“本许可证”授予您对“软件”的专利许可自您提起诉讼或发起维权行动之日终止。
|
|
28
|
-
|
|
29
|
-
3. 无商标许可
|
|
30
|
-
|
|
31
|
-
“本许可证”不提供对“贡献者”的商品名称、商标、服务标志或产品名称的商标许可,但您为满足第4条规定的声明义务而必须使用除外。
|
|
32
|
-
|
|
33
|
-
4. 分发限制
|
|
34
|
-
|
|
35
|
-
您可以在任何媒介中将“软件”以源程序形式或可执行形式重新分发,不论修改与否,但您必须向接收者提供“本许可证”的副本,并保留“软件”中的版权、商标、专利及免责声明。
|
|
36
|
-
|
|
37
|
-
5. 免责声明与责任限制
|
|
38
|
-
|
|
39
|
-
“软件”及其中的“贡献”在提供时不带任何明示或默示的担保。在任何情况下,“贡献者”或版权所有者不对任何人因使用“软件”或其中的“贡献”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于何种法律理论,即使其曾被建议有此种损失的可能性。
|
|
40
|
-
|
|
41
|
-
6. 语言
|
|
42
|
-
“本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何冲突不一致,以中文版为准。
|
|
43
|
-
|
|
44
|
-
条款结束
|
|
45
|
-
|
|
46
|
-
如何将木兰宽松许可证,第2版,应用到您的软件
|
|
47
|
-
|
|
48
|
-
如果您希望将木兰宽松许可证,第2版,应用到您的新软件,为了方便接收者查阅,建议您完成如下三步:
|
|
49
|
-
|
|
50
|
-
1, 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字;
|
|
51
|
-
|
|
52
|
-
2, 请您在软件包的一级目录下创建以“LICENSE”为名的文件,将整个许可证文本放入该文件中;
|
|
53
|
-
|
|
54
|
-
3, 请将如下声明文本放入每个源文件的头部注释中。
|
|
55
|
-
|
|
56
|
-
Copyright (c) [Year] [name of copyright holder]
|
|
57
|
-
[Software Name] is licensed under Mulan PSL v2.
|
|
58
|
-
You can use this software according to the terms and conditions of the Mulan PSL v2.
|
|
59
|
-
You may obtain a copy of Mulan PSL v2 at:
|
|
60
|
-
http://license.coscl.org.cn/MulanPSL2
|
|
61
|
-
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
|
62
|
-
See the Mulan PSL v2 for more details.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
Mulan Permissive Software License,Version 2
|
|
66
|
-
|
|
67
|
-
Mulan Permissive Software License,Version 2 (Mulan PSL v2)
|
|
68
|
-
January 2020 http://license.coscl.org.cn/MulanPSL2
|
|
69
|
-
|
|
70
|
-
Your reproduction, use, modification and distribution of the Software shall be subject to Mulan PSL v2 (this License) with the following terms and conditions:
|
|
71
|
-
|
|
72
|
-
0. Definition
|
|
73
|
-
|
|
74
|
-
Software means the program and related documents which are licensed under this License and comprise all Contribution(s).
|
|
75
|
-
|
|
76
|
-
Contribution means the copyrightable work licensed by a particular Contributor under this License.
|
|
77
|
-
|
|
78
|
-
Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License.
|
|
79
|
-
|
|
80
|
-
Legal Entity means the entity making a Contribution and all its Affiliates.
|
|
81
|
-
|
|
82
|
-
Affiliates means entities that control, are controlled by, or are under common control with the acting entity under this License, ‘control’ means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity.
|
|
83
|
-
|
|
84
|
-
1. Grant of Copyright License
|
|
85
|
-
|
|
86
|
-
Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or distribute its Contribution, with modification or not.
|
|
87
|
-
|
|
88
|
-
2. Grant of Patent License
|
|
89
|
-
|
|
90
|
-
Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to make, have made, use, offer for sale, sell, import or otherwise transfer its Contribution, where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, or by combination of the Contribution with the Software to which the Contribution was contributed. The patent license shall not apply to any modification of the Contribution, and any other combination which includes the Contribution. If you or your Affiliates directly or indirectly institute patent litigation (including a cross claim or counterclaim in a litigation) or other patent enforcement activities against any individual or entity by alleging that the Software or any Contribution in it infringes patents, then any patent license granted to you under this License for the Software shall terminate as of the date such litigation or activity is filed or taken.
|
|
91
|
-
|
|
92
|
-
3. No Trademark License
|
|
93
|
-
|
|
94
|
-
No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements in Section 4.
|
|
95
|
-
|
|
96
|
-
4. Distribution Restriction
|
|
97
|
-
|
|
98
|
-
You may distribute the Software in any medium with or without modification, whether in source or executable forms, provided that you provide recipients with a copy of this License and retain copyright, patent, trademark and disclaimer statements in the Software.
|
|
99
|
-
|
|
100
|
-
5. Disclaimer of Warranty and Limitation of Liability
|
|
101
|
-
|
|
102
|
-
THE SOFTWARE AND CONTRIBUTION IN IT ARE PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE OR THE CONTRIBUTION IN IT, NO MATTER HOW IT’S CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
103
|
-
|
|
104
|
-
6. Language
|
|
105
|
-
|
|
106
|
-
THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION SHALL PREVAIL.
|
|
107
|
-
|
|
108
|
-
END OF THE TERMS AND CONDITIONS
|
|
109
|
-
|
|
110
|
-
How to Apply the Mulan Permissive Software License,Version 2 (Mulan PSL v2) to Your Software
|
|
111
|
-
|
|
112
|
-
To apply the Mulan PSL v2 to your work, for easy identification by recipients, you are suggested to complete following three steps:
|
|
113
|
-
|
|
114
|
-
i Fill in the blanks in following statement, including insert your software name, the year of the first publication of your software, and your name identified as the copyright owner;
|
|
115
|
-
|
|
116
|
-
ii Create a file named “LICENSE” which contains the whole context of this License in the first directory of your software package;
|
|
117
|
-
|
|
118
|
-
iii Attach the statement to the appropriate annotated syntax at the beginning of each source file.
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
Copyright (c) [Year] [name of copyright holder]
|
|
122
|
-
[Software Name] is licensed under Mulan PSL v2.
|
|
123
|
-
You can use this software according to the terms and conditions of the Mulan PSL v2.
|
|
124
|
-
You may obtain a copy of Mulan PSL v2 at:
|
|
125
|
-
http://license.coscl.org.cn/MulanPSL2
|
|
126
|
-
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
|
127
|
-
See the Mulan PSL v2 for more details.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025, Evan(埃文)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -16,17 +16,17 @@ npm install json2dart-generator -g
|
|
|
16
16
|
json2dart options
|
|
17
17
|
|
|
18
18
|
Options:
|
|
19
|
-
-d, --dir <dir> json文件夹路径,默认 json_models
|
|
19
|
+
-d, --dir <dir> json文件夹路径,默认 .json_models/
|
|
20
20
|
-o, --output <dir> dart模型输出路径,默认 lib/models
|
|
21
|
-
-s, --suffix <value> 自定义dart
|
|
22
|
-
-e, --excludes <value...>
|
|
23
|
-
--numparse
|
|
21
|
+
-s, --suffix <value> 自定义dart模型类名后缀,默认 Entity
|
|
22
|
+
-e, --excludes <value...> 需要排除的文件或文件夹,可指定多个文件
|
|
23
|
+
--numparse 使用num数据类型而不是double/int
|
|
24
24
|
--nullsafety 是否启用空安全
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
- 备注:
|
|
28
|
-
-
|
|
29
|
-
-
|
|
28
|
+
- 默认`json`的文件名为模型类名,也可通过键`__className`指定类名。
|
|
29
|
+
- 类和属性名称自动蛇形转驼峰,当属性名为`dart关键字`时将在名称前面加`the`。
|
|
30
30
|
- 当`json`的值类型不存在或空时,自动默认处理为`String`类型并控制台输出警告。
|
|
31
31
|
|
|
32
32
|
- 帮助文档
|
|
@@ -38,7 +38,7 @@ json2dart --help
|
|
|
38
38
|
- 执行命令
|
|
39
39
|
|
|
40
40
|
```bash
|
|
41
|
-
json2dart --dir
|
|
41
|
+
json2dart --dir .json_models -o lib/models --nullsafety
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
### 示例
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function jsonToDart(value: any, className: string, nullSafety: boolean, numparse: boolean): string;
|
|
@@ -0,0 +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();}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
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();
|
package/package.json
CHANGED
|
@@ -1,38 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "json2dart-generator",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "json to dart model generator",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"json2dart": "
|
|
7
|
+
"json2dart": "dist/index.js"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
|
-
"test": "tsc --module commonjs && node dist/index.js -d ./json_models -o ./models -s Entity --nullsafety --numparse",
|
|
11
10
|
"dev": "tsc -w",
|
|
12
|
-
"
|
|
11
|
+
"test": "tsc && node dist/index.js -d ./.json_models -o ./models -s Entity --nullsafety --numparse",
|
|
12
|
+
"build": "rimraf dist && tsc && javascript-obfuscator dist --output dist"
|
|
13
13
|
},
|
|
14
|
+
"author": "evan.lin",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"private": false,
|
|
14
17
|
"repository": {
|
|
15
18
|
"type": "git",
|
|
16
19
|
"url": ""
|
|
17
20
|
},
|
|
18
21
|
"keywords": [
|
|
19
22
|
"json2dart-generator",
|
|
20
|
-
"
|
|
23
|
+
"json2dart"
|
|
21
24
|
],
|
|
22
|
-
"author": "evan.lin",
|
|
23
|
-
"license": "ISC",
|
|
24
|
-
"private": false,
|
|
25
25
|
"files": [
|
|
26
|
-
"
|
|
26
|
+
"dist/*",
|
|
27
|
+
"README.md"
|
|
27
28
|
],
|
|
28
|
-
"devDependencies": {
|
|
29
|
-
"@types/node": "^20.19.18",
|
|
30
|
-
"javascript-obfuscator": "^4.1.0",
|
|
31
|
-
"rimraf": "^6.0.1",
|
|
32
|
-
"typescript": "^5.4.5"
|
|
33
|
-
},
|
|
34
29
|
"dependencies": {
|
|
35
30
|
"commander": "^14.0.1",
|
|
36
|
-
"js-utils-plus": "^1.
|
|
31
|
+
"js-utils-plus": "^1.5.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/node": "^20.19.18",
|
|
35
|
+
"javascript-obfuscator": "^5.4.2",
|
|
36
|
+
"typescript": "^5.4.5",
|
|
37
|
+
"rimraf": "^6.0.1"
|
|
37
38
|
}
|
|
38
39
|
}
|
package/main/core/json2dart.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';const a0_0x52467b=a0_0x4acb;(function(_0x1c83f7,_0x1e4c55){const _0x3ff0b9=a0_0x4acb,_0xc11cc2=_0x1c83f7();while(!![]){try{const _0x86e999=-parseInt(_0x3ff0b9(0x161))/0x1+-parseInt(_0x3ff0b9(0x14f))/0x2*(-parseInt(_0x3ff0b9(0x152))/0x3)+-parseInt(_0x3ff0b9(0x126))/0x4+-parseInt(_0x3ff0b9(0x147))/0x5*(parseInt(_0x3ff0b9(0x14e))/0x6)+parseInt(_0x3ff0b9(0x159))/0x7+-parseInt(_0x3ff0b9(0x15e))/0x8+-parseInt(_0x3ff0b9(0x148))/0x9*(-parseInt(_0x3ff0b9(0x104))/0xa);if(_0x86e999===_0x1e4c55)break;else _0xc11cc2['push'](_0xc11cc2['shift']());}catch(_0x39b040){_0xc11cc2['push'](_0xc11cc2['shift']());}}}(a0_0x4cee,0x986fd));function a0_0x4acb(_0x5db2ce,_0x493dc5){const _0x4cee00=a0_0x4cee();return a0_0x4acb=function(_0x4acb32,_0x2de336){_0x4acb32=_0x4acb32-0x100;let _0x4b0c69=_0x4cee00[_0x4acb32];return _0x4b0c69;},a0_0x4acb(_0x5db2ce,_0x493dc5);}Object[a0_0x52467b(0x13b)](exports,a0_0x52467b(0x128),{'value':!![]}),exports['jsonToDart']=jsonToDart;const js_utils_plus_1=require('js-utils-plus');function a0_0x4cee(){const _0x538fa8=['push','int.tryParse(',')?.toList()','library','\x20is\x20List)\x20?\x20','get','json[','-\x20警告!:','uppercaseFirst','import','sync','false','?.toJson()','try','defineProperty','set','?.map((e)\x20=>\x20','typedef','continue','rethrow','break','while','class','switch','new','\x20\x20}','50UbCflv','27zzESxS','default','double','isArray','dynamic','case','630162Xitmjy','559794bmddZq','class\x20','throw','9wdFqeZ','catch','\x20\x20Map<String,\x20dynamic>\x20toJson()\x20=>\x20{\x0a','\x20\x20});','static','\x20is\x20bool\x20?\x20','isObject','5942538Fexmem','log','operator','async','num','3795696gaWpsM','null',')?.toList()\x20:\x20null','298351QFEtLW','show','\x20\x20\x20\x20\x20\x20\x20\x20','.fromJson(','return','interface','isBoolean','finally','extends','covariant','entries','?.toString()','5464670SZWmBo','.fromJson(Map<String,\x20dynamic>\x20json)\x20{\x0a','String','int','\x20=\x20','List','\x20\x20\x20\x20\x20\x20};','({\x0a','deferred','assert','?.toString()\x20??\x20\x27\x27)','yield','this','abstract','final','\x20\x20\x20\x20','\x20类包含值为\x22空\x22的属性,将被默认视为”String“类型','mixin','void','Function','includes','\x20\x20\x20\x20this.','enum','super','await','test','with','\x20:\x20null','implements','isInt','export','join',')\x20:\x20null','else','3522248xhNneZ','num.tryParse(','__esModule','bool','isNumber','snakeToCamel','\x20!=\x20null\x20&&\x20'];a0_0x4cee=function(){return _0x538fa8;};return a0_0x4cee();}function modelTypeGenerator(_0x4ffa5b,_0x3007eb,_0x106883,_0x2a472f){const _0x14765c=a0_0x52467b;if((0x0,js_utils_plus_1[_0x14765c(0x167)])(_0x4ffa5b))return{'type':_0x14765c(0x129),'typeTo':_0x220f1c=>_0x220f1c,'typeFrom':_0x2b3335=>_0x2b3335+_0x14765c(0x157)+_0x2b3335+_0x14765c(0x11f)};if((0x0,js_utils_plus_1['isString'])(_0x4ffa5b))return{'type':_0x14765c(0x106),'typeTo':_0x1ddb22=>_0x1ddb22,'typeFrom':_0x776488=>_0x776488+'?.toString()'};if((0x0,js_utils_plus_1[_0x14765c(0x12a)])(_0x4ffa5b)){if(_0x2a472f)return{'type':_0x14765c(0x15d),'typeTo':_0x267f54=>_0x267f54,'typeFrom':_0x468fa9=>_0x14765c(0x127)+_0x468fa9+'?.toString()\x20??\x20\x27\x27)'};return(0x0,js_utils_plus_1[_0x14765c(0x121)])(_0x4ffa5b)?{'type':_0x14765c(0x107),'typeTo':_0x39c34b=>_0x39c34b,'typeFrom':_0x278f0c=>_0x14765c(0x12e)+_0x278f0c+_0x14765c(0x10e)}:{'type':'double','typeTo':_0x434a3b=>_0x434a3b,'typeFrom':_0x3d465a=>'double.tryParse('+_0x3d465a+_0x14765c(0x10e)};}if((0x0,js_utils_plus_1[_0x14765c(0x158)])(_0x4ffa5b))return{'type':_0x3007eb,'typeTo':_0x181a34=>_0x181a34+_0x14765c(0x139),'typeFrom':_0x3e1254=>'('+_0x3e1254+'\x20!=\x20null\x20&&\x20'+_0x3e1254+'\x20is\x20Map<String,\x20dynamic>)\x20?\x20'+_0x3007eb+_0x14765c(0x164)+_0x3e1254+_0x14765c(0x124),'subLines':jsonToDart(_0x4ffa5b,_0x3007eb,_0x106883,_0x2a472f)};if((0x0,js_utils_plus_1[_0x14765c(0x14b)])(_0x4ffa5b)){const _0x5400f2=_0x4ffa5b[0x0];if(!_0x5400f2)console[_0x14765c(0x15a)](_0x14765c(0x134)+_0x3007eb+_0x14765c(0x114));const {type:_0x1c7982,typeTo:_0x3ea9ab,typeFrom:_0xcaebb6,subLines:_0x5db3e3}=modelTypeGenerator(_0x5400f2||'',_0x3007eb,_0x106883,_0x2a472f);return{'type':'List<'+_0x1c7982+(_0x106883?'?':'')+'>','typeTo':_0x48a8b2=>_0x48a8b2+_0x14765c(0x13d)+_0x3ea9ab('e')+_0x14765c(0x12f),'typeFrom':_0x56ae09=>'('+_0x56ae09+_0x14765c(0x12c)+_0x56ae09+_0x14765c(0x131)+_0x56ae09+'.map((e)\x20=>\x20'+_0xcaebb6('e')+_0x14765c(0x160),'subLines':_0x5db3e3};}return console[_0x14765c(0x15a)](_0x14765c(0x134)+_0x3007eb+_0x14765c(0x114)),{'type':'String','typeTo':_0x58ec2b=>_0x58ec2b,'typeFrom':_0x5693d9=>_0x5693d9+_0x14765c(0x103)};}function modelKeywordDefence(_0x44514d){const _0x4b092d=a0_0x52467b;let _0x533ba1=[_0x4b092d(0x15d),_0x4b092d(0x14a),_0x4b092d(0x107),_0x4b092d(0x106),'bool',_0x4b092d(0x109),_0x4b092d(0x111),_0x4b092d(0x14c),_0x4b092d(0x120),_0x4b092d(0x162),'as',_0x4b092d(0x125),_0x4b092d(0x136),_0x4b092d(0x156),_0x4b092d(0x10d),_0x4b092d(0x11a),'in',_0x4b092d(0x11b),_0x4b092d(0x15c),_0x4b092d(0x122),_0x4b092d(0x166),_0x4b092d(0x144),_0x4b092d(0x11c),_0x4b092d(0x100),'is',_0x4b092d(0x137),_0x4b092d(0x141),'external',_0x4b092d(0x130),_0x4b092d(0x110),_0x4b092d(0x14d),'factory',_0x4b092d(0x115),_0x4b092d(0x151),_0x4b092d(0x153),_0x4b092d(0x138),_0x4b092d(0x145),'true',_0x4b092d(0x143),_0x4b092d(0x112),_0x4b092d(0x15f),_0x4b092d(0x13a),'const',_0x4b092d(0x168),'on',_0x4b092d(0x13e),_0x4b092d(0x13f),'for',_0x4b092d(0x15b),'var',_0x4b092d(0x101),_0x4b092d(0x117),'part',_0x4b092d(0x116),_0x4b092d(0x149),_0x4b092d(0x132),_0x4b092d(0x140),_0x4b092d(0x142),_0x4b092d(0x10c),'hide',_0x4b092d(0x165),_0x4b092d(0x11e),'do','if',_0x4b092d(0x13c),_0x4b092d(0x10f)];if(_0x533ba1[_0x4b092d(0x118)](_0x44514d)||/^\d/[_0x4b092d(0x11d)](_0x44514d))return'the'+(0x0,js_utils_plus_1['uppercaseFirst'])(_0x44514d);return(0x0,js_utils_plus_1[_0x4b092d(0x12b)])(_0x44514d);}function jsonToDart(_0x2798bf,_0x132436,_0x426752,_0x299b75){const _0x5aa1c0=a0_0x52467b;_0x132436=(0x0,js_utils_plus_1['uppercaseFirst'])((0x0,js_utils_plus_1[_0x5aa1c0(0x12b)])(_0x132436));let _0x509d46=[],_0x27d758=[],_0xa86f2d=[],_0x37e486=[],_0xd135e1=[],_0x98791d=[];_0x509d46[_0x5aa1c0(0x12d)](_0x5aa1c0(0x150)+_0x132436+'\x20{'),_0xa86f2d[_0x5aa1c0(0x12d)]('\x20\x20'+_0x132436+_0x5aa1c0(0x10b)),_0x37e486[_0x5aa1c0(0x12d)]('\x20\x20'+_0x132436+_0x5aa1c0(0x105)),_0xd135e1['push'](_0x5aa1c0(0x154));for(const [_0x469320,_0x53b455]of Object[_0x5aa1c0(0x102)](_0x2798bf)){let _0x128a45='\x27'+_0x469320+'\x27',_0x337ef8=modelKeywordDefence(_0x469320);const _0x36508b=''+_0x132436+(0x0,js_utils_plus_1[_0x5aa1c0(0x135)])((0x0,js_utils_plus_1[_0x5aa1c0(0x12b)])(_0x469320)),{type:_0x176f6a,typeTo:_0x5d1cc7,typeFrom:_0x204a13,subLines:_0x50be02}=modelTypeGenerator(_0x53b455,_0x36508b,_0x426752,_0x299b75);if(_0x50be02)_0x98791d[_0x5aa1c0(0x12d)](_0x50be02);_0xa86f2d['push'](_0x5aa1c0(0x119)+_0x337ef8+',\x0a'),_0x27d758['push']('\x20\x20'+_0x176f6a+(_0x426752?'?':'')+'\x20'+_0x337ef8+';\x0a'),_0x37e486['push'](_0x5aa1c0(0x113)+_0x337ef8+_0x5aa1c0(0x108)+_0x204a13(_0x5aa1c0(0x133)+_0x128a45+']')+';\x0a'),_0xd135e1[_0x5aa1c0(0x12d)](_0x5aa1c0(0x163)+_0x128a45+':\x20'+_0x5d1cc7(_0x337ef8)+',\x0a');}return _0xa86f2d[_0x5aa1c0(0x12d)](_0x5aa1c0(0x155)),_0x37e486[_0x5aa1c0(0x12d)](_0x5aa1c0(0x146)),_0xd135e1['push'](_0x5aa1c0(0x10a)),_0x509d46[_0x5aa1c0(0x12d)](_0x27d758[_0x5aa1c0(0x123)]('')),_0x509d46['push'](_0xa86f2d[_0x5aa1c0(0x123)]('')),_0x509d46[_0x5aa1c0(0x12d)](_0x37e486[_0x5aa1c0(0x123)]('')),_0x509d46[_0x5aa1c0(0x12d)](_0xd135e1[_0x5aa1c0(0x123)]('')),_0x509d46['push']('}\x0a'),_0x509d46[_0x5aa1c0(0x12d)](_0x98791d[_0x5aa1c0(0x123)]('')),_0x509d46[_0x5aa1c0(0x123)]('\x0d\x0a');}
|
package/main/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';const a1_0x1bfc60=a1_0x51e5;function a1_0x363c(){const _0x1439c5=['2286641irinIm','__importDefault','requiredOption','output','.dart','js-utils-plus','--nullsafety','是否使用num处理数字类型,默认使用int和double','-d,\x20--dir\x20<dir>','readFile','json','json文件夹路径,默认\x20json_models','5yugpnY','name','590ZAttIz','option','Command','./core/json2dart','defineProperty','excludes','7546CubzfB','__esModule','483930RDhsWv','numparse','/lib/models/','cwd','join','--numparse','-\x20执行文件:','762004ndRDAm','path','98848uSWrJo','6Gzneja','commander','1awmgtU','suffix','nullsafety','-e,\x20--excludes\x20<value...>','isJsonString','746124wWRkTj','jsonToDart','734794aSQZJc','自定义dart模型类名后缀,如\x20Entity','parse','dart模型输出路径,默认\x20lib/models','readDirFiles','log','default','是否启用空安全','writeFile','144oQQHXI'];a1_0x363c=function(){return _0x1439c5;};return a1_0x363c();}(function(_0x230b0d,_0x12599a){const _0x48bcdb=a1_0x51e5,_0x52b937=_0x230b0d();while(!![]){try{const _0x1edf1a=-parseInt(_0x48bcdb(0x13f))/0x1*(parseInt(_0x48bcdb(0x146))/0x2)+-parseInt(_0x48bcdb(0x166))/0x3+parseInt(_0x48bcdb(0x16d))/0x4*(parseInt(_0x48bcdb(0x15c))/0x5)+-parseInt(_0x48bcdb(0x13d))/0x6*(-parseInt(_0x48bcdb(0x150))/0x7)+parseInt(_0x48bcdb(0x16f))/0x8*(parseInt(_0x48bcdb(0x14f))/0x9)+parseInt(_0x48bcdb(0x15e))/0xa*(-parseInt(_0x48bcdb(0x164))/0xb)+parseInt(_0x48bcdb(0x144))/0xc;if(_0x1edf1a===_0x12599a)break;else _0x52b937['push'](_0x52b937['shift']());}catch(_0xca3255){_0x52b937['push'](_0x52b937['shift']());}}}(a1_0x363c,0x32bf0));function a1_0x51e5(_0x135ce5,_0x36b347){const _0x363c6b=a1_0x363c();return a1_0x51e5=function(_0x51e56e,_0x48fa75){_0x51e56e=_0x51e56e-0x13d;let _0x9ca228=_0x363c6b[_0x51e56e];return _0x9ca228;},a1_0x51e5(_0x135ce5,_0x36b347);}var __importDefault=this&&this[a1_0x1bfc60(0x151)]||function(_0x98b9f7){const _0x3c9ee2=a1_0x1bfc60;return _0x98b9f7&&_0x98b9f7[_0x3c9ee2(0x165)]?_0x98b9f7:{'default':_0x98b9f7};};Object[a1_0x1bfc60(0x162)](exports,a1_0x1bfc60(0x165),{'value':!![]});const json2dart_1=require(a1_0x1bfc60(0x161)),js_utils_plus_1=require(a1_0x1bfc60(0x155)),commander_1=require(a1_0x1bfc60(0x13e)),path_1=__importDefault(require(a1_0x1bfc60(0x16e))),program=new commander_1[(a1_0x1bfc60(0x160))](),_path=process[a1_0x1bfc60(0x169)]();program[a1_0x1bfc60(0x152)](a1_0x1bfc60(0x158),a1_0x1bfc60(0x15b))['option']('-o,\x20--output\x20<dir>',a1_0x1bfc60(0x149))[a1_0x1bfc60(0x15f)]('-s,\x20--suffix\x20<value>',a1_0x1bfc60(0x147))[a1_0x1bfc60(0x15f)](a1_0x1bfc60(0x142),'需要排除的json文件,可指定多个文件')['option'](a1_0x1bfc60(0x16b),a1_0x1bfc60(0x157))['option'](a1_0x1bfc60(0x156),a1_0x1bfc60(0x14d)),program['parse']();const options=program['opts']();function run(){const _0x44f14c=a1_0x1bfc60,_0x345b8f=path_1[_0x44f14c(0x14c)]['join'](_path,options['dir']),_0x4b545e=(0x0,js_utils_plus_1[_0x44f14c(0x14a)])(_0x345b8f,_0x44f14c(0x15a),options[_0x44f14c(0x163)]||[]);console[_0x44f14c(0x14b)](new Array(0x50)['join']('-')),_0x4b545e['forEach'](function(_0x145899){const _0xc31d52=_0x44f14c,_0x9c3190=(0x0,js_utils_plus_1[_0xc31d52(0x159)])(_0x145899);if(!_0x9c3190||!(0x0,js_utils_plus_1[_0xc31d52(0x143)])(_0x9c3190)){console['error'](_0xc31d52(0x16c)+_0x145899);return;}console[_0xc31d52(0x14b)]('-\x20执行文件:'+_0x145899);const _0x2a9c49=JSON[_0xc31d52(0x148)](_0x9c3190),_0x3c20b7=path_1['default'][_0xc31d52(0x148)](_0x145899),_0x8e87b=(0x0,json2dart_1[_0xc31d52(0x145)])(_0x2a9c49,options[_0xc31d52(0x140)]?''+_0x3c20b7[_0xc31d52(0x15d)]+options['suffix']:_0x3c20b7[_0xc31d52(0x15d)],options[_0xc31d52(0x141)],options[_0xc31d52(0x167)]),_0x2c4db4=path_1[_0xc31d52(0x14c)][_0xc31d52(0x16a)](_path,options[_0xc31d52(0x153)]||_0xc31d52(0x168),_0x3c20b7[_0xc31d52(0x15d)]+_0xc31d52(0x154));(0x0,js_utils_plus_1[_0xc31d52(0x14e)])(_0x2c4db4,_0x8e87b);});}run();
|