diff --git a/inspect.lua b/inspect.lua index 5319f33..1e982ca 100644 --- a/inspect.lua +++ b/inspect.lua @@ -19,8 +19,9 @@ local function setTerm(termlike) end local function prepareObject(other) + assert(type(other) == "table", "object has to be a table") local keys = {} - for key, _ in other do + for key, _ in pairs(other) do keys.insert(key) end table.sort(keys)