UNPKG

transitory

Version:

In-memory cache with high hit rates via LFU eviction. Supports time-based expiration, automatic loading and metrics.

6 lines (5 loc) 189 B
import { KeyType } from './KeyType'; /** * Weigher that evaluates a key and value and returns a size. */ export declare type Weigher<K extends KeyType, V> = (key: K, value: V) => number;