Skip to content

Commit

Permalink
fix: Make IS_MAYBE_MIRAGE simplified (#9385)
Browse files Browse the repository at this point in the history
- In previous version we fixed the code for FireFox that can now work in FireFox which has different `.toString()` implementation
- This change should make it more error prone as it completely removes whitespace from the strings and then compares them
  • Loading branch information
MichalBryxi authored May 8, 2024
1 parent 6a36dc9 commit 44655c6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/request/src/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ if (DEBUG) {
Boolean(
typeof window !== 'undefined' &&
((window as { server?: { pretender: unknown } }).server?.pretender ||
(window.fetch.toString() !== 'function fetch() { [native code] }' &&
window.fetch.toString() !== 'function fetch() {\n [native code]\n}'))
window.fetch.toString().replace(/\s+/g, '') !== 'function fetch() { [native code] }'.replace(/\s+/g, ''))
);
}

Expand Down

0 comments on commit 44655c6

Please sign in to comment.