Эх сурвалжийг харах

Fonction recuperation extension d'un fichier

Arthur Brandao 5 жил өмнө
parent
commit
d7f3700d69
1 өөрчлөгдсөн 5 нэмэгдсэн , 0 устгасан
  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;