fix: allow single collections to imported by hopp importer
This commit is contained in:
parent
daec39016b
commit
85521b4c37
1 changed files with 7 additions and 4 deletions
|
|
@ -20,10 +20,13 @@ export default defineImporter({
|
|||
importer: ([content]) =>
|
||||
pipe(
|
||||
E.tryCatch(
|
||||
() =>
|
||||
JSON.parse(content).map((coll: any) =>
|
||||
translateToNewRESTCollection(coll)
|
||||
),
|
||||
() => {
|
||||
const x = JSON.parse(content)
|
||||
|
||||
return Array.isArray(x)
|
||||
? x.map((coll: any) => translateToNewRESTCollection(coll))
|
||||
: [translateToNewRESTCollection(x)]
|
||||
},
|
||||
() => IMPORTER_INVALID_FILE_FORMAT
|
||||
),
|
||||
TE.fromEither
|
||||
|
|
|
|||
Loading…
Reference in a new issue