-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
fix: fix marked types #3103
fix: fix marked types #3103
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
# [11.0.0](v10.0.0...v11.0.0) (2023-11-29) ### Bug Fixes * clean up rules so they can be typed ([#3087](#3087)) ([175fc0c](175fc0c)) * fix marked types ([#3103](#3103)) ([edae309](edae309)) ### BREAKING CHANGES * Lexer.rules object has been changed so it can be properly types. Some intermediate rules have been removed.
Well, with version 11 I have to cast the result to string to have it works:
Never needed before. |
Yes but it is actually correctly typed now. Before it would be typed as a string even though it could return a Promise. It would be great if typescript provided a way to return the type based on |
Ah, this explain everything and I'm happy with the cast solution. |
Replaces #213 Please see this issue for context: markedjs/marked#3103
How about using a conditional type?
|
Marked version: 10.0.0
Description
Fix
marked
andmarked.parse
types.async: false
could still return aPromise<string>
if an extension setsasync: true
.Contributor
Committer
In most cases, this should be a different person than the contributor.