webtorrent/parse-torrent

Possible nested arrays error

arestov opened this issue · 1 comments

Is it right code?

announce = [[torrent.announce]]

maybe just

announce = [torrent.announce]

?

https://github.com/feross/parse-torrent/blob/master/index.js#L45
if (torrent.announce) {
announce = [[torrent.announce]]
} else {
announce = []
}

Thanks for the issue. This is intentional. announce is supposed to be an array of arrays. So, in the case that torrent.announce (which is a string) exists, we want to do announce = [[torrent.announce]].