Update app.js

This commit is contained in:
Namhyeon Go 2024-07-21 19:00:09 +09:00 committed by GitHub
parent 190a5c81e3
commit 84dc76800b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

10
app.js
View File

@ -241,13 +241,9 @@ function require(pathname) {
];
var filename = filepaths[0];
if (!fs.existsSync(filename)) {
for (var i = 1; i < filepaths.length; i++) {
if (fs.existsSync(filepaths[i])) {
filename = filepaths[i];
break;
}
}
while (!fs.existsSync(filename) && i < filepaths.length) {
filename = filepaths[i];
i++;
}
return filename;