charm/tests/utils/count.luau
richard 08c7e690d5
refactor!: migrate to monorepo (#23)
* refactor!: create monorepo

* chore: prepare release, set up workflows

* refactor: rename `modules` to `src`

* docs: add docs for all packages

* refactor: rename root project file

* chore: bump deps

* build: rename `lint`, add `pack` script

* revert: delete pack script

This will not be useful for development.
2024-10-12 18:29:15 -07:00

15 lines
270 B
Text

--[=[
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