summaryrefslogtreecommitdiff
path: root/meta/3rd/OpenResty/library/table/isarray.lua
blob: f2ee3c7284c6d48080ea8136c87d5bf5cb78f580 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
---@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