fix: allow single collections to imported by hopp importer
This commit is contained in:
@@ -20,10 +20,13 @@ export default defineImporter({
|
|||||||
importer: ([content]) =>
|
importer: ([content]) =>
|
||||||
pipe(
|
pipe(
|
||||||
E.tryCatch(
|
E.tryCatch(
|
||||||
() =>
|
() => {
|
||||||
JSON.parse(content).map((coll: any) =>
|
const x = JSON.parse(content)
|
||||||
translateToNewRESTCollection(coll)
|
|
||||||
),
|
return Array.isArray(x)
|
||||||
|
? x.map((coll: any) => translateToNewRESTCollection(coll))
|
||||||
|
: [translateToNewRESTCollection(x)]
|
||||||
|
},
|
||||||
() => IMPORTER_INVALID_FILE_FORMAT
|
() => IMPORTER_INVALID_FILE_FORMAT
|
||||||
),
|
),
|
||||||
TE.fromEither
|
TE.fromEither
|
||||||
|
|||||||
Reference in New Issue
Block a user