Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/velo/src/cache/capabilities/policy_capability.ts>PolicyCapability

A high-performance caching library for Deno. Supports LRU, LFU, ARC, and TinyLFU.
Latest
class PolicyCapability
extends CapabilityWrapper<K, V>
import { PolicyCapability } from "https://deno.land/x/velo@1.0.0/src/cache/capabilities/policy_capability.ts";

Adds a policy to the cache. Overwrites methods without passing through to the inner cache.

Constructors

new
PolicyCapability(inner: Cache<K, V> & CacheInternal<K, V>, policy: Policy<K, V>)

Properties

private
policy: Policy<K, V>
readonly
capacity: number
readonly
keys: K[]
readonly
size: number
readonly
values: V[]

Methods

erase(key: K): void
forEach(callback: (item: { key: K; value: V; }, index?: number) => void): void
get(key: K): V | undefined
has(key: K): boolean
peek(key: K): V | undefined
remove(key: K): void
reset(): void
set(key: K, value: V): void
take(key: K): V | undefined