Skip to content

Commit fa21e36

Browse files
authored
🤖 Merge PR DefinitelyTyped#74264 [create-torrent]: fix return type by @trim21
1 parent a01ec41 commit fa21e36

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

types/create-torrent/create-torrent-tests.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/// <reference types="node" />
22
import createTorrent, { announceList, isJunkPath } from "create-torrent";
33

4-
const cb = (err: Error | null, torrent?: Buffer) => {};
4+
const cb = (err: Error | null, torrent: Uint8Array) => {};
55

6-
createTorrent("test", (err: Error | null, torrent?: Buffer) => {
6+
createTorrent("test", (err: Error | null, torrent: Uint8Array) => {
77
if (err) return;
8-
if (torrent) torrent.equals(Buffer.alloc(0));
8+
if (torrent) Buffer.from(torrent).equals(Buffer.alloc(0));
99
});
1010

1111
createTorrent(["a.txt", "b.txt"], cb);

types/create-torrent/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// <reference types="node" />
22
import type { Readable as ReadableStream } from "node:stream";
33

4-
export type CreateTorrentCallback = (err: Error | null, torrent?: Buffer) => void;
4+
export type CreateTorrentCallback = (err: Error | null, torrent: Uint8Array) => void;
55

66
export interface CreateTorrentOptions {
77
// name of the torrent (default = basename of `path`, or 1st file's name)

0 commit comments

Comments
 (0)