Performance fix: explicitly calling .getType is faster than adding a type prop to each obj