Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve strict mode and error collecting #413

Open
kewisch opened this issue Jan 12, 2020 · 0 comments
Open

Improve strict mode and error collecting #413

kewisch opened this issue Jan 12, 2020 · 0 comments

Comments

@kewisch
Copy link
Owner

kewisch commented Jan 12, 2020

In #186 we added a strict/lenient mode for the parser. This is a good first step for making things more configurable, but it isn't great overall. While implementing I also noticed that "strict" mode isn't actually that strict. There are various length checks being skipped and the converted values are not actually validated.

One possible approach would be to have icalSet in the design data be the lenient set, and add a strictIcalSet that does additional checks, including all necessary length and data type checks. The lenient one would accept a date as date-time and vice versa. You'd then be able to pass a specific set to ICAL.parse. Another approach might just be a strict flag on ICAL.parse, that would select the set automatically.

Then again, some folks might want lenient mode, but not as lenient that it would accept all types. Another idea might be an error collector that would have a function that would be able to resolve certain errors. One provided resolver might be one that swaps date/date-time accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant