mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
use a Set instead of an Object
This commit is contained in:
parent
43b0429c28
commit
ca98ee5cff
1 changed files with 3 additions and 6 deletions
|
@ -106,14 +106,11 @@ module.exports = ResourceStateManager = {
|
|||
return callback(new Error('relative path in resource file list'))
|
||||
}
|
||||
// check if any of the input files are not present in list of files
|
||||
const seenFile = {}
|
||||
for (file of allFiles) {
|
||||
seenFile[file] = true
|
||||
}
|
||||
const seenFiles = new Set(allFiles)
|
||||
const missingFiles = resources
|
||||
.filter((resource) => !seenFile[resource.path])
|
||||
.map((resource) => resource.path)
|
||||
if (missingFiles && missingFiles.length > 0) {
|
||||
.filter((path) => !seenFiles.has(path))
|
||||
if (missingFiles.length > 0) {
|
||||
logger.err(
|
||||
{ missingFiles, basePath, allFiles, resources },
|
||||
'missing input files for project'
|
||||
|
|
Loading…
Reference in a new issue