File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change 1
- enum State {
1
+ export enum State {
2
2
READY ,
3
3
FAIL ,
4
4
PENDING
Original file line number Diff line number Diff line change 1
- import {
2
- LighthouseStats ,
3
- READY ,
4
- FAIL ,
5
- PENDING
6
- } from '../classes/lighthouse/Stats' ;
1
+ import { LighthouseStats , State } from '../classes/lighthouse/Stats' ;
7
2
import LighthouseError from '../classes/lighthouse/Error' ;
8
3
9
4
let controller : AbortController | undefined ;
@@ -35,7 +30,7 @@ export function getLighthouseMetrics(url: string) {
35
30
}
36
31
37
32
export function getPendingStats ( ) {
38
- return new LighthouseError ( PENDING ) ;
33
+ return new LighthouseError ( State . PENDING ) ;
39
34
}
40
35
41
36
function getAbortSignal ( ) {
@@ -48,7 +43,7 @@ function getAbortSignal() {
48
43
49
44
async function handleResponse ( response : Response ) {
50
45
if ( ! response . ok ) {
51
- throw new LighthouseError ( FAIL ) ;
46
+ throw new LighthouseError ( State . FAIL ) ;
52
47
}
53
- return new LighthouseStats ( READY , await response . json ( ) ) ;
48
+ return new LighthouseStats ( State . READY , await response . json ( ) ) ;
54
49
}
You can’t perform that action at this time.
0 commit comments