marcelwaldvogel / vcard4-ts Goto Github PK
View Code? Open in Web Editor NEWA vCard 4.0 library with type safety first
License: MIT License
A vCard 4.0 library with type safety first
License: MIT License
README about API is outdated/incomplete
RFC6868 describes parameter value escaping:
^n
to \n
^^
to ^
^'
to "
^
escaping character!)Nag on "everything else"?
Two approaches
groups?: Record<string, PartialVCard>;
property on vCards, which includes the grouped properties. Then, user code could decide whether it wantsgroup
field in properties, orgroups
and then ignore all values which have a group
fieldgroupVCard()
function, which groups all entries by group name (and those without, into ungrouped
) into a Record<string, PartialVCard>
I am currently favoring 2, as groups are rarely used and most consumers will not want to bother about it. This also reduces code size for group-agnostic consumers.
Maybe generate a text/vcard
representation out of the structure
RFC6473 defines the additional KIND
application
.
So that e.g. EMAIL[0]
refers to the highest-priority email address.
Is shorter and probably more appropriate.
RFC6715 defines the Open Mobile Alliance Converged Address Book extensions:
EXPERTISE
, cardinality *
, single text valueHOBBY
, cardinality *
, single text valueINTEREST
, cardinality *
, single text valueORG-DIRECTORY
, cardinality *
, a single URI valueINDEX
, strictly positive integer representing UI ordering of the value (may contradict PREF
ordering)LEVEL
, one of beginner
, average
, expert
, high
, medium
, low
Maybe the additional parser logic is minimal, after having abstracted the type information
RFC8605 defines the following:
CONTACT-URI
, cardinality *
, a single URI valueCC
(two-letter country code) parameter on ADR
According to the spec, the line TEL;TYPE="work,fax";PREF=1:+45 1234 1234
is a valid result to represent "type parameter values specified as a parameter list (e.g., TYPE=text;TYPE=voice) or as a list (e.g., TYPE="text,voice")".
However, vcard4-ts logs this nag:
{
"key":"PARAM_UNESCAPED_COMMA",
"description": "Unescaped comma in parameter value",
"isError": false,
"attributes": {
"property": "TEL",
"parameter": "TYPE",
"line": "TEL;TYPE=\"work,fax\";PREF=1:+45 1234 1234"
}
}
Am I misunderstanding something, or can I safely ignore this nag?
RFC6474 defines the following additional properties:
BIRTHPLACE
, cardinality *1
, single text (or URI) valueDEATHPLACE
, cardinality *1
, single text (or URI) valueDEATHDATE
, cardinality *1
, single date-and-or-time (or text) valueObservation about vCard format: There is no possibility to have multilingual place names or death date descriptions, as this would require *
cardinality (which would in turn cause confusions, as most humans are only ever born once and die once). For multilingual representations, something like a CONTENTS[fr]=Schaffhouse
parameter would be useful (using CONTENTS
, as the more natural VALUE
defines the data type of the VALUE
).
RFC7852 defines the main-number
TYPE
to the TEL
property.
I'm trying to use this package inside oclif, but I'm hitting this error. Essentially it doesn't support loading es modules. Despite the fact that this module is TypeScript and my code is TypeScript, the modules won't play nice.
I don't fully understand the ins and outs. I guess that you're only publishing an ESM module which is the latest and greatest, and oclif is using some older module loading strategy which won't play nice.
Question, would you be open to publishing a dual build module? For inspiration, I've been able to import tsdav without issue in oclif.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.