function TableUtils.shallowEqual(H,y)if H==y then return true end if type(H)~="\116\097\098\108\101"or type(y)~="\116\097\098\108\101"then return false end local N=TableUtils.keys(H)local l=TableUtils.keys(y)if#N~=#l then return false end return TableUtils.all(H,function(H,N)return H==y[N]end)end function TableUtils.serialize(H,y)y=y or function(H)return tostring(H)end assert(type(H)=="\116\097\098\108\101")assert(type(y)=="\102\117\110\099\116\105\111\110")return"\123"..(table.concat(TableUtils.map(H,function(H,N)return tostring(N)..("\061"..y(H))end),"\044").."\125")end function TableUtils.append(...)local H={}for y=1,select("\035",...),1 do local N=select(y,...)if type(N)=="\116\097\098\108\101"then for y,N in ipairs(N)do table.insert(H,N)end else table.insert(H,N)end end return H end return TableUtils

function TableUtils.shallowEqual(left, right)
	if left == right then
		return true
	end
	if type(left) ~= "table" or type(right) ~= "table" then
		return false
	end
	local leftKeys = TableUtils.keys(left)
	local rightKeys = TableUtils.keys(right)
	if #leftKeys ~= #rightKeys then
		return false
	end
	return TableUtils.all(
		left,
		function(value, key)
			return value == right[key]
		end
	)
end

function TableUtils.serialize(input, serializer)
	serializer = serializer or function(value)
			return tostring(value)
		end
	assert(type(input) == "table")
	assert(type(serializer) == "function")
	return "{" ..
		table.concat(
			TableUtils.map(
				input,
				function(element, i)
					return tostring(i) .. "=" .. serializer(element)
				end
			),
			","
		) ..
			"}"
end

function TableUtils.append(...)
	local result = {}
	for i = 1, select("#", ...) do
		local x = select(i, ...)
		if type(x) == "table" then
			for _, y in ipairs(x) do
				table.insert(result, y)
			end
		else
			table.insert(result, x)
		end
	end

	return result
end

return TableUtils
