Refactor content type based code to separate file

This commit is contained in:
Andrew Bastin
2020-05-22 02:53:36 -04:00
parent a0d8b9029e
commit b0da562472
2 changed files with 29 additions and 29 deletions

View File

@@ -0,0 +1,17 @@
export const knownContentTypes = [
"application/json",
"application/vnd.api+json",
"application/hal+json",
"application/xml",
"application/x-www-form-urlencoded",
"text/html",
"text/plain",
]
export function isJSONContentType(contentType) {
return (
contentType === "application/json" ||
contentType === "application/vnd.api+json" ||
contentType === "application/hal+json"
)
}