open-vault/ui/app/utils/trim-right.js

5 lines
154 B
JavaScript

export default function(fileName, toTrimArray = []) {
const extension = new RegExp(toTrimArray.join('$|'));
return fileName.replace(extension, '');
}