mirror of
https://github.com/koodo-reader/koodo-reader.git
synced 2026-10-08 05:50:04 -04:00
fix: correct isFile method usage in file and folder checks
This commit is contained in:
1 parent
63a4620caa
commit
92fe8d164e
2 files changed
+4
-4
No files matched your search
@@ -48,9 +48,9 @@ class AutoImportDialog extends React.Component<
|
||||
for (const item of items) {
|
||||
const fullPath = path.join(dirPath, item);
|
||||
const stat = fs.statSync(fullPath);
|
||||
if (stat.isDirectory && !stat.isFile()) {
|
||||
if (stat.isDirectory && !stat.isFile) {
|
||||
files = files.concat(this.getAllFilesRecursively(fs, path, fullPath));
|
||||
} else if (stat.isFile()) {
|
||||
} else if (stat.isFile) {
|
||||
const ext = path.extname(item).toLowerCase();
|
||||
if (supportedFormats.includes(ext)) {
|
||||
files.push(fullPath);
|
||||
|
||||
@@ -646,9 +646,9 @@ class ImportLocal extends React.Component<ImportLocalProps, ImportLocalState> {
|
||||
for (const item of items) {
|
||||
const fullPath = path.join(dirPath, item);
|
||||
const stat = fs.statSync(fullPath);
|
||||
if (stat.isDirectory && !stat.isFile()) {
|
||||
if (stat.isDirectory && !stat.isFile) {
|
||||
result = result.concat(getAllFiles(fullPath));
|
||||
} else if (stat.isFile()) {
|
||||
} else if (stat.isFile) {
|
||||
const ext = path.extname(item).toLowerCase();
|
||||
if (supportedFormats.includes(ext)) {
|
||||
result.push(fullPath);
|
||||
|
||||
Reference in new issue
Block a user