Escape period in filename match

pull/12121/head
Aqiel Oostenbrug 2025-04-18 13:32:10 +02:00 committed by GitHub
parent 4ab579b7f4
commit 623c346c72
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@ export function basename(path: string) {
export function filename(path: string, includeDir = false) {
if (!path) throw new Error('Path is empty');
const cleanedPath = path.replace(/\/.\//i, '/');
const cleanedPath = path.replace(/\/\.\//i, '/');
const output = includeDir ? cleanedPath : basename(cleanedPath);
if (output.indexOf('.') < 0) return output;