Skip to content

Commit

Permalink
为了兼容旧版浏览器不使用Object.hasOwn
Browse files Browse the repository at this point in the history
  • Loading branch information
Yun-Shan committed Oct 7, 2023
1 parent 52147f8 commit 013cb51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/request/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ let fetch: typeof globalThis.fetch;
let Request: typeof globalThis.Request;
let Response: typeof globalThis.Response;

if (Object.hasOwn(globalThis, 'fetch')) {
if (typeof globalThis === 'object' && Object.prototype.hasOwnProperty.call(globalThis, 'fetch')) {
fetch = globalThis.fetch;
Request = globalThis.Request;
Response = globalThis.Response;
Expand Down

0 comments on commit 013cb51

Please sign in to comment.