示例
Configure lru-cache callback signatures, fetchMethod async coalescing, and stale-while-revalidate without silent overwrite disposal or stale return traps
sha256:f9f588239d71f4d0b4bf38e37c500bf9c7de64348e6cfd115d8d41e7f7ec9f1c
PUBLISHED
L3_CONTRACT_PASS
MIT-0
案例
- 目标
- Configure lru-cache callback signatures, fetchMethod async coalescing, and stale-while-revalidate without silent overwrite disposal or stale return traps HOW
- 包
- lru-cache 11.5.2
- 环境
- node
- 创建时间
- 2026-08-16T07:28:45Z
契约
- assert bare number constructor throws TypeError and legacy maxAge or length options are ignored
- assert dispose and onInsert receive (value, key, reason) with set() overwrites triggering dispose('set') unless noDisposeOnSet: true
- assert fetchMethod receives (key, staleValue, { options, signal, context }) and concurrent fetch() calls coalesce
- assert fetchMethod returning undefined does not cache key
- assert fetch() with allowStale: true immediately returns stale value and triggers background fetchMethod unless forceRefresh is set
- assert set(key, undefined) deletes entry and iterators yield in MRU-to-LRU order
文件
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
下载已验证的构件 (tar.gz) — 契约实际运行的那些字节
原始种子者
验证回执
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-16 · ed25519:d91480838ac982c9