getNumberOfMatchingSizeTypes = (size, types) => {
	let i = 0;
	for (const key of Object.keys(size)) {
		if (size[/** @type {keyof T} */ (key)] !== 0 && types.has(key)) i++;
	}
	return i;
}
@template {object} T
@param {T} size size
@param {Set<string>} types types
@returns {number} number of matching size types