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

Map file extension to content type #133

Closed
Cre3per opened this issue Feb 13, 2023 · 2 comments · Fixed by #134
Closed

Map file extension to content type #133

Cre3per opened this issue Feb 13, 2023 · 2 comments · Fixed by #134
Labels
enhancement New feature or request

Comments

@Cre3per
Copy link
Contributor

Cre3per commented Feb 13, 2023

denoland/deno#17172 adds --ext to deno, eg.

deno run --ext js mod

--ext needs to map file extensions to mime types

The mapping function in deno is incomplete and temporary.

deno_ast's MediaType already maps module specifiers and mime types to MediaType. I think this is a good place to map

  • file extensions to MediaType
  • MediaType to mime types
@Cre3per
Copy link
Contributor Author

Cre3per commented Feb 13, 2023

I'd like to work on this.

There is no 1:1 mapping between file extensions and mime types, eg. application/typescript and text/typescript both have a ".ts" file extension. For a start, I'll write a mapping function based on the mime types in from_content_type()

@dsherret
Copy link
Member

Sounds good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants