diff --git a/src/path.ts b/src/path.ts index f613336..48f5e1e 100644 --- a/src/path.ts +++ b/src/path.ts @@ -182,10 +182,10 @@ export const toNamespacedPath: typeof path.toNamespacedPath = function (p) { } // extname -const _EXTNAME_RE = /(?) { return aliases } -const FILENAME_RE = /(?<=^|[\\/])([^\\/]+?)(?=(\.[^.]+)?$)/ +const FILENAME_RE = /(^|[\\/])([^\\/]+?)(?=(\.[^.]+)?$)/ export function filename (path: string) { - return path.match(FILENAME_RE)?.[0] + return path.match(FILENAME_RE)?.[2] } // --- internals ---