klaemo commented on issue #381:
URL: https://github.com/apache/couchdb-nano/issues/381#issuecomment-6452240170
Yes, option 2 works for me, and it fits the zero-dependency goal best.
I tried it with a minimal interface inside the `nano` namespace and removed
the `undici` import:
```ts
interface Dispatcher {
dispatch(options: object, handler: object): boolean;
}
```
With undici 7 installed, `Agent`, `MockAgent`, `Pool`, `ProxyAgent`,
`RetryAgent`, `getGlobalDispatcher()` and `agent.compose(...)` are all
accepted. Keeping undici as a devDependency for the test mocks is fine, because
the published types no longer reference it.
The trade-off is that the type only checks for a `dispatch` method, not
undici's full `Dispatcher` API. nano only passes the value through to `fetch`,
so that's all it needs.
The fix for #380 changes the same `agentOptions` line, so I'd put both in
one small PR together with the missing `parseUrl` from #362, if that's OK with
you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]