Merge pull request #178 from overleaf/bg-use-lodash

migrate from underscore to lodash
This commit is contained in:
Brian Gough 2020-06-16 08:57:14 +01:00 committed by GitHub
commit 8b4869a00c
9 changed files with 10 additions and 18 deletions

View file

@ -25,7 +25,7 @@ const async = require('async')
const LockManager = require('./DockerLockManager')
const fs = require('fs')
const Path = require('path')
const _ = require('underscore')
const _ = require('lodash')
logger.info('using docker runner')

View file

@ -19,7 +19,7 @@ const fs = require('fs')
const fse = require('fs-extra')
const Path = require('path')
const logger = require('logger-sharelatex')
const _ = require('underscore')
const _ = require('lodash')
const Settings = require('settings-sharelatex')
const crypto = require('crypto')

View file

@ -19,7 +19,7 @@ const Path = require('path')
const { spawn } = require('child_process')
const logger = require('logger-sharelatex')
const Metrics = require('./Metrics')
const _ = require('underscore')
const _ = require('lodash')
module.exports = OutputFileOptimiser = {
optimiseFile(src, dst, callback) {

View file

@ -10,7 +10,7 @@
*/
const Sequelize = require('sequelize')
const Settings = require('settings-sharelatex')
const _ = require('underscore')
const _ = require('lodash')
const logger = require('logger-sharelatex')
const options = _.extend({ logging: false }, Settings.mysql.clsi)

View file

@ -6640,11 +6640,6 @@
"integrity": "sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==",
"dev": true
},
"underscore": {
"version": "1.9.2",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.2.tgz",
"integrity": "sha512-D39qtimx0c1fI3ya1Lnhk3E9nONswSKhnffBI0gME9C99fYOkNi04xs8K6pePLhvl1frbDemkaBQ5ikWllR2HQ=="
},
"universalify": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
@ -6834,11 +6829,6 @@
"resolved": "https://registry.npmjs.org/walkdir/-/walkdir-0.4.1.tgz",
"integrity": "sha512-3eBwRyEln6E1MSzcxcVpQIhRG8Q1jLvEqRmCZqS3dsfXEDR/AhOF4d+jHg1qvDCpYaVRZjENPQyrVxAkQqxPgQ=="
},
"when": {
"version": "3.7.8",
"resolved": "https://registry.npmjs.org/when/-/when-3.7.8.tgz",
"integrity": "sha1-xxMLan6gRpPoQs3J56Hyqjmjn4I="
},
"which": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",

View file

@ -27,6 +27,7 @@
"fs-extra": "^8.1.0",
"heapdump": "^0.3.15",
"lockfile": "^1.0.4",
"lodash": "^4.17.15",
"logger-sharelatex": "^1.9.1",
"lynx": "0.2.0",
"metrics-sharelatex": "^2.6.0",
@ -35,7 +36,6 @@
"sequelize": "^5.21.5",
"settings-sharelatex": "git+https://github.com/sharelatex/settings-sharelatex.git#v1.1.0",
"sqlite3": "^4.1.1",
"underscore": "^1.9.2",
"v8-profiler-node8": "^6.1.1",
"wrench": "~1.5.9"
},

View file

@ -13,7 +13,7 @@ const request = require('request')
const Settings = require('settings-sharelatex')
const async = require('async')
const fs = require('fs')
const _ = require('underscore')
const _ = require('lodash')
const concurentCompiles = 5
const totalCompiles = 50

View file

@ -69,7 +69,8 @@ describe('DockerRunner', function() {
return runner(callback)
}
}
}
},
globals: { Math } // used by lodash
})
this.Docker = Docker
this.getContainer = Docker.prototype.getContainer

View file

@ -30,7 +30,8 @@ describe('OutputFileOptimiser', function() {
child_process: { spawn: (this.spawn = sinon.stub()) },
'logger-sharelatex': { log: sinon.stub(), warn: sinon.stub() },
'./Metrics': {}
}
},
globals: { Math } // used by lodash
})
this.directory = '/test/dir'
return (this.callback = sinon.stub())