瀏覽代碼

Fonction recuperation extension d'un fichier

Arthur Brandao 5 年之前
父節點
當前提交
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;