UNPKG

vcard-generator

Version:

VCard v4.0 rfc6350 compliant generator from JSON.

25 lines (18 loc) 605 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 ['ROLE', (0, _util.formatPref)(pref), (0, _util.formatType)(type), ':', (0, _util.encodeText)(text || value)].filter(_util.isSet).join(''); }; /* Cardinality: 0+ (*) ROLE-param = "VALUE=text" / language-param / pid-param / pref-param / type-param / altid-param / any-param ROLE-value = text ROLE:Project Leader */