UNPKG

vcard-generator

Version:

VCard v4.0 rfc6350 compliant generator from JSON.

27 lines (20 loc) 684 B
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _util = require('./util'); exports.default = function (_ref) { var pref = _ref.pref, type = _ref.type, text = _ref.text, value = _ref.value; return ['NICKNAME', (0, _util.formatPref)(pref), (0, _util.formatType)(type), ':', (0, _util.encodeTextList)(text || value)].filter(_util.isSet).join(''); }; /* Cardinality: 0+ (*) NICKNAME-param = "VALUE=text" / type-param / language-param / altid-param / pid-param / pref-param / any-param NICKNAME-value = text-list NICKNAME:Robbie NICKNAME:Jim,Jimmie NICKNAME;TYPE=work:Boss */