function PromiseUtils.timeout(T,s)assert(type(T)=="\110\117\109\098\101\114","\066\097\100 \116\105\109\101\111\117\116\084\105\109\101")assert(s,"\066\097\100 \102\114\111\109\080\114\111\109\105\115\101")if not s:IsPending()then return s end local b=Promise.new()b:Resolve(s)task.delay(T,function()b:Reject()end)return b end return PromiseUtils

function PromiseUtils.timeout(timeoutTime, fromPromise)
	assert(type(timeoutTime) == "number", "Bad timeoutTime")
	assert(fromPromise, "Bad fromPromise")

	if not fromPromise:IsPending() then
		return fromPromise
	end

	local promise = Promise.new()

	promise:Resolve(fromPromise)

	task.delay(timeoutTime, function()
		promise:Reject()
	end)

	return promise
end

return PromiseUtils
