File tree 10 files changed +15
-15
lines changed
10 files changed +15
-15
lines changed Original file line number Diff line number Diff line change 72
72
"pixelmatch" : " ^4.0.2" ,
73
73
"text-diff" : " ^1.0.1" ,
74
74
"ts-loader" : " ^6.1.2" ,
75
- "typescript" : " 3.6.3 " ,
75
+ "typescript" : " ^3.7.5 " ,
76
76
"webpack" : " ^4.41.0" ,
77
77
"webpack-cli" : " ^3.3.9"
78
78
},
Original file line number Diff line number Diff line change @@ -93,8 +93,8 @@ export class CRBrowser extends platform.EventEmitter implements Browser {
93
93
94
94
close : async ( ) : Promise < void > => {
95
95
assert ( contextId , 'Non-incognito profiles cannot be closed!' ) ;
96
- await this . _client . send ( 'Target.disposeBrowserContext' , { browserContextId : contextId ! } ) ;
97
- this . _contexts . delete ( contextId ! ) ;
96
+ await this . _client . send ( 'Target.disposeBrowserContext' , { browserContextId : contextId } ) ;
97
+ this . _contexts . delete ( contextId ) ;
98
98
} ,
99
99
100
100
cookies : async ( ) : Promise < network . NetworkCookie [ ] > => {
@@ -288,7 +288,7 @@ export class CRBrowser extends platform.EventEmitter implements Browser {
288
288
assert ( this . _tracingClient , 'Tracing was not started.' ) ;
289
289
let fulfill : ( buffer : platform . BufferType ) => void ;
290
290
const contentPromise = new Promise < platform . BufferType > ( x => fulfill = x ) ;
291
- this . _tracingClient ! . once ( 'Tracing.tracingComplete' , event => {
291
+ this . _tracingClient . once ( 'Tracing.tracingComplete' , event => {
292
292
readProtocolStream ( this . _tracingClient ! , event . stream ! , this . _tracingPath ) . then ( fulfill ) ;
293
293
} ) ;
294
294
await this . _tracingClient ! . send ( 'Tracing.end' ) ;
Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ class JSCoverage {
129
129
this . _client . send ( 'Profiler.stopPreciseCoverage' ) ,
130
130
this . _client . send ( 'Profiler.disable' ) ,
131
131
this . _client . send ( 'Debugger.disable' ) ,
132
- ] ) ;
132
+ ] as const ) ;
133
133
helper . removeEventListeners ( this . _eventListeners ) ;
134
134
135
135
const coverage = [ ] ;
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ export class CRPage implements PageDelegate {
91
91
const [ , { frameTree} ] = await Promise . all ( [
92
92
this . _client . send ( 'Page.enable' ) ,
93
93
this . _client . send ( 'Page.getFrameTree' ) ,
94
- ] ) ;
94
+ ] as const ) ;
95
95
this . _handleFrameTree ( frameTree ) ;
96
96
const promises : Promise < any > [ ] = [
97
97
this . _client . send ( 'Log.enable' , { } ) ,
Original file line number Diff line number Diff line change @@ -237,7 +237,7 @@ export class ElementHandle<T extends Node = Node> extends js.JSHandle<T> {
237
237
const [ quads , metrics ] = await Promise . all ( [
238
238
this . _page . _delegate . getContentQuads ( this ) ,
239
239
this . _page . _delegate . layoutViewport ( ) ,
240
- ] ) ;
240
+ ] as const ) ;
241
241
if ( ! quads || ! quads . length )
242
242
throw new Error ( 'Node is either not visible or not an HTMLElement' ) ;
243
243
Original file line number Diff line number Diff line change @@ -188,8 +188,8 @@ export class FFBrowser extends platform.EventEmitter implements Browser {
188
188
189
189
close : async ( ) : Promise < void > => {
190
190
assert ( browserContextId , 'Non-incognito profiles cannot be closed!' ) ;
191
- await this . _connection . send ( 'Target.removeBrowserContext' , { browserContextId : browserContextId ! } ) ;
192
- this . _contexts . delete ( browserContextId ! ) ;
191
+ await this . _connection . send ( 'Target.removeBrowserContext' , { browserContextId } ) ;
192
+ this . _contexts . delete ( browserContextId ) ;
193
193
} ,
194
194
195
195
cookies : async ( ) : Promise < network . NetworkCookie [ ] > => {
Original file line number Diff line number Diff line change @@ -783,7 +783,7 @@ export class Frame {
783
783
const context = await this . _context ( 'utility' ) ;
784
784
const maybeHandle = await context . _$ ( selector ) ;
785
785
assert ( maybeHandle , 'No node found for selector: ' + selector ) ;
786
- handle = maybeHandle ! ;
786
+ handle = maybeHandle ;
787
787
}
788
788
return handle ;
789
789
}
Original file line number Diff line number Diff line change @@ -219,7 +219,7 @@ class Helper {
219
219
}
220
220
}
221
221
222
- export function assert ( value : any , message ?: string ) {
222
+ export function assert ( value : any , message ?: string ) : asserts value {
223
223
if ( ! value )
224
224
throw new Error ( message ) ;
225
225
}
Original file line number Diff line number Diff line change @@ -201,20 +201,20 @@ export class Request {
201
201
assert ( this . _delegate , 'Request Interception is not enabled!' ) ;
202
202
assert ( ! this . _interceptionHandled , 'Request is already handled!' ) ;
203
203
this . _interceptionHandled = true ;
204
- await this . _delegate ! . abort ( errorCode ) ;
204
+ await this . _delegate . abort ( errorCode ) ;
205
205
}
206
206
207
207
async fulfill ( response : { status : number ; headers : Headers ; contentType : string ; body : ( string | platform . BufferType ) ; } ) { // Mocking responses for dataURL requests is not currently supported.
208
208
assert ( this . _delegate , 'Request Interception is not enabled!' ) ;
209
209
assert ( ! this . _interceptionHandled , 'Request is already handled!' ) ;
210
210
this . _interceptionHandled = true ;
211
- await this . _delegate ! . fulfill ( response ) ;
211
+ await this . _delegate . fulfill ( response ) ;
212
212
}
213
213
214
214
async continue ( overrides : { method ?: string ; headers ?: Headers ; postData ?: string } = { } ) {
215
215
assert ( this . _delegate , 'Request Interception is not enabled!' ) ;
216
216
assert ( ! this . _interceptionHandled , 'Request is already handled!' ) ;
217
- await this . _delegate ! . continue ( overrides ) ;
217
+ await this . _delegate . continue ( overrides ) ;
218
218
}
219
219
220
220
_isIntercepted ( ) : boolean {
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ export class WKPage implements PageDelegate {
112
112
// Page agent must be enabled before Runtime.
113
113
session . send ( 'Page.enable' ) ,
114
114
session . send ( 'Page.getResourceTree' ) ,
115
- ] ) ;
115
+ ] as const ) ;
116
116
resourceTreeHandler ( frameTree ) ;
117
117
const promises : Promise < any > [ ] = [
118
118
// Resource tree should be received before first execution context.
You can’t perform that action at this time.
0 commit comments