mistval / node-fetch-cache

Node-fetch with built-in response caching.
MIT License
51 stars 8 forks source link

@types/node-fetch-cache/Index.d.ts has wrong types for MemoryCache.set #36

Closed broksonic21 closed 11 months ago

broksonic21 commented 11 months ago

Been using node-fetch-cache and big fan, but a few pieces of feedback. I'll file them as separate PRs from what we've run into. Thanks for consideration!

The code has https://github.com/mistval/node-fetch-cache/blob/master/src/classes/caching/memory_cache.js#L37 async set(key, bodyStream, metaData)

but @types/node-fetch-cache has

set(value: any): Promise<any>;

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node-fetch-cache/index.d.ts#L26

broksonic21 commented 11 months ago

https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/67044

mistval commented 11 months ago

Hi, built-in TS definitions is something else I would like to add in a v4 release. Someone was awesome enough to add types to DefinitelyTyped but I'd like to get them into the package directly.

broksonic21 commented 11 months ago

@mistval for now - there's a PR out to fix the DefinitelyTyped types for node-fetch-cache: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/67070

broksonic21 commented 11 months ago

This was released, so this is good to go.