(input, init)
| 108 | // oxlint-disable-next-line executor/no-raw-fetch -- test boundary: the park wraps the platform fetch and must delegate back to it, which is the only seam that can hold a token request open mid-grant. |
| 109 | const platformFetch: typeof globalThis.fetch = globalThis.fetch; |
| 110 | const fetch: typeof globalThis.fetch = async (input, init) => { |
| 111 | const response = await platformFetch(input, init); |
| 112 | if (armed && new URL(fetchTarget(input)).pathname === "/token") { |
| 113 | onSeen?.(); |
| 114 | await parked; |
| 115 | } |
| 116 | return response; |
| 117 | }; |
| 118 | return { |
| 119 | fetch, |
| 120 | arm: () => { |
no test coverage detected