Skip to content

Commit

Permalink
zero-fill seems like unnecessary
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmywarting committed Aug 29, 2018
1 parent 2e47feb commit 7b53faa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
8 changes: 3 additions & 5 deletions index.js
Expand Up @@ -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')
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions package.json
Expand Up @@ -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",
Expand Down

0 comments on commit 7b53faa

Please sign in to comment.