fix: correct isFile method usage in file and folder checks

This commit is contained in:
troyeguo committed 2026-08-14 18:41:28 +08:00
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);
+2 -2
View File
@@ -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);