Have an extra groups?: Record<string, PartialVCard>; property on vCards, which includes the grouped properties. Then, user code could decide whether it wants
Items ungrouped: Just use the pre-existing structure, ignoring group field in properties, or
Items grouped: Read through groups and then ignore all values which have a group field
Have a groupVCard() function, which groups all entries by group name (and those without, into ungrouped) into a Record<string, PartialVCard>
I am currently favoring 2, as groups are rarely used and most consumers will not want to bother about it. This also reduces code size for group-agnostic consumers.
Two approaches
groups?: Record<string, PartialVCard>;
property on vCards, which includes the grouped properties. Then, user code could decide whether it wantsgroup
field in properties, orgroups
and then ignore all values which have agroup
fieldgroupVCard()
function, which groups all entries by group name (and those without, intoungrouped
) into aRecord<string, PartialVCard>
I am currently favoring 2, as groups are rarely used and most consumers will not want to bother about it. This also reduces code size for group-agnostic consumers.