File tree 2 files changed +4
-9
lines changed
2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -49,12 +49,7 @@ export const isBlob = object => {
49
49
* @return {boolean }
50
50
*/
51
51
export const isAbortSignal = object => {
52
- return (
53
- typeof object === 'object' && (
54
- object [ NAME ] === 'AbortSignal' ||
55
- object [ NAME ] === 'EventTarget'
56
- )
57
- ) ;
52
+ return object ?. [ NAME ] === 'AbortSignal' ;
58
53
} ;
59
54
60
55
/**
Original file line number Diff line number Diff line change @@ -1206,11 +1206,11 @@ describe('node-fetch', () => {
1206
1206
1207
1207
testAbortController ( 'mysticatea' , ( ) => new AbortControllerMysticatea ( ) ) ;
1208
1208
1209
- if ( process . version > 'v15' ) {
1210
- testAbortController ( 'native' , ( ) => new AbortController ( ) ) ;
1209
+ if ( globalThis . AbortController ) {
1210
+ testAbortController ( 'native' , ( ) => new globalThis . AbortController ( ) ) ;
1211
1211
}
1212
1212
1213
- it ( 'should throw a TypeError if a signal is not of type AbortSignal or EventTarget ' , ( ) => {
1213
+ it ( 'should throw a TypeError if a signal is not of type AbortSignal' , ( ) => {
1214
1214
return Promise . all ( [
1215
1215
expect ( fetch ( `${ base } inspect` , { signal : { } } ) )
1216
1216
. to . be . eventually . rejected
You can’t perform that action at this time.
0 commit comments