File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import {
2121 fetchPackageManifest ,
2222 readPackageJson ,
2323} from '@socketsecurity/registry/lib/packages'
24+ import { normalizePath } from '@socketsecurity/registry/lib/path'
2425import { escapeRegExp } from '@socketsecurity/registry/lib/regexps'
2526import { naturalCompare } from '@socketsecurity/registry/lib/sorts'
2627
@@ -397,7 +398,8 @@ export default async () => {
397398 case shadowNpmInjectSrcPath :
398399 return SHADOW_NPM_INJECT
399400 default :
400- if ( id . startsWith ( utilsSrcPath ) ) {
401+ console . log ( { id, utilsSrcPath : normalizePath ( utilsSrcPath ) } )
402+ if ( id . startsWith ( normalizePath ( utilsSrcPath ) ) ) {
401403 return UTILS
402404 }
403405 if ( id . includes ( SLASH_NODE_MODULES_SLASH ) ) {
Original file line number Diff line number Diff line change @@ -41,8 +41,12 @@ export async function invokeNpm(
4141 args : string [ ] ,
4242 env = { } ,
4343) : Promise < {
44- status : boolean
4544 code : number
45+ error ?: {
46+ message : string
47+ stack : string
48+ }
49+ status : boolean
4650 stdout : string
4751 stderr : string
4852} > {
@@ -74,7 +78,11 @@ export async function invokeNpm(
7478 } catch ( e : unknown ) {
7579 return {
7680 status : false ,
77- code : e ?. [ 'code' ] ,
81+ code : e ?. [ 'code' ] || 1 ,
82+ error : {
83+ message : e ?. [ 'message' ] || '' ,
84+ stack : e ?. [ 'stack' ] || '' ,
85+ } ,
7886 stdout : toAsciiSafeString (
7987 normalizeLogSymbols ( stripAnsi ( e ?. [ 'stdout' ] ?. trim ( ) ?? '' ) ) ,
8088 ) ,
You can’t perform that action at this time.
0 commit comments