You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You could argue in a real world situation you won't get a performance.now of 0. I think ideally the starts array should be initialised with null/undefineds instead? It seems like a bug that a cache with a ttl set should see it as not having a ttl because perf.now returned 0.
The text was updated successfully, but these errors were encountered:
I'm seeing another issue with using sinon timers. With a faked performance.now, the initial result will be
0
until you advance the timer.But the default fill of the starts array is 0 https://github.com/isaacs/node-lru-cache/blob/main/src/index.ts#L1478. That means any value set in the cache before you manually advance a timer is seem as not having a TTL.
You could argue in a real world situation you won't get a performance.now of 0. I think ideally the starts array should be initialised with null/undefineds instead? It seems like a bug that a cache with a ttl set should see it as not having a ttl because perf.now returned 0.
The text was updated successfully, but these errors were encountered: