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

x/velo/src/cache/capabilities/wrapper.ts>CapabilityWrapper

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

Wrapper for another cache to extend its capabilities.

This is base class for all cache capabilities. It wraps an inner cache and provides and takes care of forwarding all methods to the inner cache. This behaviour is expected to be overwritten where necessary by the concrete capability implementation.

Constructors

new
CapabilityWrapper(inner: Cache<K, V> & CacheInternal<K, V>)

Properties

private
inner: Cache<K, V> & CacheInternal<K, V>
readonly
capacity
readonly
events
optional
fireEvent: FireEventFunction<K, V>
readonly
keys
optional
onRemove: RemoveListener<K, V>
readonly
options
readonly
size
readonly
stats
readonly
values

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
setWithExpire(
key: K,
value: V,
expire: number,
): void
take(key: K): V | undefined