@freedomofpress/webcat
    Preparing search index...

    Class LRUSet<T>

    An unkeyed fixed-size in-memory cache that automatically evicts the least recently used entry first when it reaches its size limit.

    Type Parameters

    • T

      The type of values to store in this cache.

    Index
    • Type Parameters

      • T

        The type of values to store in this cache.

      Parameters

      • limit: number

        The maximum number of entries held by the cache.

      Returns LRUSet<T>

    • Caches a value.

      Parameters

      • value: T

        The value to cache.

      Returns Promise<void>

    • Clears all values from the cache.

      Returns Promise<void>

    • Clears a single value from the cache.

      Parameters

      • value: T

        The value to clear.

      Returns Promise<void>

    • Parameters

      • value: T

      Returns Promise<boolean>

      A Promise that resolves to true if the given value exists in the cache.

    • Returns Promise<T[]>

      A Promise that resolves to an array of the values in the cache.