Merge pull request #1583 from jimmywarting/patch-1

Removed zero-fill
This commit is contained in:
Feross Aboukhadijeh
2019-08-16 11:49:38 -07:00
committed by GitHub

View File

@@ -12,7 +12,6 @@ const mm = require('music-metadata')
const networkAddress = require('network-address') const networkAddress = require('network-address')
const path = require('path') const path = require('path')
const WebTorrent = require('webtorrent') const WebTorrent = require('webtorrent')
const zeroFill = require('zero-fill')
const crashReporter = require('../crash-reporter') const crashReporter = require('../crash-reporter')
const config = require('../config') const config = require('../config')
@@ -41,10 +40,9 @@ const VERSION = require('../../package.json').version
* '0.16.1' -> '0016' * '0.16.1' -> '0016'
* '1.2.5' -> '0102' * '1.2.5' -> '0102'
*/ */
const VERSION_STR = VERSION.match(/([0-9]+)/g) const VERSION_STR = VERSION
.slice(0, 2) .replace(/\d*./g, v => `0${v % 100}`.slice(-2))
.map((v) => zeroFill(2, v)) .slice(0, 4)
.join('')
/** /**
* Version prefix string (used in peer ID). WebTorrent uses the Azureus-style * Version prefix string (used in peer ID). WebTorrent uses the Azureus-style