File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,8 @@ export default class Path {
103
103
* Create a new `Path` object for the caller source file.
104
104
*/
105
105
static callerFile ( ) : Path {
106
- return Path . fromFileURL ( new StackUtils ( ) . capture ( 3 ) [ 2 ] . getFileName ( ) ?? '' ) ;
106
+ const fileName = new StackUtils ( ) . capture ( 3 ) [ 2 ] . getFileName ( ) ?? '' ;
107
+ return fileName . startsWith ( 'file://' ) ? Path . fromFileURL ( fileName ) : new Path ( fileName ) ;
107
108
}
108
109
109
110
/**
@@ -199,7 +200,8 @@ export default class Path {
199
200
* Create a new `Path` object for the current source file.
200
201
*/
201
202
static currentFile ( ) : Path {
202
- return Path . fromFileURL ( new StackUtils ( ) . capture ( 2 ) [ 1 ] . getFileName ( ) ?? '' ) ;
203
+ const fileName = new StackUtils ( ) . capture ( 2 ) [ 1 ] . getFileName ( ) ?? '' ;
204
+ return fileName . startsWith ( 'file://' ) ? Path . fromFileURL ( fileName ) : new Path ( fileName ) ;
203
205
}
204
206
205
207
/**
You can’t perform that action at this time.
0 commit comments