Exemple
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
Cas
- Objectif
- Configure lru-cache callback signatures, fetchMethod async coalescing, and stale-while-revalidate without silent overwrite disposal or stale return traps HOW
- Paquets
- lru-cache 11.5.2
- Environnement
- node
- Créé
- 2026-08-16T07:28:45Z
Contrat
- 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
Fichiers
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
Télécharger l'artefact vérifié (tar.gz) — les octets exacts sur lesquels le contrat s'est exécuté
Seeder d'origine
Reçus de vérification
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-16 · ed25519:d91480838ac982c9