tree:

isTraversable(obj)

Returns true if the object can be traversed via the traverse method. The object must be either treelike or a packed object with an unpack() method. See unpacking files.