File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { fileURLToPath } from 'node:url'
44import { it } from 'vitest'
55
66import { spawn } from '@socketsecurity/registry/lib/spawn'
7+ import { stripAnsi } from '@socketsecurity/registry/lib/strings'
78
89import constants from '../src/constants.mts'
910
@@ -63,15 +64,15 @@ export async function invokeNpm(
6364 return {
6465 status : true ,
6566 code : 0 ,
66- stdout : toAsciiSafeString ( normalizeLogSymbols ( output . stdout . trim ( ) ) ) ,
67- stderr : toAsciiSafeString ( normalizeLogSymbols ( output . stderr . trim ( ) ) ) ,
67+ stdout : toAsciiSafeString ( normalizeLogSymbols ( stripAnsi ( output . stdout . trim ( ) ) ) ) ,
68+ stderr : toAsciiSafeString ( normalizeLogSymbols ( stripAnsi ( output . stderr . trim ( ) ) ) ) ,
6869 }
6970 } catch ( e : unknown ) {
7071 return {
7172 status : false ,
7273 code : e ?. [ 'code' ] ,
73- stdout : toAsciiSafeString ( normalizeLogSymbols ( e ?. [ 'stdout' ] ?? '' ) ) ,
74- stderr : toAsciiSafeString ( normalizeLogSymbols ( e ?. [ 'stderr' ] ?? '' ) ) ,
74+ stdout : toAsciiSafeString ( normalizeLogSymbols ( stripAnsi ( e ?. [ 'stdout' ] ?. trim ( ) ?? '' ) ) ) ,
75+ stderr : toAsciiSafeString ( normalizeLogSymbols ( stripAnsi ( e ?. [ 'stderr' ] ?. trim ( ) ?? '' ) ) ) ,
7576 }
7677 }
7778}
You can’t perform that action at this time.
0 commit comments