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

kibertoad / toad-cache / 28661564489
100%

Build:
DEFAULT BRANCH: main
Ran 03 Jul 2026 12:48PM UTC
Jobs 1
Files 7
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

03 Jul 2026 12:48PM UTC coverage: 100.0%. Remained the same
28661564489

push

github

web-flow
Improve input validation and fix statistics tracking edge cases (#102)

* fix: correctness issues found in audit

- Reject non-integer and non-number max/ttl in all cache constructors:
  values like 2.5, '5', Infinity or true previously passed validation
  but never matched the strict size === max eviction check, so the
  cache grew without bound; a string ttl string-concatenated into the
  expiry timestamp, silently disabling expiration
- Evict on size >= max instead of strict equality as defense in depth
- LruObjectHitStatistics: use ?? for defaults so explicit max = 0
  (unbounded everywhere else) is no longer coerced to 1000
- LruObjectHitStatistics: don't count invalidateOne for deletes of
  missing keys or evictions on an empty cache
- HitStatisticsRecord.resetForCache: no-op for unknown cacheId instead
  of throwing
- Type declarations: add missing getStatistics() to HitStatisticsRecord
  and LruObjectHitStatistics, export CacheStatistics, fix LruMap/FifoMap
  items type to Map<any, CacheEntry<T>>
- README: fix LruHitStatistics example (options object throws; the real
  constructor is positional), document integer max and the runtime-ttl
  expiry caveat
- Add regression tests for all of the above

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EbhrjjB2UdFJQ5fdnGKZzv

* test: verify max:0 is truly unlimited (no eviction)

* refactor: address review findings from PR #102

- Extract shared validateCacheParams() helper, removing the validation
  block duplicated across FifoMap/FifoObject/LruMap/LruObject
- Make ttl validation consistent with max: reject non-integers and
  Infinity (was only checking NaN), closing the gap where ttl=Infinity
  silently produced never-expiring entries
- Extract createEmptyStatisticsRecord() factory, removing the zeroed
  record literal duplicated across initForCache/resetForCache and
  HitStatistics.currentRecord (which had drifted in field ordering)
- LruObject... (continued)

186 of 186 branches covered (100.0%)

Branch coverage included in aggregate %.

17 of 17 new or added lines in 6 files covered. (100.0%)

343 of 343 relevant lines covered (100.0%)

118.6 hits per line

Jobs
ID Job ID Ran Files Coverage
1 28661564489.1 03 Jul 2026 12:48PM UTC 7
100.0
GitHub Action Run
Source Files on build 28661564489
  • Tree
  • List 7
  • Changed 7
  • Source Changed 7
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #28661564489
  • aceee270 on github
  • Prev Build on main (#28660607611)
  • Next Build on main (#28661825839)
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