Move whole-card cardinality checks into overloaded validate helpers in
the vCard 3 and vCard 4 modules, and have readVCard invoke those
validators after parsing instead of hard-coding property checks in the
shared parser.
For vCard 3, validate property cardinality directly from propertyCardMap
and add regression coverage for duplicate single-cardinality properties.
For vCard 4, validate from propertyCardMap as well, while preserving
ALTID semantics for single-cardinality properties so alternate
representations remain valid and duplicate ungrouped properties are
rejected.
Rework VERSION handling to treat it as parser metadata rather than
stored card content. Parsing still requires exactly one canonical
VERSION line and rejects missing or duplicate occurrences, but parsed
cards no longer retain VC3_Version or VC4_Version objects in content.
Accessors and serializers continue to expose and emit the canonical
version for the concrete card type, which keeps parsed and
programmatically constructed cards on the same model.
Update the vCard 3 and vCard 4 test suites to cover the new validation
path, confirm VERSION is not persisted in content, and adjust fixture
expectations to match the canonical VERSION model.
AI-Assisted: yes
AI-Tool: OpenAI Codex / gpt-5.4 xhigh
- The documentation is cluttered enough as it is with the large number
of procedures supporting vCard 3 and 4. Split common out into the
publicly exposed bits and the private internals. This makes it obvious
which common functionality a client can expect to have exposed on the
main vcard module.
- Add documentation (WIP) on the vcard3 module.
- Parsers and serializers are now present for all property types.
- Tests exist to cover parsing for most value types. Many property types
share the same parsing logic based on their value type. We have
created unit tests to cover each value type, not neccesarily all
properties individually.