blob: 1675e8ecdb77c42742a65cb598b81485952acdba (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
class FilePathUtil {
static isMatchingExtension(filepath, fileExtension) {
if (!fileExtension) {
return false;
}
if (!(fileExtension || "").startsWith(".")) {
fileExtension = "." + fileExtension;
}
return filepath.endsWith(fileExtension);
}
static getFileExtension(filepath) {
return (filepath || "").split(".").pop();
}
}
export { FilePathUtil };
|