diff --git a/src/download.ts b/src/download.ts index 2b4311b..6a0fb07 100644 --- a/src/download.ts +++ b/src/download.ts @@ -6,8 +6,7 @@ import { } from "binconv"; import { equalBytes } from "@noble/curves/abstract/utils"; import { blake3 } from "@noble/hashes/blake3"; - -const NO_PORTALS_ERROR = new Error("no active portals"); +import { NO_PORTALS_ERROR } from "#types.js"; export async function downloadObject(cid: string): Promise { const activePortals = getActivePortals(); diff --git a/src/types.ts b/src/types.ts index cba5971..dee75cf 100644 --- a/src/types.ts +++ b/src/types.ts @@ -3,4 +3,7 @@ interface Portal { name: string; url: string; } -export { Portal }; + +const NO_PORTALS_ERROR = new Error("no active portals"); + +export { Portal, NO_PORTALS_ERROR }; diff --git a/src/upload.ts b/src/upload.ts index fa2cafc..724b880 100644 --- a/src/upload.ts +++ b/src/upload.ts @@ -1,6 +1,5 @@ -import { ErrTuple } from "#types.js"; +import { ErrTuple, NO_PORTALS_ERROR } from "#types.js"; import { getActivePortals } from "#portal.js"; -import { NO_PORTALS_ERROR } from "#err.js"; export async function uploadObject( file: