Comparing version 1.0.2 to 1.0.4
@@ -1,1 +0,1 @@ | ||
!function(e){var t={};function o(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=t,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,o){e.exports=o(1)},function(e,t,o){"use strict";var r;function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,o){return t&&i(e.prototype,t),o&&i(e,o),e}o.r(t),function(e){e.HOME="HOME",e.WORK="WORK"}(r||(r={}));var l=function(){function e(){n(this,e)}return a(e,null,[{key:"e",value:function(e){return e?("string"!=typeof e&&(e=""+e),e.replace(/\n/g,"\\n").replace(/,/g,"\\,").replace(/;/g,"\\;")):""}},{key:"nl",value:function(){return"\r\n"}},{key:"getFormattedPhoto",value:function(t,o,r,n,i){return t+(r>=4?n?";ENCODING=b;MEDIATYPE=image/":";MEDIATYPE=image/":3===r?n?";ENCODING=b;TYPE=":";TYPE=":n?";ENCODING=BASE64;":";")+i+":"+e.e(o)+e.nl()}},{key:"getFormattedAddress",value:function(t,o,r){if(!o.details)return"";var n="";return(o.details.label||o.details.street||o.details.city||o.details.stateProvince||o.details.postalCode||o.details.countryRegion)&&(r>=4?n="ADR"+t+";TYPE="+o.type+(o.details.label?';LABEL="'+e.e(o.details.label)+'"':"")+":"+e.e(o.details.poBox)+";"+e.e(o.details.extendedAddress)+";"+e.e(o.details.street)+";"+e.e(o.details.city)+";"+e.e(o.details.stateProvince)+";"+e.e(o.details.postalCode)+";"+e.e(o.details.countryRegion)+e.nl():(o.details.label&&(n="LABEL"+t+";TYPE="+o.type+":"+e.e(o.details.label)+e.nl()),n+="ADR"+t+";TYPE="+o.type+":;;"+e.e(o.details.street)+";"+e.e(o.details.city)+";"+e.e(o.details.stateProvince)+";"+e.e(o.details.postalCode)+";"+e.e(o.details.countryRegion)+e.nl())),n}},{key:"getFormattedDate",value:function(e){return e.getFullYear()+("0"+(e.getMonth()+1)).slice(-2)+("0"+e.getDate()).slice(-2)}},{key:"getFormattedString",value:function(t,o){null==o&&(o={skipCharset:!1,skipShowAs:!1,skipRevision:!1});var n=t.getMajorVersion(),i="";i+="BEGIN:VCARD"+e.nl(),i+="VERSION:"+t.version+e.nl();var a=n>=4||o.skipCharset?"":";CHARSET=UTF-8",l=t.formattedName||"";if(l||[t.firstName,t.middleName,t.lastName].map((function(e){return e||""})).forEach((function(e){e&&l&&(l+=" "),l+=e})),i+="FN"+a+":"+e.e(l)+e.nl(),i+="N"+a+":"+e.e(t.lastName)+";"+e.e(t.firstName)+";"+e.e(t.middleName)+";"+e.e(t.namePrefix)+";"+e.e(t.nameSuffix)+e.nl(),t.nickname&&n>=3&&(i+="NICKNAME"+a+":"+e.e(t.nickname)+e.nl()),t.gender&&(i+="GENDER:"+e.e(t.gender)+e.nl()),t.uid&&(i+="UID"+a+":"+e.e(t.uid)+e.nl()),t.birthday&&(i+="BDAY:"+e.getFormattedDate(t.birthday)+e.nl()),t.anniversary&&(i+="ANNIVERSARY:"+e.getFormattedDate(t.anniversary)+e.nl()),t.email&&(Array.isArray(t.email)||(t.email=[t.email]),t.email.forEach((function(t){i+=n>=4?"EMAIL"+a+";type=HOME:"+e.e(t)+e.nl():n>=3&&n<4?"EMAIL"+a+";type=HOME,INTERNET:"+e.e(t)+e.nl():"EMAIL"+a+";HOME;INTERNET:"+e.e(t)+e.nl()}))),t.workEmail&&(Array.isArray(t.workEmail)||(t.workEmail=[t.workEmail]),t.workEmail.forEach((function(t){i+=n>=4?"EMAIL"+a+";type=WORK:"+e.e(t)+e.nl():n>=3&&n<4?"EMAIL"+a+";type=WORK,INTERNET:"+e.e(t)+e.nl():"EMAIL"+a+";WORK;INTERNET:"+e.e(t)+e.nl()}))),t.otherEmail&&(Array.isArray(t.otherEmail)||(t.otherEmail=[t.otherEmail]),t.otherEmail.forEach((function(t){i+=n>=4?"EMAIL"+a+";type=OTHER:"+e.e(t)+e.nl():n>=3&&n<4?"EMAIL"+a+";type=OTHER,INTERNET:"+e.e(t)+e.nl():"EMAIL"+a+";OTHER;INTERNET:"+e.e(t)+e.nl()}))),t.logo&&t.logo.url&&(i+=e.getFormattedPhoto("LOGO",t.logo.url,n,t.logo.base64,t.logo.mediaType)),t.photo&&t.photo.url&&(i+=e.getFormattedPhoto("PHOTO",t.photo.url,n,t.photo.base64,t.photo.mediaType)),t.cellPhone&&(Array.isArray(t.cellPhone)||(t.cellPhone=[t.cellPhone]),t.cellPhone.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="voice,cell":tel:'+e.e(t)+e.nl():"TEL;TYPE=CELL:"+e.e(t)+e.nl()}))),t.pagerPhone&&(Array.isArray(t.pagerPhone)||(t.pagerPhone=[t.pagerPhone]),t.pagerPhone.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="pager,cell":tel:'+e.e(t)+e.nl():"TEL;TYPE=PAGER:"+e.e(t)+e.nl()}))),t.homePhone&&(Array.isArray(t.homePhone)||(t.homePhone=[t.homePhone]),t.homePhone.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="voice,home":tel:'+e.e(t)+e.nl():"TEL;TYPE=HOME,VOICE:"+e.e(t)+e.nl()}))),t.workPhone&&(Array.isArray(t.workPhone)||(t.workPhone=[t.workPhone]),t.workPhone.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="voice,work":tel:'+e.e(t)+e.nl():"TEL;TYPE=WORK,VOICE:"+e.e(t)+e.nl()}))),t.homeFax&&(Array.isArray(t.homeFax)||(t.homeFax=[t.homeFax]),t.homeFax.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="fax,home":tel:'+e.e(t)+e.nl():"TEL;TYPE=HOME,FAX:"+e.e(t)+e.nl()}))),t.workFax&&(Array.isArray(t.workFax)||(t.workFax=[t.workFax]),t.workFax.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="fax,work":tel:'+e.e(t)+e.nl():"TEL;TYPE=WORK,FAX:"+e.e(t)+e.nl()}))),t.otherPhone&&(Array.isArray(t.otherPhone)||(t.otherPhone=[t.otherPhone]),t.otherPhone.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="voice,other":tel:'+e.e(t)+e.nl():"TEL;TYPE=OTHER:"+e.e(t)+e.nl()}))),[{details:t.homeAddress,type:r.HOME},{details:t.workAddress,type:r.WORK}].filter((function(e){return e.details})).forEach((function(t){i+=e.getFormattedAddress(a,t,n)})),t.title&&(i+="TITLE"+a+":"+e.e(t.title)+e.nl()),t.role&&(i+="ROLE"+a+":"+e.e(t.role)+e.nl()),t.organization&&(i+="ORG"+a+":"+e.e(t.organization)+e.nl()),t.url&&(i+="URL"+a+":"+e.e(t.url)+e.nl()),t.workUrl&&(i+="URL;type=WORK"+a+":"+e.e(t.workUrl)+e.nl()),t.note&&(i+="NOTE"+a+":"+e.e(t.note)+e.nl()),t.socialUrls)for(var s in t.socialUrls.keys())t.socialUrls.has(s)&&(i+="X-SOCIALPROFILE;TYPE="+s+":"+e.e(t.socialUrls.get(s))+e.nl());return t.source&&(i+="SOURCE"+a+":"+e.e(t.source)+e.nl()),o.skipRevision||(i+="REV:"+(new Date).toISOString()+e.nl()),t.organization&&!o.skipShowAs&&(i+="X-ABShowAs:COMPANY"+e.nl()),i+="END:VCARD"+e.nl()}}]),e}(),s=function(){function e(){n(this,e),this.uid=void 0,this.anniversary=void 0,this.birthday=void 0,this.cellPhone=void 0,this.pagerPhone=void 0,this.email=void 0,this.workEmail=void 0,this.firstName=void 0,this.formattedName=void 0,this.gender=void 0,this.homeAddress=void 0,this.homePhone=void 0,this.homeFax=void 0,this.lastName=void 0,this.logo=void 0,this.middleName=void 0,this.namePrefix=void 0,this.nameSuffix=void 0,this.nickname=void 0,this.note=void 0,this.organization=void 0,this.otherEmail=void 0,this.otherPhone=void 0,this.photo=void 0,this.role=void 0,this.socialUrls=void 0,this.source=void 0,this.title=void 0,this.url=void 0,this.workUrl=void 0,this.workAddress=void 0,this.workPhone=void 0,this.workFax=void 0,this.version="3"}return a(e,[{key:"getMajorVersion",value:function(){var e=this.version?this.version.split(".")[0]:"4";return isNaN(Number(e))?4:Number(e)}},{key:"getFormattedString",value:function(){return l.getFormattedString(this)}}]),e}();o.d(t,"vCardAddressType",(function(){return r})),o.d(t,"vCard",(function(){return s})),o.d(t,"vCardFormatter",(function(){return l}))}]); | ||
!function(e){var t={};function o(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=t,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,o){e.exports=o(1)},function(e,t,o){"use strict";var r;function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,o){return t&&i(e.prototype,t),o&&i(e,o),e}o.r(t),function(e){e.HOME="HOME",e.WORK="WORK"}(r||(r={}));var l=function(){function e(){n(this,e)}return a(e,null,[{key:"e",value:function(e){return e?("string"!=typeof e&&(e=""+e),e.replace(/\n/g,"\\n").replace(/,/g,"\\,").replace(/;/g,"\\;")):""}},{key:"nl",value:function(){return"\r\n"}},{key:"getFormattedPhoto",value:function(t,o,r,n,i){return t+(r>=4?n?";ENCODING=b;MEDIATYPE=image/":";MEDIATYPE=image/":3===r?n?";ENCODING=b;TYPE=":";TYPE=":n?";ENCODING=BASE64;":";")+i+":"+e.e(o)+e.nl()}},{key:"getFormattedAddress",value:function(t,o,r){if(!o.details)return"";var n="";return(o.details.label||o.details.street||o.details.city||o.details.stateProvince||o.details.postalCode||o.details.countryRegion)&&(r>=4?n="ADR"+t+";TYPE="+o.type+(o.details.label?';LABEL="'+e.e(o.details.label)+'"':"")+":"+e.e(o.details.poBox)+";"+e.e(o.details.extendedAddress)+";"+e.e(o.details.street)+";"+e.e(o.details.city)+";"+e.e(o.details.stateProvince)+";"+e.e(o.details.postalCode)+";"+e.e(o.details.countryRegion)+e.nl():(o.details.label&&(n="LABEL"+t+";TYPE="+o.type+":"+e.e(o.details.label)+e.nl()),n+="ADR"+t+";TYPE="+o.type+":;;"+e.e(o.details.street)+";"+e.e(o.details.city)+";"+e.e(o.details.stateProvince)+";"+e.e(o.details.postalCode)+";"+e.e(o.details.countryRegion)+e.nl())),n}},{key:"getFormattedDate",value:function(e){return e.getFullYear()+("0"+(e.getMonth()+1)).slice(-2)+("0"+e.getDate()).slice(-2)}},{key:"getFormattedString",value:function(t,o){null==o&&(o={skipCharset:!1,skipShowAs:!1,skipRevision:!1});var n=t.getMajorVersion(),i="";i+="BEGIN:VCARD"+e.nl(),i+="VERSION:"+t.version+e.nl();var a=n>=4||o.skipCharset?"":";CHARSET=UTF-8",l=t.formattedName||"";if(l||[t.firstName,t.middleName,t.lastName].map((function(e){return e||""})).forEach((function(e){e&&l&&(l+=" "),l+=e})),i+="FN"+a+":"+e.e(l)+e.nl(),i+="N"+a+":"+e.e(t.lastName)+";"+e.e(t.firstName)+";"+e.e(t.middleName)+";"+e.e(t.namePrefix)+";"+e.e(t.nameSuffix)+e.nl(),t.nickname&&n>=3&&(i+="NICKNAME"+a+":"+e.e(t.nickname)+e.nl()),t.gender&&(i+="GENDER:"+e.e(t.gender)+e.nl()),t.uid&&(i+="UID"+a+":"+e.e(t.uid)+e.nl()),t.birthday&&(i+="BDAY:"+e.getFormattedDate(t.birthday)+e.nl()),t.anniversary&&(i+="ANNIVERSARY:"+e.getFormattedDate(t.anniversary)+e.nl()),t.email&&(Array.isArray(t.email)||(t.email=[t.email]),t.email.forEach((function(t){i+=n>=4?"EMAIL"+a+";type=HOME:"+e.e(t)+e.nl():n>=3&&n<4?"EMAIL"+a+";type=HOME,INTERNET:"+e.e(t)+e.nl():"EMAIL"+a+";HOME;INTERNET:"+e.e(t)+e.nl()}))),t.workEmail&&(Array.isArray(t.workEmail)||(t.workEmail=[t.workEmail]),t.workEmail.forEach((function(t){i+=n>=4?"EMAIL"+a+";type=WORK:"+e.e(t)+e.nl():n>=3&&n<4?"EMAIL"+a+";type=WORK,INTERNET:"+e.e(t)+e.nl():"EMAIL"+a+";WORK;INTERNET:"+e.e(t)+e.nl()}))),t.otherEmail&&(Array.isArray(t.otherEmail)||(t.otherEmail=[t.otherEmail]),t.otherEmail.forEach((function(t){i+=n>=4?"EMAIL"+a+";type=OTHER:"+e.e(t)+e.nl():n>=3&&n<4?"EMAIL"+a+";type=OTHER,INTERNET:"+e.e(t)+e.nl():"EMAIL"+a+";OTHER;INTERNET:"+e.e(t)+e.nl()}))),t.logo&&t.logo.url&&(i+=e.getFormattedPhoto("LOGO",t.logo.url,n,t.logo.base64,t.logo.mediaType)),t.photo&&t.photo.url&&(i+=e.getFormattedPhoto("PHOTO",t.photo.url,n,t.photo.base64,t.photo.mediaType)),t.cellPhone&&(Array.isArray(t.cellPhone)||(t.cellPhone=[t.cellPhone]),t.cellPhone.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="voice,cell":tel:'+e.e(t)+e.nl():"TEL;TYPE=CELL:"+e.e(t)+e.nl()}))),t.pagerPhone&&(Array.isArray(t.pagerPhone)||(t.pagerPhone=[t.pagerPhone]),t.pagerPhone.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="pager,cell":tel:'+e.e(t)+e.nl():"TEL;TYPE=PAGER:"+e.e(t)+e.nl()}))),t.homePhone&&(Array.isArray(t.homePhone)||(t.homePhone=[t.homePhone]),t.homePhone.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="voice,home":tel:'+e.e(t)+e.nl():"TEL;TYPE=HOME,VOICE:"+e.e(t)+e.nl()}))),t.workPhone&&(Array.isArray(t.workPhone)||(t.workPhone=[t.workPhone]),t.workPhone.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="voice,work":tel:'+e.e(t)+e.nl():"TEL;TYPE=WORK,VOICE:"+e.e(t)+e.nl()}))),t.homeFax&&(Array.isArray(t.homeFax)||(t.homeFax=[t.homeFax]),t.homeFax.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="fax,home":tel:'+e.e(t)+e.nl():"TEL;TYPE=HOME,FAX:"+e.e(t)+e.nl()}))),t.workFax&&(Array.isArray(t.workFax)||(t.workFax=[t.workFax]),t.workFax.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="fax,work":tel:'+e.e(t)+e.nl():"TEL;TYPE=WORK,FAX:"+e.e(t)+e.nl()}))),t.otherPhone&&(Array.isArray(t.otherPhone)||(t.otherPhone=[t.otherPhone]),t.otherPhone.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="voice,other":tel:'+e.e(t)+e.nl():"TEL;TYPE=OTHER:"+e.e(t)+e.nl()}))),[{details:t.homeAddress,type:r.HOME},{details:t.workAddress,type:r.WORK}].filter((function(e){return e.details})).forEach((function(t){i+=e.getFormattedAddress(a,t,n)})),t.title&&(i+="TITLE"+a+":"+e.e(t.title)+e.nl()),t.role&&(i+="ROLE"+a+":"+e.e(t.role)+e.nl()),t.organization&&(i+="ORG"+a+":"+e.e(t.organization)+e.nl()),t.url&&(i+="URL"+a+":"+e.e(t.url)+e.nl()),t.workUrl&&(i+="URL;type=WORK"+a+":"+e.e(t.workUrl)+e.nl()),t.note&&(i+="NOTE"+a+":"+e.e(t.note)+e.nl()),t.socialUrls)for(var s in t.socialUrls.keys())t.socialUrls.has(s)&&(i+="X-SOCIALPROFILE;TYPE="+s+":"+e.e(t.socialUrls.get(s))+e.nl());return t.source&&(i+="SOURCE"+a+":"+e.e(t.source)+e.nl()),o.skipRevision||(i+="REV:"+(new Date).toISOString()+e.nl()),t.organization&&!o.skipShowAs&&(i+="X-ABShowAs:COMPANY"+e.nl()),i+="END:VCARD"+e.nl()}}]),e}(),s=function(){function e(){n(this,e),this.uid=void 0,this.anniversary=void 0,this.birthday=void 0,this.cellPhone=void 0,this.pagerPhone=void 0,this.email=void 0,this.workEmail=void 0,this.firstName=void 0,this.formattedName=void 0,this.gender=void 0,this.homeAddress=void 0,this.homePhone=void 0,this.homeFax=void 0,this.lastName=void 0,this.logo=void 0,this.middleName=void 0,this.namePrefix=void 0,this.nameSuffix=void 0,this.nickname=void 0,this.note=void 0,this.organization=void 0,this.otherEmail=void 0,this.otherPhone=void 0,this.photo=void 0,this.role=void 0,this.socialUrls=void 0,this.source=void 0,this.title=void 0,this.url=void 0,this.workUrl=void 0,this.workAddress=void 0,this.workPhone=void 0,this.workFax=void 0,this.version="3"}return a(e,[{key:"getMajorVersion",value:function(){var e=this.version?this.version.split(".")[0]:"4";return isNaN(Number(e))?4:Number(e)}},{key:"getFormattedString",value:function(e){return l.getFormattedString(this,e)}}]),e}();o.d(t,"vCardAddressType",(function(){return r})),o.d(t,"vCard",(function(){return s})),o.d(t,"vCardFormatter",(function(){return l}))}]); |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("vcardsTs",[],t):"object"==typeof exports?exports.vcardsTs=t():e.vcardsTs=t()}(window,(function(){return function(e){var t={};function o(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=e,o.c=t,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,o){e.exports=o(1)},function(e,t,o){"use strict";var r;function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,o){return t&&i(e.prototype,t),o&&i(e,o),e}o.r(t),function(e){e.HOME="HOME",e.WORK="WORK"}(r||(r={}));var l=function(){function e(){n(this,e)}return a(e,null,[{key:"e",value:function(e){return e?("string"!=typeof e&&(e=""+e),e.replace(/\n/g,"\\n").replace(/,/g,"\\,").replace(/;/g,"\\;")):""}},{key:"nl",value:function(){return"\r\n"}},{key:"getFormattedPhoto",value:function(t,o,r,n,i){return t+(r>=4?n?";ENCODING=b;MEDIATYPE=image/":";MEDIATYPE=image/":3===r?n?";ENCODING=b;TYPE=":";TYPE=":n?";ENCODING=BASE64;":";")+i+":"+e.e(o)+e.nl()}},{key:"getFormattedAddress",value:function(t,o,r){if(!o.details)return"";var n="";return(o.details.label||o.details.street||o.details.city||o.details.stateProvince||o.details.postalCode||o.details.countryRegion)&&(r>=4?n="ADR"+t+";TYPE="+o.type+(o.details.label?';LABEL="'+e.e(o.details.label)+'"':"")+":"+e.e(o.details.poBox)+";"+e.e(o.details.extendedAddress)+";"+e.e(o.details.street)+";"+e.e(o.details.city)+";"+e.e(o.details.stateProvince)+";"+e.e(o.details.postalCode)+";"+e.e(o.details.countryRegion)+e.nl():(o.details.label&&(n="LABEL"+t+";TYPE="+o.type+":"+e.e(o.details.label)+e.nl()),n+="ADR"+t+";TYPE="+o.type+":;;"+e.e(o.details.street)+";"+e.e(o.details.city)+";"+e.e(o.details.stateProvince)+";"+e.e(o.details.postalCode)+";"+e.e(o.details.countryRegion)+e.nl())),n}},{key:"getFormattedDate",value:function(e){return e.getFullYear()+("0"+(e.getMonth()+1)).slice(-2)+("0"+e.getDate()).slice(-2)}},{key:"getFormattedString",value:function(t,o){null==o&&(o={skipCharset:!1,skipShowAs:!1,skipRevision:!1});var n=t.getMajorVersion(),i="";i+="BEGIN:VCARD"+e.nl(),i+="VERSION:"+t.version+e.nl();var a=n>=4||o.skipCharset?"":";CHARSET=UTF-8",l=t.formattedName||"";if(l||[t.firstName,t.middleName,t.lastName].map((function(e){return e||""})).forEach((function(e){e&&l&&(l+=" "),l+=e})),i+="FN"+a+":"+e.e(l)+e.nl(),i+="N"+a+":"+e.e(t.lastName)+";"+e.e(t.firstName)+";"+e.e(t.middleName)+";"+e.e(t.namePrefix)+";"+e.e(t.nameSuffix)+e.nl(),t.nickname&&n>=3&&(i+="NICKNAME"+a+":"+e.e(t.nickname)+e.nl()),t.gender&&(i+="GENDER:"+e.e(t.gender)+e.nl()),t.uid&&(i+="UID"+a+":"+e.e(t.uid)+e.nl()),t.birthday&&(i+="BDAY:"+e.getFormattedDate(t.birthday)+e.nl()),t.anniversary&&(i+="ANNIVERSARY:"+e.getFormattedDate(t.anniversary)+e.nl()),t.email&&(Array.isArray(t.email)||(t.email=[t.email]),t.email.forEach((function(t){i+=n>=4?"EMAIL"+a+";type=HOME:"+e.e(t)+e.nl():n>=3&&n<4?"EMAIL"+a+";type=HOME,INTERNET:"+e.e(t)+e.nl():"EMAIL"+a+";HOME;INTERNET:"+e.e(t)+e.nl()}))),t.workEmail&&(Array.isArray(t.workEmail)||(t.workEmail=[t.workEmail]),t.workEmail.forEach((function(t){i+=n>=4?"EMAIL"+a+";type=WORK:"+e.e(t)+e.nl():n>=3&&n<4?"EMAIL"+a+";type=WORK,INTERNET:"+e.e(t)+e.nl():"EMAIL"+a+";WORK;INTERNET:"+e.e(t)+e.nl()}))),t.otherEmail&&(Array.isArray(t.otherEmail)||(t.otherEmail=[t.otherEmail]),t.otherEmail.forEach((function(t){i+=n>=4?"EMAIL"+a+";type=OTHER:"+e.e(t)+e.nl():n>=3&&n<4?"EMAIL"+a+";type=OTHER,INTERNET:"+e.e(t)+e.nl():"EMAIL"+a+";OTHER;INTERNET:"+e.e(t)+e.nl()}))),t.logo&&t.logo.url&&(i+=e.getFormattedPhoto("LOGO",t.logo.url,n,t.logo.base64,t.logo.mediaType)),t.photo&&t.photo.url&&(i+=e.getFormattedPhoto("PHOTO",t.photo.url,n,t.photo.base64,t.photo.mediaType)),t.cellPhone&&(Array.isArray(t.cellPhone)||(t.cellPhone=[t.cellPhone]),t.cellPhone.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="voice,cell":tel:'+e.e(t)+e.nl():"TEL;TYPE=CELL:"+e.e(t)+e.nl()}))),t.pagerPhone&&(Array.isArray(t.pagerPhone)||(t.pagerPhone=[t.pagerPhone]),t.pagerPhone.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="pager,cell":tel:'+e.e(t)+e.nl():"TEL;TYPE=PAGER:"+e.e(t)+e.nl()}))),t.homePhone&&(Array.isArray(t.homePhone)||(t.homePhone=[t.homePhone]),t.homePhone.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="voice,home":tel:'+e.e(t)+e.nl():"TEL;TYPE=HOME,VOICE:"+e.e(t)+e.nl()}))),t.workPhone&&(Array.isArray(t.workPhone)||(t.workPhone=[t.workPhone]),t.workPhone.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="voice,work":tel:'+e.e(t)+e.nl():"TEL;TYPE=WORK,VOICE:"+e.e(t)+e.nl()}))),t.homeFax&&(Array.isArray(t.homeFax)||(t.homeFax=[t.homeFax]),t.homeFax.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="fax,home":tel:'+e.e(t)+e.nl():"TEL;TYPE=HOME,FAX:"+e.e(t)+e.nl()}))),t.workFax&&(Array.isArray(t.workFax)||(t.workFax=[t.workFax]),t.workFax.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="fax,work":tel:'+e.e(t)+e.nl():"TEL;TYPE=WORK,FAX:"+e.e(t)+e.nl()}))),t.otherPhone&&(Array.isArray(t.otherPhone)||(t.otherPhone=[t.otherPhone]),t.otherPhone.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="voice,other":tel:'+e.e(t)+e.nl():"TEL;TYPE=OTHER:"+e.e(t)+e.nl()}))),[{details:t.homeAddress,type:r.HOME},{details:t.workAddress,type:r.WORK}].filter((function(e){return e.details})).forEach((function(t){i+=e.getFormattedAddress(a,t,n)})),t.title&&(i+="TITLE"+a+":"+e.e(t.title)+e.nl()),t.role&&(i+="ROLE"+a+":"+e.e(t.role)+e.nl()),t.organization&&(i+="ORG"+a+":"+e.e(t.organization)+e.nl()),t.url&&(i+="URL"+a+":"+e.e(t.url)+e.nl()),t.workUrl&&(i+="URL;type=WORK"+a+":"+e.e(t.workUrl)+e.nl()),t.note&&(i+="NOTE"+a+":"+e.e(t.note)+e.nl()),t.socialUrls)for(var s in t.socialUrls.keys())t.socialUrls.has(s)&&(i+="X-SOCIALPROFILE;TYPE="+s+":"+e.e(t.socialUrls.get(s))+e.nl());return t.source&&(i+="SOURCE"+a+":"+e.e(t.source)+e.nl()),o.skipRevision||(i+="REV:"+(new Date).toISOString()+e.nl()),t.organization&&!o.skipShowAs&&(i+="X-ABShowAs:COMPANY"+e.nl()),i+="END:VCARD"+e.nl()}}]),e}(),s=function(){function e(){n(this,e),this.uid=void 0,this.anniversary=void 0,this.birthday=void 0,this.cellPhone=void 0,this.pagerPhone=void 0,this.email=void 0,this.workEmail=void 0,this.firstName=void 0,this.formattedName=void 0,this.gender=void 0,this.homeAddress=void 0,this.homePhone=void 0,this.homeFax=void 0,this.lastName=void 0,this.logo=void 0,this.middleName=void 0,this.namePrefix=void 0,this.nameSuffix=void 0,this.nickname=void 0,this.note=void 0,this.organization=void 0,this.otherEmail=void 0,this.otherPhone=void 0,this.photo=void 0,this.role=void 0,this.socialUrls=void 0,this.source=void 0,this.title=void 0,this.url=void 0,this.workUrl=void 0,this.workAddress=void 0,this.workPhone=void 0,this.workFax=void 0,this.version="3"}return a(e,[{key:"getMajorVersion",value:function(){var e=this.version?this.version.split(".")[0]:"4";return isNaN(Number(e))?4:Number(e)}},{key:"getFormattedString",value:function(){return l.getFormattedString(this)}}]),e}();o.d(t,"vCardAddressType",(function(){return r})),o.d(t,"vCard",(function(){return s})),o.d(t,"vCardFormatter",(function(){return l}))}])})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("vcardsTs",[],t):"object"==typeof exports?exports.vcardsTs=t():e.vcardsTs=t()}(window,(function(){return function(e){var t={};function o(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=e,o.c=t,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,o){e.exports=o(1)},function(e,t,o){"use strict";var r;function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,o){return t&&i(e.prototype,t),o&&i(e,o),e}o.r(t),function(e){e.HOME="HOME",e.WORK="WORK"}(r||(r={}));var l=function(){function e(){n(this,e)}return a(e,null,[{key:"e",value:function(e){return e?("string"!=typeof e&&(e=""+e),e.replace(/\n/g,"\\n").replace(/,/g,"\\,").replace(/;/g,"\\;")):""}},{key:"nl",value:function(){return"\r\n"}},{key:"getFormattedPhoto",value:function(t,o,r,n,i){return t+(r>=4?n?";ENCODING=b;MEDIATYPE=image/":";MEDIATYPE=image/":3===r?n?";ENCODING=b;TYPE=":";TYPE=":n?";ENCODING=BASE64;":";")+i+":"+e.e(o)+e.nl()}},{key:"getFormattedAddress",value:function(t,o,r){if(!o.details)return"";var n="";return(o.details.label||o.details.street||o.details.city||o.details.stateProvince||o.details.postalCode||o.details.countryRegion)&&(r>=4?n="ADR"+t+";TYPE="+o.type+(o.details.label?';LABEL="'+e.e(o.details.label)+'"':"")+":"+e.e(o.details.poBox)+";"+e.e(o.details.extendedAddress)+";"+e.e(o.details.street)+";"+e.e(o.details.city)+";"+e.e(o.details.stateProvince)+";"+e.e(o.details.postalCode)+";"+e.e(o.details.countryRegion)+e.nl():(o.details.label&&(n="LABEL"+t+";TYPE="+o.type+":"+e.e(o.details.label)+e.nl()),n+="ADR"+t+";TYPE="+o.type+":;;"+e.e(o.details.street)+";"+e.e(o.details.city)+";"+e.e(o.details.stateProvince)+";"+e.e(o.details.postalCode)+";"+e.e(o.details.countryRegion)+e.nl())),n}},{key:"getFormattedDate",value:function(e){return e.getFullYear()+("0"+(e.getMonth()+1)).slice(-2)+("0"+e.getDate()).slice(-2)}},{key:"getFormattedString",value:function(t,o){null==o&&(o={skipCharset:!1,skipShowAs:!1,skipRevision:!1});var n=t.getMajorVersion(),i="";i+="BEGIN:VCARD"+e.nl(),i+="VERSION:"+t.version+e.nl();var a=n>=4||o.skipCharset?"":";CHARSET=UTF-8",l=t.formattedName||"";if(l||[t.firstName,t.middleName,t.lastName].map((function(e){return e||""})).forEach((function(e){e&&l&&(l+=" "),l+=e})),i+="FN"+a+":"+e.e(l)+e.nl(),i+="N"+a+":"+e.e(t.lastName)+";"+e.e(t.firstName)+";"+e.e(t.middleName)+";"+e.e(t.namePrefix)+";"+e.e(t.nameSuffix)+e.nl(),t.nickname&&n>=3&&(i+="NICKNAME"+a+":"+e.e(t.nickname)+e.nl()),t.gender&&(i+="GENDER:"+e.e(t.gender)+e.nl()),t.uid&&(i+="UID"+a+":"+e.e(t.uid)+e.nl()),t.birthday&&(i+="BDAY:"+e.getFormattedDate(t.birthday)+e.nl()),t.anniversary&&(i+="ANNIVERSARY:"+e.getFormattedDate(t.anniversary)+e.nl()),t.email&&(Array.isArray(t.email)||(t.email=[t.email]),t.email.forEach((function(t){i+=n>=4?"EMAIL"+a+";type=HOME:"+e.e(t)+e.nl():n>=3&&n<4?"EMAIL"+a+";type=HOME,INTERNET:"+e.e(t)+e.nl():"EMAIL"+a+";HOME;INTERNET:"+e.e(t)+e.nl()}))),t.workEmail&&(Array.isArray(t.workEmail)||(t.workEmail=[t.workEmail]),t.workEmail.forEach((function(t){i+=n>=4?"EMAIL"+a+";type=WORK:"+e.e(t)+e.nl():n>=3&&n<4?"EMAIL"+a+";type=WORK,INTERNET:"+e.e(t)+e.nl():"EMAIL"+a+";WORK;INTERNET:"+e.e(t)+e.nl()}))),t.otherEmail&&(Array.isArray(t.otherEmail)||(t.otherEmail=[t.otherEmail]),t.otherEmail.forEach((function(t){i+=n>=4?"EMAIL"+a+";type=OTHER:"+e.e(t)+e.nl():n>=3&&n<4?"EMAIL"+a+";type=OTHER,INTERNET:"+e.e(t)+e.nl():"EMAIL"+a+";OTHER;INTERNET:"+e.e(t)+e.nl()}))),t.logo&&t.logo.url&&(i+=e.getFormattedPhoto("LOGO",t.logo.url,n,t.logo.base64,t.logo.mediaType)),t.photo&&t.photo.url&&(i+=e.getFormattedPhoto("PHOTO",t.photo.url,n,t.photo.base64,t.photo.mediaType)),t.cellPhone&&(Array.isArray(t.cellPhone)||(t.cellPhone=[t.cellPhone]),t.cellPhone.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="voice,cell":tel:'+e.e(t)+e.nl():"TEL;TYPE=CELL:"+e.e(t)+e.nl()}))),t.pagerPhone&&(Array.isArray(t.pagerPhone)||(t.pagerPhone=[t.pagerPhone]),t.pagerPhone.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="pager,cell":tel:'+e.e(t)+e.nl():"TEL;TYPE=PAGER:"+e.e(t)+e.nl()}))),t.homePhone&&(Array.isArray(t.homePhone)||(t.homePhone=[t.homePhone]),t.homePhone.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="voice,home":tel:'+e.e(t)+e.nl():"TEL;TYPE=HOME,VOICE:"+e.e(t)+e.nl()}))),t.workPhone&&(Array.isArray(t.workPhone)||(t.workPhone=[t.workPhone]),t.workPhone.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="voice,work":tel:'+e.e(t)+e.nl():"TEL;TYPE=WORK,VOICE:"+e.e(t)+e.nl()}))),t.homeFax&&(Array.isArray(t.homeFax)||(t.homeFax=[t.homeFax]),t.homeFax.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="fax,home":tel:'+e.e(t)+e.nl():"TEL;TYPE=HOME,FAX:"+e.e(t)+e.nl()}))),t.workFax&&(Array.isArray(t.workFax)||(t.workFax=[t.workFax]),t.workFax.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="fax,work":tel:'+e.e(t)+e.nl():"TEL;TYPE=WORK,FAX:"+e.e(t)+e.nl()}))),t.otherPhone&&(Array.isArray(t.otherPhone)||(t.otherPhone=[t.otherPhone]),t.otherPhone.forEach((function(t){i+=n>=4?'TEL;VALUE=uri;TYPE="voice,other":tel:'+e.e(t)+e.nl():"TEL;TYPE=OTHER:"+e.e(t)+e.nl()}))),[{details:t.homeAddress,type:r.HOME},{details:t.workAddress,type:r.WORK}].filter((function(e){return e.details})).forEach((function(t){i+=e.getFormattedAddress(a,t,n)})),t.title&&(i+="TITLE"+a+":"+e.e(t.title)+e.nl()),t.role&&(i+="ROLE"+a+":"+e.e(t.role)+e.nl()),t.organization&&(i+="ORG"+a+":"+e.e(t.organization)+e.nl()),t.url&&(i+="URL"+a+":"+e.e(t.url)+e.nl()),t.workUrl&&(i+="URL;type=WORK"+a+":"+e.e(t.workUrl)+e.nl()),t.note&&(i+="NOTE"+a+":"+e.e(t.note)+e.nl()),t.socialUrls)for(var s in t.socialUrls.keys())t.socialUrls.has(s)&&(i+="X-SOCIALPROFILE;TYPE="+s+":"+e.e(t.socialUrls.get(s))+e.nl());return t.source&&(i+="SOURCE"+a+":"+e.e(t.source)+e.nl()),o.skipRevision||(i+="REV:"+(new Date).toISOString()+e.nl()),t.organization&&!o.skipShowAs&&(i+="X-ABShowAs:COMPANY"+e.nl()),i+="END:VCARD"+e.nl()}}]),e}(),s=function(){function e(){n(this,e),this.uid=void 0,this.anniversary=void 0,this.birthday=void 0,this.cellPhone=void 0,this.pagerPhone=void 0,this.email=void 0,this.workEmail=void 0,this.firstName=void 0,this.formattedName=void 0,this.gender=void 0,this.homeAddress=void 0,this.homePhone=void 0,this.homeFax=void 0,this.lastName=void 0,this.logo=void 0,this.middleName=void 0,this.namePrefix=void 0,this.nameSuffix=void 0,this.nickname=void 0,this.note=void 0,this.organization=void 0,this.otherEmail=void 0,this.otherPhone=void 0,this.photo=void 0,this.role=void 0,this.socialUrls=void 0,this.source=void 0,this.title=void 0,this.url=void 0,this.workUrl=void 0,this.workAddress=void 0,this.workPhone=void 0,this.workFax=void 0,this.version="3"}return a(e,[{key:"getMajorVersion",value:function(){var e=this.version?this.version.split(".")[0]:"4";return isNaN(Number(e))?4:Number(e)}},{key:"getFormattedString",value:function(e){return l.getFormattedString(this,e)}}]),e}();o.d(t,"vCardAddressType",(function(){return r})),o.d(t,"vCard",(function(){return s})),o.d(t,"vCardFormatter",(function(){return l}))}])})); |
import { vCardMailingAddress, vCardPhoto } from "./types"; | ||
import { vCardFormattingOptions } from "./types"; | ||
export declare class vCard { | ||
@@ -39,4 +40,4 @@ constructor(); | ||
getMajorVersion(): number; | ||
getFormattedString(): string; | ||
getFormattedString(options?: vCardFormattingOptions): string; | ||
} | ||
//# sourceMappingURL=vCard.d.ts.map |
@@ -70,4 +70,4 @@ "use strict"; | ||
key: "getFormattedString", | ||
value: function getFormattedString() { | ||
return _vCardFormatter.vCardFormatter.getFormattedString(this); | ||
value: function getFormattedString(options) { | ||
return _vCardFormatter.vCardFormatter.getFormattedString(this, options); | ||
} | ||
@@ -74,0 +74,0 @@ }]); |
{ | ||
"name": "vcards-ts", | ||
"version": "1.0.2", | ||
"version": "1.0.4", | ||
"main": "dist/umd/vCards-ts.js", | ||
@@ -5,0 +5,0 @@ "description": "TypeScript vCard integration", |
Sorry, the diff of this file is not supported yet
38166
16
464