diff options
author | Jimmy Wärting <jimmy@warting.se> | 2018-08-29 13:28:00 +0300 |
---|---|---|
committer | Jimmy Wärting <jimmy@warting.se> | 2018-08-29 13:28:00 +0300 |
commit | 7b53faa23d4bb6d4ae0581ff7cb505c08c3809a0 (patch) | |
tree | 301f7edd4b955d21f4116f52be0d53226f35a066 /index.js | |
parent | 2e47febccab8a6e40e4a0b83ff2db170ee3273a2 (diff) |
zero-fill seems like unnecessary
Diffstat (limited to 'index.js')
-rw-r--r-- | index.js | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -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 |