-- DOM code omitted for now but translated below:
--[[
	function isDomNode(obj: any): boolean
	return obj ~= nil and
		typeof(obj) == "table" and
		typeof(obj.nodeType) == "number" and
		typeof(obj.nodeName) == "string" and
		typeof(obj.isEqualNode) == "function"
	end
--]]