jshttp / mime-types

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

lookup("map") returns "application/json" instead of false #125

Open mkilpatrick opened 2 months ago

mkilpatrick commented 2 months ago

For some reason lookup("map") returns 'application/json' instead of false. Shouldn't it return false since there is no extension?

djereg commented 2 months ago

custom-types.json in mime-db

mkilpatrick commented 2 months ago

So an extension (.) isn't necessary for its determination?

djereg commented 2 months ago

As you can see in readme the first example is json without dot and the result is application/json.

akashamar commented 1 month ago

application/json is the best mimetype for sourcemap files.

application/octet-stream might work well with browser devtools, however this mimetype is a signal to browsers to initiate a download. This may cause problems for tools like performance analysis tooling or JS exception tracking that attempt to make sense of the source maps.