From 88bde2df6937e9df77d7ea70bc14f14090f9e72c Mon Sep 17 00:00:00 2001 From: aixianling Date: Wed, 22 Jan 2025 15:33:57 +0800 Subject: [PATCH] =?UTF-8?q?refactor(tools):=20=E6=9B=B4=E6=96=B0=20JSON=20?= =?UTF-8?q?to=20Lua=20=E8=BD=AC=E6=8D=A2=E5=B7=A5=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除了未使用的 NpcTransConf 配置项 - 优化了 scope 数组,使用 filter(Boolean) 过滤掉注释掉的项 - 调整了代码格式,提高可读性 --- tools/json2lua.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/json2lua.js b/tools/json2lua.js index cb37f10..7767279 100644 --- a/tools/json2lua.js +++ b/tools/json2lua.js @@ -7,9 +7,9 @@ const scope = [ "Monster", "ItemMergeConfig", "MergeConfig", - "NpcTransConf" + // "NpcTransConf" // "MergeTotal", "RecyclingSettingConfig", "UpstarConfig", -]; +].filter(Boolean); const strKey = (key) => (isNaN(key) ? `${key}` : `[${key}]`); function jsonToLua(jsonObj, indent = "", linefeed = "\n") { let luaStr = "";