createModulesListMessage = (modules, moduleGraph) =>
	modules
		.map(m => {
			let message = `* ${m.identifier()}`;
			const validReasons = Array.from(
				moduleGraph.getIncomingConnectionsByOriginModule(m).keys()
			).filter(Boolean);

			if (validReasons.length > 0) {
				message += `\n    Used by ${validReasons.length} module(s), i. e.`;
				message += `\n    ${
					/** @type {Module[]} */ (validReasons)[0].identifier()
				}`;
			}
			return message;
		})
		.join("\n")
@param {Module[]} modules each module from throw
@param {ModuleGraph} moduleGraph the module graph
@returns {string} each message from provided modules