소스 검색

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;