getConnectionsByOriginModule = set => {
	const map = new Map();
	/** @type {Module | 0} */
	let lastModule = 0;
	/** @type {ModuleGraphConnection[] | undefined} */
	let lastList;
	for (const connection of set) {
		const { originModule } = connection;
		if (lastModule === originModule) {
			/** @type {ModuleGraphConnection[]} */
			(lastList).push(connection);
		} else {
			lastModule = /** @type {Module} */ (originModule);
			const list = map.get(originModule);
			if (list !== undefined) {
				lastList = list;
				list.push(connection);
			} else {
				const list = [connection];
				lastList = list;
				map.set(originModule, list);
			}
		}
	}
	return map;
}
@param {SortableSet<ModuleGraphConnection>} set input
@returns {readonly Map<Module | undefined, readonly ModuleGraphConnection[]>} mapped by origin module