We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c3bf58 commit 1e730eaCopy full SHA for 1e730ea
web_src/js/utils.js
@@ -1,13 +1,13 @@
1
import {encode, decode} from 'uint8-to-base64';
2
3
// transform /path/to/file.ext to file.ext
4
-export function basename(path = '') {
+export function basename(path) {
5
const lastSlashIndex = path.lastIndexOf('/');
6
return lastSlashIndex < 0 ? path : path.substring(lastSlashIndex + 1);
7
}
8
9
// transform /path/to/file.ext to .ext
10
-export function extname(path = '') {
+export function extname(path) {
11
12
const lastPointIndex = path.lastIndexOf('.');
13
if (lastSlashIndex > lastPointIndex) return '';
0 commit comments