File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 11/// <reference types="node" />
22import 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
1111createTorrent ( [ "a.txt" , "b.txt" ] , cb ) ;
Original file line number Diff line number Diff line change 11/// <reference types="node" />
22import 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
66export interface CreateTorrentOptions {
77 // name of the torrent (default = basename of `path`, or 1st file's name)
You can’t perform that action at this time.
0 commit comments