create-torrent
Advanced tools
Comparing version 3.11.1 to 3.12.0
30
index.js
@@ -241,8 +241,28 @@ /*global Blob, FileList */ | ||
function onFiles (files, opts, cb) { | ||
var announceList = opts.announceList !== undefined | ||
? opts.announceList | ||
: opts.announce !== undefined | ||
? opts.announce.map(function (u) { return [ u ] }) | ||
: module.exports.announceList // default | ||
var announceList = opts.announceList | ||
if (!announceList) { | ||
if (typeof opts.announce === 'string') announceList = [ [ opts.announce ] ] | ||
else if (Array.isArray(opts.announce)) { | ||
announceList = opts.announce.map(function (u) { return [ u ] }) | ||
} | ||
} | ||
if (!announceList) announceList = [] | ||
if (global.WEBTORRENT_ANNOUNCE) { | ||
if (typeof global.WEBTORRENT_ANNOUNCE === 'string') { | ||
announceList.push([ [ global.WEBTORRENT_ANNOUNCE ] ]) | ||
} else if (Array.isArray(global.WEBTORRENT_ANNOUNCE)) { | ||
announceList = announceList.concat(global.WEBTORRENT_ANNOUNCE.map(function (u) { | ||
return [ u ] | ||
})) | ||
} | ||
} | ||
// When no trackers specified, use some reasonable defaults | ||
if (announceList.length === 0) { | ||
announceList = announceList.concat(module.exports.announceList) | ||
} | ||
var torrent = { | ||
@@ -249,0 +269,0 @@ info: { |
{ | ||
"name": "create-torrent", | ||
"description": "Create .torrent files", | ||
"version": "3.11.1", | ||
"version": "3.12.0", | ||
"author": "Feross Aboukhadijeh <feross@feross.org> (http://feross.org/)", | ||
@@ -6,0 +6,0 @@ "bin": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
441041
886