diff options
Diffstat (limited to 'meta/3rd/OpenResty/library/table')
m--------- | meta/3rd/OpenResty | 0 | ||||
-rw-r--r-- | meta/3rd/OpenResty/library/table/clone.lua | 25 | ||||
-rw-r--r-- | meta/3rd/OpenResty/library/table/isarray.lua | 23 | ||||
-rw-r--r-- | meta/3rd/OpenResty/library/table/isempty.lua | 22 | ||||
-rw-r--r-- | meta/3rd/OpenResty/library/table/nkeys.lua | 23 |
5 files changed, 0 insertions, 93 deletions
diff --git a/meta/3rd/OpenResty b/meta/3rd/OpenResty new file mode 160000 +Subproject 3bec36f0f645bb38b3c8208990d5c36feb66ce3 diff --git a/meta/3rd/OpenResty/library/table/clone.lua b/meta/3rd/OpenResty/library/table/clone.lua deleted file mode 100644 index ff2ce870..00000000 --- a/meta/3rd/OpenResty/library/table/clone.lua +++ /dev/null @@ -1,25 +0,0 @@ ----@meta - ---- Returns a shallow copy of the given Lua table. ---- ---- This API can be JIT compiled. ---- ---- Usage: ---- ---- ```lua ---- local clone = require "table.clone" ---- ---- local x = {x=12, y={5, 6, 7}} ---- local y = clone(x) ---- ``` ---- ---- **Note:** We observe 7% over-all speedup in the edgelang-fan compiler's ---- compiling speed whose Lua is generated by the fanlang compiler. ---- ---- **Note bis:** Deep cloning is planned to be supported by adding `true` as a second argument. ---- ----@param t table ----@return table -local function clone(t) end - -return clone diff --git a/meta/3rd/OpenResty/library/table/isarray.lua b/meta/3rd/OpenResty/library/table/isarray.lua deleted file mode 100644 index f2ee3c72..00000000 --- a/meta/3rd/OpenResty/library/table/isarray.lua +++ /dev/null @@ -1,23 +0,0 @@ ----@meta - ---- Returns `true` when the given Lua table is a pure array-like Lua table, or ---- `false` otherwise. ---- ---- Empty Lua tables are treated as arrays. ---- ---- This API can be JIT compiled. ---- ---- Usage: ---- ---- ```lua ---- local isarray = require "table.isarray" ---- ---- print(isarray{"a", true, 3.14}) -- true ---- print(isarray{dog = 3}) -- false ---- print(isarray{}) -- true ---- ``` ----@param t table ----@return boolean -local function isarray(t) end - -return isarray diff --git a/meta/3rd/OpenResty/library/table/isempty.lua b/meta/3rd/OpenResty/library/table/isempty.lua deleted file mode 100644 index b1cef6fb..00000000 --- a/meta/3rd/OpenResty/library/table/isempty.lua +++ /dev/null @@ -1,22 +0,0 @@ ----@meta - ---- Returns `true` when the given Lua table contains neither non-nil array elements nor non-nil key-value pairs, or `false` otherwise. ---- ---- This API can be JIT compiled. ---- Usage: ---- ---- ```lua ---- local isempty = require "table.isempty" ---- ---- print(isempty({})) -- true ---- print(isempty({nil, dog = nil})) -- true ---- print(isempty({"a", "b"})) -- false ---- print(isempty({nil, 3})) -- false ---- print(isempty({cat = 3})) -- false ---- ``` ---- ----@param t table ----@return boolean -local function isempty(t) end - -return isempty diff --git a/meta/3rd/OpenResty/library/table/nkeys.lua b/meta/3rd/OpenResty/library/table/nkeys.lua deleted file mode 100644 index 41a42d6a..00000000 --- a/meta/3rd/OpenResty/library/table/nkeys.lua +++ /dev/null @@ -1,23 +0,0 @@ ----@meta - ---- Returns the total number of elements in a given Lua table (i.e. from both the ---- array and hash parts combined). ---- ---- This API can be JIT compiled. ---- ---- Usage: ---- ---- ```lua ---- local nkeys = require "table.nkeys" ---- ---- print(nkeys({})) -- 0 ---- print(nkeys({ "a", nil, "b" })) -- 2 ---- print(nkeys({ dog = 3, cat = 4, bird = nil })) -- 2 ---- print(nkeys({ "a", dog = 3, cat = 4 })) -- 3 ---- ``` ---- ----@param t table ----@return integer -local function nkeys(t) end - -return nkeys |