summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/utility.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/script/utility.lua b/script/utility.lua
index 55965cf2..be945791 100644
--- a/script/utility.lua
+++ b/script/utility.lua
@@ -336,7 +336,10 @@ function m.counter(init, step)
end
--- 排序后遍历
----@param t table
+---@generic K, V
+---@param t table<K, V>
+---@param sorter? fun(a: K, b: K): boolean
+---@return fun(): K, V
function m.sortPairs(t, sorter)
local keys = {}
for k in pairs(t) do