mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 10:33:51 -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'))
|
return callback(new Error('relative path in resource file list'))
|
||||||
}
|
}
|
||||||
// check if any of the input files are not present in list of files
|
// check if any of the input files are not present in list of files
|
||||||
const seenFile = {}
|
const seenFiles = new Set(allFiles)
|
||||||
for (file of allFiles) {
|
|
||||||
seenFile[file] = true
|
|
||||||
}
|
|
||||||
const missingFiles = resources
|
const missingFiles = resources
|
||||||
.filter((resource) => !seenFile[resource.path])
|
|
||||||
.map((resource) => resource.path)
|
.map((resource) => resource.path)
|
||||||
if (missingFiles && missingFiles.length > 0) {
|
.filter((path) => !seenFiles.has(path))
|
||||||
|
if (missingFiles.length > 0) {
|
||||||
logger.err(
|
logger.err(
|
||||||
{ missingFiles, basePath, allFiles, resources },
|
{ missingFiles, basePath, allFiles, resources },
|
||||||
'missing input files for project'
|
'missing input files for project'
|
||||||
|
|
Loading…
Reference in a new issue