Skip to content

Commit

Permalink
fix: Allow to set null values within object constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
sebbo2002 committed Mar 28, 2021
1 parent 1134772 commit 8b87183
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 53 deletions.
18 changes: 9 additions & 9 deletions src/alarm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,15 @@ export default class ICalAlarm {
throw new Error('`event` option required!');
}

data.type && this.type(data.type);
data.trigger && this.trigger(data.trigger);
data.triggerBefore && this.triggerBefore(data.triggerBefore);
data.triggerAfter && this.triggerAfter(data.triggerAfter);
data.repeat && this.repeat(data.repeat);
data.interval && this.interval(data.interval);
data.attach && this.attach(data.attach);
data.description && this.description(data.description);
data.x && this.x(data.x);
data.type !== undefined && this.type(data.type);
data.trigger !== undefined && this.trigger(data.trigger);
data.triggerBefore !== undefined && this.triggerBefore(data.triggerBefore);
data.triggerAfter !== undefined && this.triggerAfter(data.triggerAfter);
data.repeat !== undefined && this.repeat(data.repeat);
data.interval !== undefined && this.interval(data.interval);
data.attach !== undefined && this.attach(data.attach);
data.description !== undefined && this.description(data.description);
data.x !== undefined && this.x(data.x);
}


Expand Down
20 changes: 10 additions & 10 deletions src/attendee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,18 @@ export default class ICalAttendee {
throw new Error('`event` option required!');
}

data.name && this.name(data.name);
data.email && this.email(data.email);
data.mailto && this.mailto(data.mailto);
data.status && this.status(data.status);
data.role && this.role(data.role);
data.rsvp && this.rsvp(data.rsvp);
data.type && this.type(data.type);
data.delegatedTo && this.delegatedTo(data.delegatedTo);
data.delegatedFrom && this.delegatedFrom(data.delegatedFrom);
data.name !== undefined && this.name(data.name);
data.email !== undefined && this.email(data.email);
data.mailto !== undefined && this.mailto(data.mailto);
data.status !== undefined && this.status(data.status);
data.role !== undefined && this.role(data.role);
data.rsvp !== undefined && this.rsvp(data.rsvp);
data.type !== undefined && this.type(data.type);
data.delegatedTo !== undefined && this.delegatedTo(data.delegatedTo);
data.delegatedFrom !== undefined && this.delegatedFrom(data.delegatedFrom);
data.delegatesTo && this.delegatesTo(data.delegatesTo);
data.delegatesFrom && this.delegatesFrom(data.delegatesFrom);
data.x && this.x(data.x);
data.x !== undefined && this.x(data.x);
}


Expand Down
20 changes: 10 additions & 10 deletions src/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,16 @@ export default class ICalCalendar {
x: []
};

data.prodId && this.prodId(data.prodId);
data.method && this.method(data.method);
data.name && this.name(data.name);
data.description && this.description(data.description);
data.timezone && this.timezone(data.timezone);
data.url && this.url(data.url);
data.scale && this.scale(data.scale);
data.ttl && this.ttl(data.ttl);
data.events && this.events(data.events);
data.x && this.x(data.x);
data.prodId !== undefined && this.prodId(data.prodId);
data.method !== undefined && this.method(data.method);
data.name !== undefined && this.name(data.name);
data.description !== undefined && this.description(data.description);
data.timezone !== undefined && this.timezone(data.timezone);
data.url !== undefined && this.url(data.url);
data.scale !== undefined && this.scale(data.scale);
data.ttl !== undefined && this.ttl(data.ttl);
data.events !== undefined && this.events(data.events);
data.x !== undefined && this.x(data.x);
}


Expand Down
2 changes: 1 addition & 1 deletion src/category.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default class ICalCategory {
name: null
};

data.name && this.name(data.name);
data.name !== undefined && this.name(data.name);
}


Expand Down
46 changes: 23 additions & 23 deletions src/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,30 +199,30 @@ export default class ICalEvent {
}

data.id && this.id(data.id);
data.sequence && this.sequence(data.sequence);
data.sequence !== undefined && this.sequence(data.sequence);
data.start && this.start(data.start);
data.end && this.end(data.end);
data.recurrenceId && this.recurrenceId(data.recurrenceId);
data.timezone && this.timezone(data.timezone);
data.stamp && this.stamp(data.stamp);
data.allDay && this.allDay(data.allDay);
data.floating && this.floating(data.floating);
data.repeating && this.repeating(data.repeating);
data.summary && this.summary(data.summary);
data.location && this.location(data.location);
data.description && this.description(data.description);
data.organizer && this.organizer(data.organizer);
data.attendees && this.attendees(data.attendees);
data.alarms && this.alarms(data.alarms);
data.categories && this.categories(data.categories);
data.status && this.status(data.status);
data.busystatus && this.busystatus(data.busystatus);
data.priority && this.priority(data.priority);
data.url && this.url(data.url);
data.transparency && this.transparency(data.transparency);
data.created && this.created(data.created);
data.lastModified && this.lastModified(data.lastModified);
data.x && this.x(data.x);
data.end !== undefined && this.end(data.end);
data.recurrenceId !== undefined && this.recurrenceId(data.recurrenceId);
data.timezone !== undefined && this.timezone(data.timezone);
data.stamp !== undefined && this.stamp(data.stamp);
data.allDay !== undefined && this.allDay(data.allDay);
data.floating !== undefined && this.floating(data.floating);
data.repeating !== undefined && this.repeating(data.repeating);
data.summary !== undefined && this.summary(data.summary);
data.location !== undefined && this.location(data.location);
data.description !== undefined && this.description(data.description);
data.organizer !== undefined && this.organizer(data.organizer);
data.attendees !== undefined && this.attendees(data.attendees);
data.alarms !== undefined && this.alarms(data.alarms);
data.categories !== undefined && this.categories(data.categories);
data.status !== undefined && this.status(data.status);
data.busystatus !== undefined && this.busystatus(data.busystatus);
data.priority !== undefined && this.priority(data.priority);
data.url !== undefined && this.url(data.url);
data.transparency !== undefined && this.transparency(data.transparency);
data.created !== undefined && this.created(data.created);
data.lastModified !== undefined && this.lastModified(data.lastModified);
data.x !== undefined && this.x(data.x);
}

/**
Expand Down

0 comments on commit 8b87183

Please sign in to comment.