countWithChildren = (compilation, getItems) => {
	let count = getItems(compilation, "").length;
	for (const child of compilation.children) {
		count += countWithChildren(child, (c, type) =>
			getItems(c, `.children[].compilation${type}`)
		);
	}
	return count;
}
@template T
@param {Compilation} compilation the compilation
@param {(compilation: Compilation, name: string) => T[]} getItems get items
@returns {number} total number