You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This line in alarm.ts makes it impossible to add an alarm with a trigger of 0 (the time of the event).
if(!trigger){this.data.trigger=null;}
Attempting to do so results in a runtime error: Error: No value for 'trigger' in ICalAlarm given!.
Also, I understand that this may be a large undertaking at this point, but this library would be a lot safer to use in production if runtime errors were kept to an absolute minimum. Ideally, if all arguments are typed correctly, I would expect a library like this to never produce a runtime error except in exceptional circumstances.
I noticed a few places where the types are contradictory to what ical-generator expects. For instance, type is optional on ICalAlarmData but produces a runtime error if omitted. Additionally, setting the type to 'display' is rejected by TypeScript.
constalarm: ICalAlarmData={type: 'display',// Type '"display"' is not assignable to type 'ICalAlarmType | null | undefined'trigger: 1,};
The text was updated successfully, but these errors were encountered:
Duplicate of #344 (which was closed because I have it on my list, but I reopened it just now for better visibility). I collected a ton of breaking changes which I'm working on, but due to limited time and other project what's not finished yet. I try to publish it within this year, sorry about that.
I just pushed a preview of ical-generator v6 to develop, which should fix this issue. I would be happy if you could test the new version and give me some feedback. You can install the version with npm i ical-generator@next. All changes in this release can be found here.
This line in alarm.ts makes it impossible to add an alarm with a trigger of
0
(the time of the event).Attempting to do so results in a runtime error:
Error: No value for 'trigger' in ICalAlarm given!
.Also, I understand that this may be a large undertaking at this point, but this library would be a lot safer to use in production if runtime errors were kept to an absolute minimum. Ideally, if all arguments are typed correctly, I would expect a library like this to never produce a runtime error except in exceptional circumstances.
I noticed a few places where the types are contradictory to what
ical-generator
expects. For instance,type
is optional on ICalAlarmData but produces a runtime error if omitted. Additionally, setting thetype
to'display'
is rejected by TypeScript.The text was updated successfully, but these errors were encountered: