You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-15 23:00:36 +02:00
Load commands dynamically
This commit is contained in:
@ -21,10 +21,18 @@ function filename(path) {
|
||||
return output.join('.');
|
||||
}
|
||||
|
||||
function fileExtension(path) {
|
||||
if (!path) throw new Error('Path is empty');
|
||||
|
||||
let output = path.split('.');
|
||||
if (output.length <= 1) return '';
|
||||
return output[output.length - 1];
|
||||
}
|
||||
|
||||
function isHidden(path) {
|
||||
let b = basename(path);
|
||||
if (!b.length) throw new Error('Path empty or not a valid path: ' + path);
|
||||
return b[0] === '.';
|
||||
}
|
||||
|
||||
export { basename, dirname, filename, isHidden };
|
||||
export { basename, dirname, filename, isHidden, fileExtension };
|
Reference in New Issue
Block a user