node-vcard icon indicating copy to clipboard operation
node-vcard copied to clipboard

Single output value for multiple input values of same type

Open tmerse opened this issue 9 years ago • 1 comments

Multiple values for a field seem to be ignored, e.g.: The following .vcf (taken from this projects samples)

BEGIN:VCARD
VERSION:2.1
X-FOO:FOO
N:Gump;Forrest
FN:Forrest Gump
ORG:Bubba Gump Shrimp Co.
TITLE:Shrimp Man
TEL;WORK;VOICE:(111) 555-1212
TEL;HOME;VOICE:(404) 555-1212
ADR;WORK:;;100 Waters Edge;Baytown;LA;30314;United States of America
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:100 Waters Edge=0D=0ABaytown, LA 30314=0D=0AUnited States of America
ADR;HOME:;;42 Plantation St.;Baytown;LA;30314;United States of America
LABEL;HOME;ENCODING=QUOTED-PRINTABLE:42 Plantation St.=0D=0ABaytown, LA 30314=0D=0AUnited States of America
EMAIL;PREF;INTERNET:[email protected]
REV:20080424T195243Z
END:VCARD

produces the following result:

{ REV: '20080424T195243Z',
  TITLE: 'Shrimp Man',
  FN: 'Forrest Gump',
  'X-FOO': 'FOO',
  VERSION: '2.1',
  EMAIL:
   { type: [ 'INTERNET', 'PREF' ],
     value: '[email protected]' },
  LABEL:
   { type: [ 'ENCODING=QUOTED-PRINTABLE', 'WORK' ],
     value: '100 Waters Edge=0D=0ABaytown, LA 30314=0D=0AUnited States of Americ
a' },
  ADR:
   { type: [ 'WORK' ],
     value: ';;100 Waters Edge;Baytown;LA;30314;United States of America' },
  TEL: { type: [ 'VOICE', 'WORK' ], value: '(111) 555-1212' },
  ORG: 'Bubba Gump Shrimp Co.',
  N: 'Gump, Forrest' }

Expected for key TEL to see an array holding multiple entries:

TEL;WORK;VOICE:(111) 555-1212 TEL;HOME;VOICE:(404) 555-1212

tmerse avatar Apr 21 '16 11:04 tmerse

Did a PR https://github.com/jasperla/node-vcard/pull/17

mariohmol avatar Jul 16 '18 17:07 mariohmol