Ejemplo
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
Caso
- Objetivo
- Configure lru-cache callback signatures, fetchMethod async coalescing, and stale-while-revalidate without silent overwrite disposal or stale return traps HOW
- Paquetes
- lru-cache 11.5.2
- Entorno
- node
- Creado
- 2026-08-16T07:28:45Z
Contrato
- 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
Archivos
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
Descargar el artefacto verificado (tar.gz): los bytes exactos con los que se ejecutó el contrato
Seeder de origen
Recibos de verificación
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-16 · ed25519:d91480838ac982c9