refactor: separate out data structures into hoppscotch-data
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { combineLatest, Observable } from "rxjs"
|
||||
import { map } from "rxjs/operators"
|
||||
import { FormDataKeyValue, HoppRESTRequest } from "../types/HoppRESTRequest"
|
||||
import { FormDataKeyValue, HoppRESTRequest } from "@hoppscotch/data"
|
||||
import { parseTemplateString, parseBodyEnvVariables } from "../templating"
|
||||
import { Environment, getGlobalVariables } from "~/newstore/environments"
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
export const knownContentTypes = {
|
||||
import { ValidContentTypes } from "@hoppscotch/data"
|
||||
|
||||
export type Content = "json" | "xml" | "multipart" | "html" | "plain"
|
||||
|
||||
export const knownContentTypes: Record<ValidContentTypes, Content> = {
|
||||
"application/json": "json",
|
||||
"application/ld+json": "json",
|
||||
"application/hal+json": "json",
|
||||
@@ -10,8 +14,6 @@ export const knownContentTypes = {
|
||||
"text/plain": "plain",
|
||||
}
|
||||
|
||||
export type ValidContentTypes = keyof typeof knownContentTypes
|
||||
|
||||
export function isJSONContentType(contentType: string) {
|
||||
return /\bjson\b/i.test(contentType)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user