refactor: move collection data structures and utility functions to hopp/data
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import { HoppRESTRequest } from "@hoppscotch/data"
|
||||
import { HoppRESTRequest, HoppCollection } from "@hoppscotch/data"
|
||||
import { pipe } from "fp-ts/function"
|
||||
import * as TE from "fp-ts/TaskEither"
|
||||
import { HoppExporter } from "."
|
||||
import { Collection } from "~/newstore/collections"
|
||||
|
||||
const exporter: HoppExporter<Collection<HoppRESTRequest>> = (content) =>
|
||||
const exporter: HoppExporter<HoppCollection<HoppRESTRequest>> = (content) =>
|
||||
pipe(content, JSON.stringify, TE.right)
|
||||
|
||||
export default exporter
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import * as TE from "fp-ts/TaskEither"
|
||||
import { HoppRESTRequest } from "@hoppscotch/data"
|
||||
import { Collection } from "~/newstore/collections"
|
||||
import { HoppRESTRequest, HoppCollection } from "@hoppscotch/data"
|
||||
|
||||
export type HoppExporter<T> = (content: T) => TE.TaskEither<string, string>
|
||||
|
||||
@@ -10,7 +9,7 @@ export type HoppExporterDefintion<T> = {
|
||||
}
|
||||
|
||||
export const RESTCollectionExporters: HoppExporterDefintion<
|
||||
Collection<HoppRESTRequest>
|
||||
HoppCollection<HoppRESTRequest>
|
||||
>[] = [
|
||||
{
|
||||
name: "Hoppscotch REST Collection JSON",
|
||||
|
||||
Reference in New Issue
Block a user