Open jstans opened 8 years ago
@dougwilson Anyone working on this?
HI @thihara nope. I see you made a PR, so awesome!
This still has value, I just ran into it now. I see the pr for allExtensions but not for lookupAll (all mime types from a single extension) Makes it kind of difficult to check that the binary is what you are expecting from the extension or content-type headers.
I'm going to log an issue on our tracking system, if it doesn't move the odds are I will do it.
I took a crack at this today and have a PR open for it. Hoping it's a good starting point to discuss more!
This relates to: koajs/koa#617.
As an extension can correspond to multiple mime-types, wouldn't it be correct to return an array of all matches and let libraries handle that?
Perhaps a
.lookupAll()
which strictly returns an array to avoid breaking existing code or over-complicating something which not everyone will want to make use of.