@isaacs/ttlcache 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.d.ts +1 -1
  2. package/index.js +2 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -89,7 +89,7 @@ declare class TTLCache<K, V> implements Iterable<[K, V]> {
89
89
  }
90
90
 
91
91
  declare namespace TTLCache {
92
- type DisposeReason = 'evict' | 'set' | 'delete'
92
+ type DisposeReason = 'evict' | 'set' | 'delete' | 'stale'
93
93
 
94
94
  type Disposer<K, V> = (
95
95
  value: V,
package/index.js CHANGED
@@ -3,12 +3,14 @@
3
3
  // Relies on the fact that integer Object keys are kept sorted,
4
4
  // and managed very efficiently by V8.
5
5
 
6
+ /* istanbul ignore next */
6
7
  const perf =
7
8
  typeof performance === 'object' &&
8
9
  performance &&
9
10
  typeof performance.now === 'function'
10
11
  ? performance
11
12
  : Date
13
+
12
14
  const now = () => perf.now()
13
15
  const isPosInt = n => n && n === Math.floor(n) && n > 0 && isFinite(n)
14
16
  const isPosIntOrInf = n => n === Infinity || isPosInt(n)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isaacs/ttlcache",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "files": [
5
5
  "index.js",
6
6
  "index.d.ts"