"use strict";

const either = require("@validatem/either");

const isRoomEvent = require("../is-room-event");
const isStateEvent = require("../is-state-event");

// State events are a more specific version of room events: https://github.com/matrix-org/matrix-doc/issues/2681
module.exports = function (strict = false, extraFields = {}) {
	return either([
		[ isRoomEvent(strict, extraFields) ],
		[ isStateEvent(strict, extraFields) ]
	]);
};

