From e39badb1811c2cd645e9dafdeff5c5fc3dc87946 Mon Sep 17 00:00:00 2001 From: chronolaw Date: Mon, 12 Aug 2024 17:35:17 +0800 Subject: [PATCH] feat(tools): add a readonly empty table for common usage --- kong/tools/table.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kong/tools/table.lua b/kong/tools/table.lua index f6a9ce8d12cb..66fcb4feeb40 100644 --- a/kong/tools/table.lua +++ b/kong/tools/table.lua @@ -11,6 +11,9 @@ local getmetatable = getmetatable local _M = {} +_M.EMPTY = require("pl.tablex").readonly({}) + + --- packs a set of arguments in a table. -- Explicitly sets field `n` to the number of arguments, so it is `nil` safe _M.pack = function(...) return {n = select("#", ...), ...} end