File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -4,11 +4,12 @@ export type GenericObject = Record<string, any>
44
55export type NodeError = NodeJS . ErrnoException
66
7- let processRoot = process . cwd ( )
7+ const processRoot = process . cwd ( )
8+ let fileProcessRoot = `file://${ processRoot } `
89
910/* c8 ignore next 3 - Windows specific */
1011if ( process . platform === 'win32' ) {
11- processRoot = '/' + process . cwd ( ) . replaceAll ( sep , '/' )
12+ fileProcessRoot = 'file:// /' + process . cwd ( ) . replaceAll ( sep , '/' )
1213}
1314
1415export function pascalCase ( original : string ) : string {
@@ -50,7 +51,15 @@ export function serializeError(error: Error, omitStack: boolean = false): Generi
5051 serialized . stack = ( error . stack ?? '' )
5152 . split ( '\n' )
5253 . slice ( 1 )
53- . map ( s => s . trim ( ) . replace ( / ^ a t / , '' ) . replace ( processRoot , '$ROOT' ) )
54+ . map ( s =>
55+ s
56+ . trim ( )
57+ . replace ( / ^ a t / , '' )
58+ . replace ( / ^ a t / , '' )
59+ . replace ( fileProcessRoot , 'file://$ROOT' )
60+ . replace ( processRoot , '$ROOT' )
61+ . replaceAll ( sep , '/' )
62+ )
5463 }
5564
5665 addAdditionalProperties ( serialized , error )
You can’t perform that action at this time.
0 commit comments