MCPcopy Create free account
hub / github.com/mailvelope/mailvelope / extractFileNameWithoutExt

Function extractFileNameWithoutExt

src/lib/file.js:49–56  ·  view source on GitHub ↗
(fileName)

Source from the content-addressed store, hash-verified

47}
48
49export function extractFileNameWithoutExt(fileName) {
50 const indexOfDot = fileName.lastIndexOf('.');
51 if (indexOfDot > 0) { // case: regular
52 return fileName.substring(0, indexOfDot);
53 } else {
54 return fileName;
55 }
56}
57
58export function extractFileExtension(fileName) {
59 const lastindexDot = fileName.lastIndexOf('.');

Callers 1

FilePanel.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected