File tree Expand file tree Collapse file tree 3 files changed +22
-9
lines changed Expand file tree Collapse file tree 3 files changed +22
-9
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @hey-api/openapi-ts ' : patch
3
+ ---
4
+
5
+ fix: don't throw on missing performance marks
Original file line number Diff line number Diff line change @@ -117,6 +117,10 @@ async function start() {
117
117
userConfig . watch = Number . parseInt ( params . watch , 10 ) ;
118
118
}
119
119
120
+ if ( ! Object . keys ( userConfig . logs ) . length ) {
121
+ delete userConfig . logs ;
122
+ }
123
+
120
124
const context = await createClient ( userConfig ) ;
121
125
if ( ! context [ 0 ] || ! context [ 0 ] . config . watch ) {
122
126
process . exit ( 0 ) ;
Original file line number Diff line number Diff line change @@ -32,15 +32,19 @@ export class PerformanceReport {
32
32
) ;
33
33
34
34
marks . forEach ( ( mark ) => {
35
- const markMeasure = Performance . measure ( mark ) ;
36
- const markDuration = Math . ceil ( markMeasure . duration * 100 ) / 100 ;
37
- const percentage =
38
- Math . ceil (
39
- ( markMeasure . duration / this . totalMeasure . duration ) * 100 * 100 ,
40
- ) / 100 ;
41
- console . warn (
42
- `${ mark } : ${ markDuration . toFixed ( 2 ) } ms (${ percentage . toFixed ( 2 ) } %)` ,
43
- ) ;
35
+ try {
36
+ const markMeasure = Performance . measure ( mark ) ;
37
+ const markDuration = Math . ceil ( markMeasure . duration * 100 ) / 100 ;
38
+ const percentage =
39
+ Math . ceil (
40
+ ( markMeasure . duration / this . totalMeasure . duration ) * 100 * 100 ,
41
+ ) / 100 ;
42
+ console . warn (
43
+ `${ mark } : ${ markDuration . toFixed ( 2 ) } ms (${ percentage . toFixed ( 2 ) } %)` ,
44
+ ) ;
45
+ } catch {
46
+ // noop
47
+ }
44
48
} ) ;
45
49
}
46
50
}
You can’t perform that action at this time.
0 commit comments