1
- const NAME = Symbol . toStringTag ;
1
+ const NAME = Symbol . toStringTag
2
2
3
3
/**
4
4
* Check if `obj` is a URLSearchParams object
@@ -8,19 +8,19 @@ const NAME = Symbol.toStringTag;
8
8
*/
9
9
export function isURLSearchParams ( obj : any ) : obj is URLSearchParams {
10
10
return (
11
- typeof obj === ' object' &&
12
- typeof obj . append === ' function' &&
13
- typeof obj . delete === ' function' &&
14
- typeof obj . get === ' function' &&
15
- typeof obj . getAll === ' function' &&
16
- typeof obj . has === ' function' &&
17
- typeof obj . set === ' function' &&
18
- typeof obj . sort === ' function' &&
19
- obj [ NAME ] === ' URLSearchParams'
20
- ) ;
11
+ typeof obj === " object" &&
12
+ typeof obj . append === " function" &&
13
+ typeof obj . delete === " function" &&
14
+ typeof obj . get === " function" &&
15
+ typeof obj . getAll === " function" &&
16
+ typeof obj . has === " function" &&
17
+ typeof obj . set === " function" &&
18
+ typeof obj . sort === " function" &&
19
+ obj [ NAME ] === " URLSearchParams"
20
+ )
21
21
}
22
22
23
- interface FetchBlob extends Blob {
23
+ declare interface FetchBlob extends Blob {
24
24
arrayBuffer : Function ,
25
25
type : string ,
26
26
stream : Function ,
@@ -34,13 +34,13 @@ interface FetchBlob extends Blob {
34
34
*/
35
35
export function isBlob ( obj : any ) : obj is FetchBlob {
36
36
return (
37
- typeof obj === ' object' &&
38
- typeof obj . arrayBuffer === ' function' &&
39
- typeof obj . type === ' string' &&
40
- typeof obj . stream === ' function' &&
41
- typeof obj . constructor === ' function' &&
37
+ typeof obj === " object" &&
38
+ typeof obj . arrayBuffer === " function" &&
39
+ typeof obj . type === " string" &&
40
+ typeof obj . stream === " function" &&
41
+ typeof obj . constructor === " function" &&
42
42
/ ^ ( B l o b | F i l e ) $ / . test ( obj [ NAME ] )
43
- ) ;
43
+ )
44
44
}
45
45
46
46
/**
@@ -50,9 +50,9 @@ export function isBlob(obj: any): obj is FetchBlob {
50
50
*/
51
51
export function isAbortSignal ( obj : any ) : obj is AbortSignal {
52
52
return (
53
- typeof obj === ' object' &&
54
- obj [ NAME ] === ' AbortSignal'
55
- ) ;
53
+ typeof obj === " object" &&
54
+ obj [ NAME ] === " AbortSignal"
55
+ )
56
56
}
57
57
58
58
/**
@@ -61,15 +61,15 @@ export function isAbortSignal(obj: any): obj is AbortSignal {
61
61
* @param obj The object to check.
62
62
*/
63
63
export function isArrayBuffer ( obj : any ) : obj is ArrayBuffer {
64
- return obj [ NAME ] === ' ArrayBuffer' ;
64
+ return obj [ NAME ] === " ArrayBuffer"
65
65
}
66
66
67
- interface AbortError extends Error {
67
+ declare class AbortError extends Error {
68
68
name : "AbortError" ;
69
- [ Symbol . toStringTag ] : "AbortError"
69
+ [ Symbol . toStringTag ] : "AbortError" ;
70
70
constructor ( message : string ) ;
71
71
type : string ;
72
- message : string ;
72
+ message : string
73
73
}
74
74
75
75
/**
@@ -78,5 +78,5 @@ interface AbortError extends Error {
78
78
* @param obj The object to check.
79
79
*/
80
80
export function isAbortError ( obj : any ) : obj is AbortError {
81
- return obj [ NAME ] === ' AbortError' ;
81
+ return obj [ NAME ] === " AbortError"
82
82
}
0 commit comments