Loquicom %!s(int64=5) %!d(string=hai) anos
pai
achega
47b4fb9e14
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  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;