@@ -52,13 +52,13 @@ class Address {
52
52
* Builds an address object for a contact.
53
53
* A contact can contain multiple addresses.
54
54
*
55
- * @param {String } country Full country name
56
- * @param {String } country_code Two-letter country abbreviation
57
- * @param {String } state State abbreviation
58
- * @param {String } city City name
59
- * @param {String } street Street number and name
60
- * @param {String } zip ZIP code
61
- * @param {String } type Address type. Standard Values: HOME, WORK
55
+ * @param {String } [ country] Full country name
56
+ * @param {String } [ country_code] Two-letter country abbreviation
57
+ * @param {String } [ state] State abbreviation
58
+ * @param {String } [ city] City name
59
+ * @param {String } [ street] Street number and name
60
+ * @param {String } [ zip] ZIP code
61
+ * @param {String } [ type] Address type. Standard Values: HOME, WORK
62
62
*/
63
63
constructor ( country , country_code , state , city , street , zip , type ) {
64
64
if ( country ) this . country = country ;
@@ -85,9 +85,9 @@ class Birthday {
85
85
* @throws {Error } If the year, month, or day don't have a valid length
86
86
*/
87
87
constructor ( year , month , day ) {
88
- if ( year . length !== 4 ) throw new Error ( "Year must be 4 digits" ) ;
89
- if ( month . length !== 2 ) throw new Error ( "Month must be 2 digits" ) ;
90
- if ( day . length !== 2 ) throw new Error ( "Day must be 2 digits" ) ;
88
+ if ( year ? .length !== 4 ) throw new Error ( "Year must be 4 digits" ) ;
89
+ if ( month ? .length !== 2 ) throw new Error ( "Month must be 2 digits" ) ;
90
+ if ( day ? .length !== 2 ) throw new Error ( "Day must be 2 digits" ) ;
91
91
this . birthday = `${ year } -${ month } -${ day } ` ;
92
92
this . _ = "birthday" ;
93
93
}
@@ -101,8 +101,8 @@ class Email {
101
101
* Builds an email object for a contact.
102
102
* A contact can contain multiple emails.
103
103
*
104
- * @param {String } email Email address
105
- * @param {String } type Email type. Standard Values: HOME, WORK
104
+ * @param {String } [ email] Email address
105
+ * @param {String } [ type] Email type. Standard Values: HOME, WORK
106
106
*/
107
107
constructor ( email , type ) {
108
108
if ( email ) this . email = email ;
@@ -150,9 +150,9 @@ class Organization {
150
150
/**
151
151
* Builds an organization object for a contact
152
152
*
153
- * @param {String } company Name of the contact's company
154
- * @param {String } department Name of the contact's department
155
- * @param {String } title Contact's business title
153
+ * @param {String } [ company] Name of the contact's company
154
+ * @param {String } [ department] Name of the contact's department
155
+ * @param {String } [ title] Contact's business title
156
156
*/
157
157
constructor ( company , department , title ) {
158
158
if ( company ) this . company = company ;
@@ -170,9 +170,9 @@ class Phone {
170
170
* Builds a phone object for a contact.
171
171
* A contact can contain multiple phones.
172
172
*
173
- * @param {String } phone Phone number, automatically populated with the wa_id value as a formatted phone number
174
- * @param {String } type Phone type. Standard Values: CELL, MAIN, IPHONE, HOME, WORK
175
- * @param {String } wa_id WhatsApp ID. If present, number will be ignored. Usually it's the numeric part of the phone number
173
+ * @param {String } [ phone] Phone number, automatically populated with the wa_id value as a formatted phone number
174
+ * @param {String } [ type] Phone type. Standard Values: CELL, MAIN, IPHONE, HOME, WORK
175
+ * @param {String } [ wa_id] WhatsApp ID. If present, number will be ignored. Usually it's the numeric part of the phone number
176
176
*/
177
177
constructor ( phone , type , wa_id ) {
178
178
if ( phone && ! wa_id ) this . phone = phone ;
@@ -190,8 +190,8 @@ class Url {
190
190
* Builds an url object for a contact.
191
191
* A contact can contain multiple urls.
192
192
*
193
- * @param {String } url URL
194
- * @param {String } type URL type. Standard Values: HOME, WORK
193
+ * @param {String } [ url] URL
194
+ * @param {String } [ type] URL type. Standard Values: HOME, WORK
195
195
*/
196
196
constructor ( url , type ) {
197
197
if ( url ) this . url = url ;
0 commit comments