Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno_nest/modules/cache/mod.ts>default

Refer to nestjs to realize some common functions for Deno, support hono and oak
Go to Latest
class default
import { default } from "https://deno.land/x/deno_nest@v3.3.1/modules/cache/mod.ts";

Constructors

new
default(options: Options<K, V>)

Properties

optional
addItemSize: (index: number, size: number) => void
allowStale: boolean
optional
calculatedSize: number
dispose: Disposer<K, V> | undefined
disposeAfter: Disposer<K, V> | null
disposed: any[] | null
optional
fetchContext: any
fetchMethod: Fetcher<K, V> | null
free: Stack
head: number
initialFill: number
keyList: any[]
keyMap: Map<any, any>
max: number
maxSize: number
next:
| ZeroArray
| Uint32Array
| Uint16Array
| Uint8Array
noDeleteOnFetchRejection: boolean
noDeleteOnStaleGet: boolean
noDisposeOnSet: boolean
noUpdateTTL: boolean
prev:
| ZeroArray
| Uint32Array
| Uint16Array
| Uint8Array
optional
removeItemSize: (index: number) => void
optional
setItemTTL: (
index: number,
ttl: number,
start?: number,
) => void
size: number
optional
sizeCalculation: SizeCalculator<K, V>
optional
sizes: ZeroArray
optional
starts: ZeroArray
tail: number
ttl: number
ttlAutopurge: boolean
ttlResolution: number
optional
ttls: ZeroArray
updateAgeOnGet: boolean
updateAgeOnHas: boolean
optional
updateItemAge: (index: number) => void
valList: any[]

Methods

backgroundFetch(
k: K,
index: number,
options: FetchOptions<K, V>,
context: any,
)
connect(p: number, n: number)
delete(k: K)
evict(free: boolean)
fetch<ExpectedValue = V>(k: K, unnamed 1?: FetchOptions<K, V>)
find<T = V>(fn: (
value: V,
key: K,
cache: this,
) => boolean | undefined | void
, options?: GetOptions
): T | undefined
forEach<T = this>(fn: (
this: T | undefined,
value: V,
key: K,
cache: this,
) => void
, thisArg?: T
): void
get<T = V>(k: K, unnamed 1?: GetOptions): T | undefined
getRemainingTTL(key: K): number
has(k: K, unnamed 1?)
indexes(unnamed 0?)
isStale(index: number): boolean
isValidIndex(index: number): boolean
load(arr: ReadonlyArray<[K, Entry<V>]>)
moveToTail(index: number)
peek(k: K, unnamed 1?)
pop()
requireSize(
k: K,
v: V,
size: number,
sizeCalculation?: SizeCalculator<K, V>,
): number
rforEach<T = this>(fn: (
this: T | undefined,
value: V,
key: K,
cache: this,
) => void
, thisArg?: T
): void
rindexes(unnamed 0?)
set(
k: K,
v: V,
unnamed 2?: SetOptions<K, V>,
)

Static Properties

readonly
AbortController
readonly
AbortSignal