Browse Source

Fonction recuperation extension d'un fichier

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

+ 5 - 0
src/file.js

@@ -71,4 +71,9 @@ module.exports.delete = function (path, verbose = false) {
     }
 };
 
+module.exports.getExtension = function (filename) {
+    const split = filename.split('.');
+    return split[split.length - 1];
+};
+
 module.exports.fs = fs;