getModuleName = name => {
	const [, prefix, resource] =
		/** @type {[string, string, string]} */
		(/** @type {unknown} */ (/^(.*!)?([^!]*)$/.exec(name)));

	if (resource.length > MAX_MODULE_IDENTIFIER_LENGTH) {
		const truncatedResource = `${resource.slice(
			0,
			Math.min(
				resource.length - /* '...(truncated)'.length */ 14,
				MAX_MODULE_IDENTIFIER_LENGTH
			)
		)}...(truncated)`;

		return [prefix, getResourceName(truncatedResource)];
	}

	return [prefix, getResourceName(resource)];
}
@param {string} name module name
@returns {[string,string]} prefix and module name