diff --git a/src/index.ts b/src/index.ts index 479c13d..88e8baf 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,6 @@ const DIRNAME_POSIX_REGEX = /^((?:\.(?![^\/]))|(?:(?:\/?|)(?:[\s\S]*?)))(?:\/+?|)(?:(?:\.{1,2}|[^\/]+?|)(?:\.[^.\/]*|))(?:[\/]*)$/; const DIRNAME_WIN32_REGEX = /^((?:\.(?![^\\]))|(?:(?:\\?|)(?:[\s\S]*?)))(?:\\+?|)(?:(?:\.{1,2}|[^\\]+?|)(?:\.[^.\\]*|))(?:[\\]*)$/; -const EXTRACT_PATH_REGEX = /@?(?[file:\/\/]?[^\(\s]+):[0-9]+:[0-9]+/; +const EXTRACT_PATH_REGEX = /@?(?[file:\/\/]+?[^\(]+):[0-9]+:[0-9]+/; const WIN_POSIX_DRIVE_REGEX = /^\/[A-Z]:\/*/; const pathDirname = (path: string) => { @@ -35,7 +35,7 @@ const getPathFromErrorStack = () => { } if (initiator) { - path = EXTRACT_PATH_REGEX.exec(initiator)?.groups?.path || ''; + path = decodeURI(EXTRACT_PATH_REGEX.exec(initiator)?.groups?.path || ''); } if(!initiator || !path) {