return function(r,P,L)local M=r:FindFirstChild(P)if M then return Promise.resolved(M)end return Promise.spawn(function(M,n)local c=r:WaitForChild(P,L)if c then M(c)else n("\084\105\109\101\100 \111\117\116")end end)end
--[=[
	Wraps the :WaitForChild API with a promise

	@function promiseChild
	@param parent Instance
	@param name string
	@param timeOut number?
	@return Promise<Instance>
	@within promiseChild
]=]
return function(parent, name, timeOut)
	local result = parent:FindFirstChild(name)
	if result then
		return Promise.resolved(result)
	end

	return Promise.spawn(function(resolve, reject)
		local child = parent:WaitForChild(name, timeOut)

		if child then
			resolve(child)
		else
			reject("Timed out")
		end
	end)
end
