fix: move NO_PORTALS_ERROR to types and re-import

This commit is contained in:
Derrick Hammer 2023-09-07 19:38:56 -04:00
parent 623bbf3235
commit 2c6b8438e1
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
3 changed files with 6 additions and 5 deletions

View File

@ -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<ReadableStream> {
const activePortals = getActivePortals();

View File

@ -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 };

View File

@ -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: