-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create seperate method for getAvailableMimeTypes
- Loading branch information
1 parent
2b2ac15
commit c138fae
Showing
3 changed files
with
27 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { MIME_TYPE } from "../enums"; | ||
|
||
const jsonMimeType = [MIME_TYPE.Json, MIME_TYPE.Xml]; | ||
const textMimeType = [MIME_TYPE.Text, MIME_TYPE.Html, MIME_TYPE.Js, | ||
MIME_TYPE.Css, MIME_TYPE.Rtf, MIME_TYPE.Csv]; | ||
|
||
export const getAvailableMimeTypes = (type: MIME_TYPE) => { | ||
switch (type) { | ||
case MIME_TYPE.Json: | ||
case MIME_TYPE.Xml: | ||
return jsonMimeType; | ||
case MIME_TYPE.Html: | ||
case MIME_TYPE.Css: | ||
case MIME_TYPE.Csv: | ||
case MIME_TYPE.Js: | ||
case MIME_TYPE.Rtf: | ||
case MIME_TYPE.Text: | ||
return textMimeType; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters