"use strict";

const required = require("@validatem/required");
const isString = require("@validatem/is-string");

const isEvent = require("../is-event");
const isMatrixID = require("../is-matrix-id");

module.exports = function isDeviceEvent(strict = false, extraFields = {}) {
	return isEvent(strict, {
		state_key: [ required, isString ],
		sender: [ required, isMatrixID ],
		... extraFields
	});
};
