Commit 4f50527
authored
fix: Refactor promise check for response handling (#277)
* Refactor promise check for response handling
I got an error because `instanceof` wouldn't recognize `res` as a `Promise`.
Might be related to my usage of `tsx`, idk.
Anyway, if I change to check for a `then` method, everything works again.
* Check for 'then' property before calling it
* Refactor promise check in response handling1 parent cf75f9d commit 4f50527
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
101 | 104 | | |
102 | 105 | | |
103 | 106 | | |
104 | 107 | | |
105 | 108 | | |
106 | | - | |
| 109 | + | |
107 | 110 | | |
108 | 111 | | |
109 | 112 | | |
| |||
0 commit comments