Browse Source

Ajout isDir

Loquicom 5 năm trước cách đây
mục cha
commit
47b4fb9e14
1 tập tin đã thay đổi với 7 bổ sung0 xóa
  1. 7 0
      src/file.js

+ 7 - 0
src/file.js

@@ -76,4 +76,11 @@ module.exports.getExtension = function (filename) {
     return split[split.length - 1];
 };
 
+module.exports.isDir = function (path) {
+    if (!module.exports.exist(path)) {
+        return false;
+    }
+    return fs.statSync(path).isDirectory();
+};
+
 module.exports.fs = fs;