jshttp / mime-types

The ultimate javascript content-type utility.
MIT License
1.32k stars 129 forks source link

Use `mime-score` to resolve extension conflicts. #116

Closed broofa closed 1 month ago

broofa commented 9 months ago

[See #42 for long-ago discussion of this idea.]

As noted in that old PR, I created the mime-score module to encapsulate the logic used by mime to resolve extension conflicts in mime types. I think it would be helpful to users of mime and mime-types if both libs used the same logic.

I'll put up a PR for that (again), but the main issue with that previous PR was that mime-score didn't support node@0.6. I suspect that's no longer a concern? It'd be nice to not have to worry about that, and to be able to develop using reasonably modern language features. See #115 for further discussion there.

[Edit to add: The current support matrix is maybe even more relevent than I thought. 'Just realized that I ported mime-score to typescript last year, and it's currently built for ESNext. So, it works on node@14 but breaks on node@12.]