function createEvent (eventName, target, isIframe) {

	if (typeof eventName !== 'string') {
		throw new Error('Event name must be a string');
	}

	const
		eventFrags = eventName.match(/([a-z]+\.([a-z]+))/i),
		detail = {
			target: target,
			isIframe
		}
	;

	if (eventFrags !== null) {
		eventName = eventFrags[1];
		detail.namespace = eventFrags[2];
	}

	return new window.CustomEvent(eventName, {
		detail: detail
	});
}
@param {string} eventName
@param {*} target
@return {Event|Object}