style(configs): 格式化 JSON 配置文件
- 使用缩进格式化 CircleLevel.json 和 CrossServerGroupConf.json 文件 - 提高代码可读性和维护性 - 为 json2lua.js 脚本添加 CircleLevel.json 处理
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1 +1,22 @@
|
|||||||
{"7":{"id":7,"ruleid":104},"24":{"id":24,"ruleid":105},"49":{"id":49,"ruleid":106},"84":{"id":84,"ruleid":107},"10000":{"id":10000,"ruleid":108}}
|
{
|
||||||
|
"7": {
|
||||||
|
"id": 7,
|
||||||
|
"ruleid": 104
|
||||||
|
},
|
||||||
|
"24": {
|
||||||
|
"id": 24,
|
||||||
|
"ruleid": 105
|
||||||
|
},
|
||||||
|
"49": {
|
||||||
|
"id": 49,
|
||||||
|
"ruleid": 106
|
||||||
|
},
|
||||||
|
"84": {
|
||||||
|
"id": 84,
|
||||||
|
"ruleid": 107
|
||||||
|
},
|
||||||
|
"10000": {
|
||||||
|
"id": 10000,
|
||||||
|
"ruleid": 108
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -42,7 +42,7 @@ const start = () => {
|
|||||||
const files = fs.readdirSync(folderPath);
|
const files = fs.readdirSync(folderPath);
|
||||||
|
|
||||||
// 过滤出所有的 JSON 文件
|
// 过滤出所有的 JSON 文件
|
||||||
const jsonFiles = files.filter(file => path.extname(file) === '.json').filter(file => ["StdItems"].map(e => `${e}.json`).includes(file));
|
const jsonFiles = files.filter(file => path.extname(file) === '.json').filter(file => ["StdItems","CircleLevel"].map(e => `${e}.json`).includes(file));
|
||||||
jsonFiles.forEach(file => {
|
jsonFiles.forEach(file => {
|
||||||
const json = JSON.parse(fs.readFileSync(path.join(folderPath, file), 'utf8'))
|
const json = JSON.parse(fs.readFileSync(path.join(folderPath, file), 'utf8'))
|
||||||
const filename = path.basename(file, path.extname(file));
|
const filename = path.basename(file, path.extname(file));
|
||||||
|
|||||||
Reference in New Issue
Block a user