From 4144607c1c382b03625e914ae77a0ccc247fc2d6 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 18 Aug 2022 10:43:38 +0200 Subject: [PATCH] fix: remove lookbehinds (for safari support) --- src/path.ts | 4 ++-- src/utils.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 ---