charm/src/utils/count.luau
richard 6a9c580bd7
feat: add effect cleanups, add docs (#2)
* docs: update readme

* feat: add cleanup function to effects

* refactor: move peek function to store module

* test: add nested atom check

* docs: add doc comments

* fix: `effect()` type

* refactor: remove divider comment
2024-06-02 01:25:00 -07:00

15 lines
270 B
Lua

--[=[
Counts the number of elements in a table.
@param object The table to count.
@return The number of elements in the table.
]=]
local function count(object: any): number
local count = 0
for _ in next, object do
count += 1
end
return count
end
return count