fastify / fastify-caching

A Fastify plugin to facilitate working with cache headers
MIT License
201 stars 26 forks source link

fix: typings of fastify.cache.get #133

Closed Uzlopak closed 11 months ago

Uzlopak commented 11 months ago

Resolves #132

Question is, if a non callback .get() is returning a promise. I also assumed that if the key has no value it returns undefined.

Before merging it would be good to clear this.

Checklist

Uzlopak commented 11 months ago

Checked... If key has no value fastify.cache.get will return null If useAwait for abstractcache is set, we need to return a promise The return value if existing is an object with the keys: item, ttl and stored.

jsumners commented 11 months ago

Is there a specific question you need my input on?

Uzlopak commented 11 months ago

No I tested it and set the types based on the return values Also sry, i forgot you dont want to review typescript related PRs.