Last 12 weeks · 1 commit
4 of 6 standards met
Replace and the hand-written with a single typed that is compiled to . Runtime behavior is unchanged; the JSDoc from now lives on the members it documents, so the emitted declarations keep the same docs. Iterator-returning members are typed , since is no longer assignable to the signatures they override. The constructor destructures via so the still fires on while stays required in the public signature. deliberately keeps so a falls back to . Tests move to unchanged apart from type annotations and on the cases that intentionally pass invalid input. ava runs them through , so no compile step is needed to test on Node 18. Swap for , which supports ESM — the reason coverage upload was commented out in CI — and bump ava, xo, and tsd. Add Node 22 to the CI matrix.
Summary The test (added in #24) actually asserts the opposite of its name: it checks that is called when shrinks the cache (). Renamed it to to match what it verifies. No behavioral or assertion changes. Test plan [x] Read through test.js to confirm the assertions match the new name [ ] CI (xo && nyc ava && tsd) passes on this PR
Summary add for newest-first key iteration add for newest-first value iteration update TypeScript declarations and README add tests for ordering and duplicate-key behavior Why The API already exposes , but consumers currently need to map over entries just to get newest-first keys or values. Adding these iterators makes the API more symmetric and convenient while keeping the implementation small. Notes implementation delegates to to preserve ordering semantics verified the new iterators locally with direct runtime checks I was not able to complete the full run in this environment because stalled before devDependencies finished installing
Repository: sindresorhus/quick-lru. Description: Simple “Least Recently Used” (LRU) cache Stars: 765, Forks: 60. Primary language: JavaScript. Languages: JavaScript (98.5%), TypeScript (1.5%). License: MIT. Latest release: v7.3.0 (10mo ago). Open PRs: 0, open issues: 0. Last activity: 1mo ago. Community health: 85%. Top contributors: sindresorhus, BendingBender, skeggse, javi11, silverwind, adityapatadia, achingbrain, coreyfarrell, fabiospampinato, lukechilds and others.