-
-
Notifications
You must be signed in to change notification settings - Fork 318
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 getExtensions()
method that returns all extensions for a given mime type
#254
Comments
[My apologies for the late reply. This module is pretty stable these days, so I tend not to pay too much attention to it.] Edited title to reflect the fact changing the behavior of That said, I'm struggling to convince myself this is a good idea. I know it seems like a trivial change, but hear me out... For starters, you can get this information w/out having to make this change. E.g. There's also the question of whether enough people care about this to justify expanding the API surface. E.g. jshttp/mime-types#33 has been up for four years. 3-4 people have commented or liked that issue, but that's not a lot of activity for a project that has ~1,000 stars, 10M dependent projects in github, and 10M's downloads/week on NPM. I'm also a little concerned that, in providing access to "all extensions", users are going to expect all of the extensions that might represent a given type. In looking at the list of types that have > 1 extension (below), I worry that it's not as comprehensive as it should be. E.g. The extensions for I suspect there are a lot more extensions in the wild than are actually listed here, which means this could become a source of Issue reports that aren't actionable. (This is already a bit of a sore point for the Standard types w/ > 1 extension (57):
"Other" types with > 1 extension (77):
|
getExtensions()
method that returns all extensions for a given mime type
Closing. |
Some content type have multiple associated extensions. For example: https://github.com/jshttp/mime-db/blob/master/db.json#L7571
Calling
getExtension
should return['html', 'htm', 'shtml']
instead, it returns only 'html'.Therefore, it would make sense that this method was renamed in "getExtensions" and returned an array.
What do you think?
The text was updated successfully, but these errors were encountered: