• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Kikobeats / cacheable-response / 40911308883
99%

Build:
DEFAULT BRANCH: master
Ran 29 Oct 2026 04:25PM UTC
Jobs 1
Files 2
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

29 Oct 2026 04:24PM UTC coverage: 99.433%. Remained the same
40911308883

push

github

web-flow
fix(types): type `cache` as a Keyv instance or Keyv options (#153)

* fix(types): type `cache` as a Keyv instance or Keyv options

The runtime passes `cache` to @keyvhq/memoize, which uses a Keyv
instance as is and otherwise calls `new Keyv(cache)`. A plain
`{ get, set }` object was therefore read as Keyv options and never read
from, while a real Keyv instance did not type-check.

`CacheProvider` is now `Keyv<any>` or Keyv options without
get/set/has/delete/clear keys, which would replace the Keyv methods.
`cache` no longer takes part in generic inference, and `send` props no
longer drive inference, so `{ ...params, cache }` keeps the props
inferred from `get`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(types): lock each cache method the type rejects

Dropping one of get, set, has, delete, or clear still typechecked, and send
only had to accept data. Reject each method on its own, require get's extra
props to reach send, and describe cache as Keyv options.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(types): reject cache options that replace Keyv prefix methods

new Keyv(options) copies _getKeyPrefix onto the instance, and memoize uses
that method to find a stored entry. The type still allowed the key.

Co-authored-by: Cursor <cursoragent@cursor.com>

* test(types): drop a const assertion the cache check does not use

The plain cache is rejected because it has set, not because set returns the literal true.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(types): reject a cache option that replaces Keyv#iterator

Object.assign copies iterator onto the instance, and the constructor leaves
it in place when the store does not install one.

Co-authored-by: Cursor <cursoragent@cursor.com>

* test(types): lock the Keyv options a cache is allowed to set

serialize, deserialize, and ttl are copied onto the instance on purpose.
Banning them left the type tests green.

Co-authored-by: Cursor <cursoragent@cursor.com>

* tes... (continued)

92 of 94 branches covered (97.87%)

Branch coverage included in aggregate %.

259 of 259 relevant lines covered (100.0%)

52.92 hits per line

Jobs
ID Job ID Ran Files Coverage
1 40911308883.1 29 Oct 2026 04:25PM UTC 2
99.43
GitHub Action Run
Source Files on build 40911308883
  • Tree
  • List 2
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #40911308883
  • 0aef307e on github
  • Prev Build on master (#40840670972)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc