Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

fix: 🐛 exports: Fix missing stream/file node index export #74

Merged
merged 1 commit into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export * from "./src/index";
export * from "./src/stream";
export * as file from "./src/file";
2 changes: 1 addition & 1 deletion src/__tests__/fileBundle.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createData } from "../ar-data-create";
import { FileDataItem } from "../file";
import type { FileBundle } from "../file/FileBundle";
import Bundle from "../file/FileBundle";
import { EthereumSigner } from "../../src/signing";
import { EthereumSigner } from "../../index";
import { bundleAndSignData } from "../file";
import base64url from "base64url";
import type Transactions from "arweave/node/transactions";
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/stream.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createReadStream, readFileSync, unlinkSync, writeFileSync } from "fs";
import path from "path";
import processStream, { streamSigner, streamExportForTesting } from "../../src/stream/index";
import { processStream, streamSigner, streamExportForTesting } from "../../index";
import { Readable } from "stream";
import type { DataItemCreateOptions } from "../../index";
import { DataItem } from "../../index";
Expand Down
4 changes: 3 additions & 1 deletion src/stream/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type { Signer } from "../signing/index";
import { deserializeTags } from "../tags";
import { createHash } from "crypto";

export default async function processStream(stream: Readable): Promise<Record<string, any>[]> {
export async function processStream(stream: Readable): Promise<Record<string, any>[]> {
const reader = getReader(stream);
let bytes: Uint8Array = (await reader.next()).value;
bytes = await readBytes(reader, bytes, 32);
Expand Down Expand Up @@ -196,6 +196,8 @@ async function* getReader(s: Readable): AsyncGenerator<Buffer> {
}
}

export default processStream;

export const streamExportForTesting = {
readBytes,
getReader,
Expand Down