Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zero-fill seems like unnecessary #1490

Merged
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -13,7 +13,6 @@ const path = require('path')
const Peer = require('simple-peer')
const randombytes = require('randombytes')
const speedometer = require('speedometer')
const zeroFill = require('zero-fill')

const TCPPool = require('./lib/tcp-pool') // browser exclude
const Torrent = require('./lib/torrent')
@@ -25,10 +24,9 @@ const VERSION = require('./package.json').version
* '0.16.1' -> '0016'
* '1.2.5' -> '0102'
*/
const VERSION_STR = VERSION.match(/([0-9]+)/g)
.slice(0, 2)
.map(v => zeroFill(2, v % 100))
.join('')
const VERSION_STR = VERSION
.replace(/\d*./g, v => `0${v % 100}`.slice(-2))
.slice(0, 4)

/**
* Version prefix string (used in peer ID). WebTorrent uses the Azureus-style
@@ -66,8 +66,7 @@
"unordered-array-remove": "^1.0.2",
"ut_metadata": "^3.0.8",
"ut_pex": "^1.1.1",
"xtend": "^4.0.1",
"zero-fill": "^2.2.3"
"xtend": "^4.0.1"
},
"devDependencies": {
"airtap": "0.1.0",
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.