File tree Expand file tree Collapse file tree 3 files changed +24
-21
lines changed Expand file tree Collapse file tree 3 files changed +24
-21
lines changed Original file line number Diff line number Diff line change 124
124
],
125
125
"type" : " commonjs" ,
126
126
"devDependencies" : {
127
- "@types/node" : " ^20.14.6 " ,
127
+ "@types/node" : " ^20.14.7 " ,
128
128
"@typescript-eslint/eslint-plugin" : " ^7.13.1" ,
129
129
"@typescript-eslint/parser" : " ^7.13.1" ,
130
130
"c8" : " ^10.1.2" ,
137
137
"packages-update" : " ^2.0.0" ,
138
138
"prettier" : " ^3.3.2" ,
139
139
"shx" : " ^0.3.4" ,
140
- "tsx" : " 4.15.6 " ,
141
- "typescript" : " ^5.4.5 "
140
+ "tsx" : " 4.15.7 " ,
141
+ "typescript" : " ^5.5.2 "
142
142
}
143
143
}
Original file line number Diff line number Diff line change @@ -11,21 +11,23 @@ const eachCore = async (
11
11
) : Promise < boolean > => {
12
12
if ( typeof configs ?. [ type ] !== 'function' ) return true ;
13
13
14
- const functionName = configs [ type ] ?. name ;
14
+ const cb = configs [ type ] ;
15
+ /* c8 ignore next */
16
+ if ( typeof cb !== 'function' ) return true ;
15
17
16
18
write (
17
- ` ${ format . dim ( format . info ( '◯' ) ) } ${ format . dim ( format . italic ( `${ configs [ type ] } : ${ functionName !== configs [ type ] ? functionName : 'anonymous function' } ` ) ) } `
19
+ ` ${ format . dim ( format . info ( '◯' ) ) } ${ format . dim ( format . italic ( `${ cb } : ${ cb . name || 'anonymous function' } ` ) ) } `
18
20
) ;
19
21
20
22
try {
21
- await configs [ type ] ?.( ) ;
23
+ const resultCb = cb ( ) ;
24
+ /* c8 ignore next */
25
+ if ( resultCb instanceof Promise ) await resultCb ;
22
26
return true ;
23
27
} catch ( error ) {
24
28
write (
25
29
format . bold (
26
- format . fail (
27
- ` ✘ ${ type } callback failed ${ format . dim ( `› ${ configs [ type ] } ` ) } `
28
- )
30
+ format . fail ( ` ✘ ${ type } callback failed ${ format . dim ( `› ${ cb } ` ) } ` )
29
31
)
30
32
) ;
31
33
write (
You can’t perform that action at this time.
0 commit comments