[@types/luxon] Error classes not included in types #74361
Replies: 2 comments
- 7440
-
|
Thanks for the discussion about "luxon", some useful links for everyone: Pinging the DT module owners: @CarsonF, @peterblazejewicz. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I don't know how I thought that was the case, but it isn't. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I noticed that the errors from Luxon are not included in the type files. They're marked as '@Private' in the JSdocs in the source, but I'm pretty sure that's just to avoid having to document them, as the first line in the file says.
Since I like using
Settings.throwOnInvalid = true, I would like to catch Luxon errors by checking the error type with instanceof. The type can be imported in javascript, but the typing package does not include the error classes.Source: https://github.com/moment/luxon/blob/master/src/errors.js
Beta Was this translation helpful? Give feedback.
All reactions