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

Add in new public function - lookupAll(). #33

Open
wants to merge 4 commits into
base: master
from

Conversation

@pseudoramble
Copy link

pseudoramble commented May 6, 2017

This is to address #23. The goal of this PR is add a function for looking up all MIME types associated to a file extension.

This would be useful for me to be able to create sets of acceptable MIME types for file validations without having to manually look up each potential MIME type with it. This happens to come up in a few examples (including bmp, rtf, and mp3 to name a few).

Hoping to have a conversation about what's good or not. I thought an initial implementation would be a good starting point.

Thanks for your work on this module!

@pseudoramble

This comment has been minimized.

Copy link
Author

pseudoramble commented May 13, 2017

Any questions about the PR? Or are there any changes I should make for this PR?

@pseudoramble

This comment has been minimized.

Copy link
Author

pseudoramble commented Jun 15, 2017

Any chance somebody can take a look at this? It still would be valuable to us if we can merge it in.

@dougwilson

This comment has been minimized.

Copy link
Member

dougwilson commented Jun 15, 2017

I don't think I saw an email previously; I'll take a look.

@dougwilson dougwilson self-requested a review Jun 15, 2017
@dougwilson dougwilson added the pr label Jun 15, 2017
@pseudoramble

This comment has been minimized.

Copy link
Author

pseudoramble commented Jul 18, 2017

Hi again. Any chance this can be looked at?

@broofa

This comment has been minimized.

Copy link

broofa commented Aug 16, 2017

Conflicts over an extension are rarely the result of an actual difference in media types. Rather, they stem from uncertainty over what the mime type string should be. E.g. audio/wav vs audio/wave for the WAV file type. Same file type, same extension, just some confusion around the type string.

For v2 of the 'mime' module, I'm taking the stance that extension<->type string mappings should be deterministic and, thus, will be proactively (and arguably arbitrarily) resolving any conflicts as part of the build step in that module. This would make a lookupAll() method unnecessary in that module, as there will never be more than one type for a given extension. See broofa/node-mime#162 for details.

@iolivia

This comment has been minimized.

Copy link

iolivia commented Jan 9, 2019

is this ready to be merged? would be very useful!

@blackholegalaxy

This comment has been minimized.

Copy link

blackholegalaxy commented Apr 7, 2019

Any news on that? For example .csv can be text/csv or application/vnd.ms-excel depending on OS. This improvement would be very useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.