-
Notifications
You must be signed in to change notification settings - Fork 46
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
feat: add as_content_type() and make from_path() public #134
feat: add as_content_type() and make from_path() public #134
Conversation
The mimemap source code in the h2o server may be helpful. It may be a good idea to add the following MIME in
And how about also supporting the above MIME in FYI: |
@petamoriken deno_ast provides functionality for I had a quick look through media types ending in |
@Cre3per I suggested this because I thought it would be useful for displaying JSON in LSP and handling JSON in Import Assetions when developing a web application that uses |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks @Cre3per!
Closes #133
The mappings in
as_content_type()
are a suggestion based onfrom_content_type()
and web searches.Potential issues
from_file_extension()
is case-sensitive to file extensions whilefrom_path()
is case-insensitive.If the crate user has non-lower-case extensions, they can transform them once to avoid every library function from having to do the transformation.
Additional changes
Changed return type of
as_ts_extension()
to'static
. If this change is wrong, I'll also need to remove the'static
fromas_content_type()
.