Skip to content

Commit

Permalink
fix: rollup build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianbormann committed Dec 5, 2022
1 parent badce6b commit 29fa237
Show file tree
Hide file tree
Showing 6 changed files with 219 additions and 236 deletions.
2 changes: 1 addition & 1 deletion .babelrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": [["@babel/env", { "modules": false }]]
"presets": ["@babel/preset-typescript"]
}
4 changes: 2 additions & 2 deletions meerkat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import WebTorrent from 'webtorrent';
import * as bs58 from 'bs58';
import * as ripemd160 from 'ripemd160';
import { Peer } from './types';
import { EventEmitter } from 'events';
import EventEmitter from 'events';
import * as bencode from './lib/bencode';

const PEER_TIMEOUT = 5 * 60 * 1000;
Expand Down Expand Up @@ -95,7 +95,7 @@ export default class Meerkat extends EventEmitter {
const packet = this.makePacket({ y: 'x' });
this.sendRaw(packet);

if (this.webTorrent && this.torrentCreated) {
if (typeof this.webTorrent !== 'undefined' && this.torrentCreated) {
this.webTorrent.remove(this.torrent);
}
}
Expand Down
Loading

0 comments on commit 29fa237

Please sign in to comment.