function Promise.is(o)if type(o)~="\116\097\098\108\101"then return false end local G=getmetatable(o)if G==Promise then return true elseif G==nil then return isCallable(o.andThen)elseif type(G)=="\116\097\098\108\101"and(type(rawget(G,"\095\095\105\110\100\101\120"))=="\116\097\098\108\101"and isCallable(rawget(rawget(G,"\095\095\105\110\100\101\120"),"\097\110\100\084\104\101\110")))then return true end return false end
--[=[
	Checks whether the given object is a Promise via duck typing. This only checks if the object is a table and has an `andThen` method.

	@param object any
	@return boolean -- `true` if the given `object` is a Promise.
]=]
function Promise.is(object)
	if type(object) ~= "table" then
		return false
	end

	local objectMetatable = getmetatable(object)

	if objectMetatable == Promise then
		-- The Promise came from this library.
		return true
	elseif objectMetatable == nil then
		-- No metatable, but we should still chain onto tables with andThen methods
		return isCallable(object.andThen)
	elseif
		type(objectMetatable) == "table"
		and type(rawget(objectMetatable, "__index")) == "table"
		and isCallable(rawget(rawget(objectMetatable, "__index"), "andThen"))
	then
		-- Maybe this came from a different or older Promise library.
		return true
	end

	return false
end
