From 2c6b8438e1cf7b72296af90ddb1bdd767bfda231 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 7 Sep 2023 19:38:56 -0400 Subject: [PATCH] fix: move NO_PORTALS_ERROR to types and re-import --- src/download.ts | 3 +-- src/types.ts | 5 ++++- src/upload.ts | 3 +-- 3 files changed, 6 insertions(+), 5 deletions(-) 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: