function t.strict(a)return function(...)assert(a(...))end end do local a=t.map(t.string,t.callback)function t.children(V)assert(a(V))return function(a)local D,W=t.Instance(a)if not D then return false,W or""end local Q={}for a,D in ipairs(a:GetChildren())do local W=D.Name if V[W]then if Q[W]then return false,string.format("\067\097\110\110\111\116 \112\114\111\099\101\115\115 \109\117\108\116\105\112\108\101 \099\104\105\108\100\114\101\110 \119\105\116\104 \116\104\101 \115\097\109\101 \110\097\109\101 \037\113",W)end Q[W]=D end end for V,D in pairs(V)do local W,F=D(Q[V])if not W then return false,string.format("\091\037\115\046\037\115\093 \037\115",a:GetFullName(),V,F or"")end end return true end end end return t
--[[**
	asserts a given check

	@param check The function to wrap with an assert

	@returns A function that simply wraps the given check in an assert
**--]]
function t.strict(check)
	return function(...)
		assert(check(...))
	end
end

do
	local checkChildren = t.map(t.string, t.callback)

	--[[**
		Takes a table where keys are child names and values are functions to check the children against.
		Pass an instance tree into the function.
		If at least one child passes each check, the overall check passes.

		Warning! If you pass in a tree with more than one child of the same name, this function will always return false

		@param checkTable The table to check against

		@returns A function that checks an instance tree
	**--]]
	function t.children(checkTable)
		assert(checkChildren(checkTable))

		return function(value)
			local instanceSuccess, instanceErrMsg = t.Instance(value)
			if not instanceSuccess then
				return false, instanceErrMsg or ""
			end

			local childrenByName = {}
			for _, child in ipairs(value:GetChildren()) do
				local name = child.Name
				if checkTable[name] then
					if childrenByName[name] then
						return false, string.format("Cannot process multiple children with the same name %q", name)
					end

					childrenByName[name] = child
				end
			end

			for name, check in pairs(checkTable) do
				local success, errMsg = check(childrenByName[name])
				if not success then
					return false, string.format("[%s.%s] %s", value:GetFullName(), name, errMsg or "")
				end
			end

			return true
		end
	end
end

return t
