Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJimmy Wärting <jimmy@warting.se>2018-08-29 13:28:00 +0300
committerJimmy Wärting <jimmy@warting.se>2018-08-29 13:28:00 +0300
commit7b53faa23d4bb6d4ae0581ff7cb505c08c3809a0 (patch)
tree301f7edd4b955d21f4116f52be0d53226f35a066 /index.js
parent2e47febccab8a6e40e4a0b83ff2db170ee3273a2 (diff)
zero-fill seems like unnecessary
Diffstat (limited to 'index.js')
-rw-r--r--index.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/index.js b/index.js
index f8fe5a5..7466a9e 100644
--- a/index.js
+++ b/index.js
@@ -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