Merge pull request #1764 from hicom150/remove_deep_equal
Remove deep-equal dependency
This commit is contained in:
@@ -21,7 +21,6 @@
|
|||||||
"chromecasts": "^1.9.1",
|
"chromecasts": "^1.9.1",
|
||||||
"create-torrent": "^4.4.1",
|
"create-torrent": "^4.4.1",
|
||||||
"debounce": "^1.2.0",
|
"debounce": "^1.2.0",
|
||||||
"deep-equal": "^1.1.0",
|
|
||||||
"dlnacasts": "^0.1.0",
|
"dlnacasts": "^0.1.0",
|
||||||
"drag-drop": "^6.0.0",
|
"drag-drop": "^6.0.0",
|
||||||
"es6-error": "^4.1.1",
|
"es6-error": "^4.1.1",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
console.time('init')
|
console.time('init')
|
||||||
|
|
||||||
const crypto = require('crypto')
|
const crypto = require('crypto')
|
||||||
const deepEqual = require('deep-equal')
|
const util = require('util')
|
||||||
const defaultAnnounceList = require('create-torrent').announceList
|
const defaultAnnounceList = require('create-torrent').announceList
|
||||||
const electron = require('electron')
|
const electron = require('electron')
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
@@ -249,7 +249,7 @@ function generateTorrentPoster (torrentKey) {
|
|||||||
function updateTorrentProgress () {
|
function updateTorrentProgress () {
|
||||||
const progress = getTorrentProgress()
|
const progress = getTorrentProgress()
|
||||||
// TODO: diff torrent-by-torrent, not once for the whole update
|
// TODO: diff torrent-by-torrent, not once for the whole update
|
||||||
if (prevProgress && deepEqual(progress, prevProgress, { strict: true })) {
|
if (prevProgress && util.isDeepStrictEqual(progress, prevProgress)) {
|
||||||
return /* don't send heavy object if it hasn't changed */
|
return /* don't send heavy object if it hasn't changed */
|
||||||
}
|
}
|
||||||
ipc.send('wt-progress', progress)
|
ipc.send('wt-progress', progress)
|
||||||
|
|||||||
Reference in New Issue
Block a user