Skip to content

Commit

Permalink
Update get_mime_type.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Mqxx committed Oct 19, 2023
1 parent 471731a commit 37ac1fd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/mime_types/get_mime_type.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import MIMETypesFile from './default_mime_types.json' assert { type: 'json' }
import { MIMETypesObject } from "./mime_type_object.d.ts";

export function getMIMEType(mIMETypesObject : MIMETypesObject, extension : string) : string {
const MIMETypesMap = Object.entries(MIMETypesFile.types).reduce((
const MIMETypesMap = Object.entries(mIMETypesObject.types).reduce((
map,
[
contentType,
Expand All @@ -18,5 +17,5 @@ export function getMIMEType(mIMETypesObject : MIMETypesObject, extension : strin
new Map<string, string>(),
);

return MIMETypesMap.get(extension) ?? MIMETypesFile.default
return MIMETypesMap.get(extension) ?? mIMETypesObject.default
}

0 comments on commit 37ac1fd

Please sign in to comment.