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

x/natico/examples/deps.ts>Collection

A powerful and customizable framework for Discordeno
Latest
class Collection
extends Map<K, V>
Re-export
import { Collection } from "https://deno.land/x/natico@4.0.0-pre.4/examples/deps.ts";

Constructors

new
Collection(entries?: (readonly (readonly [K, V])[] | null) | Map<K, V>, options?: CollectionOptions<K, V>)

Properties

optional
maxSize: number
optional
sweeper: CollectionSweeper<K, V> & { intervalId?: number; }

Methods

changeSweeperFilter(newFilter: (
value: V,
key: K,
bot: Bot,
) => boolean
)
changeSweeperInterval(newInterval: number)
every(callback: (value: V, key: K) => boolean)
filter(callback: (value: V, key: K) => boolean)
find(callback: (value: V, key: K) => boolean)
first(): V | undefined

Retrieve the value of the first element in this collection

last(): V | undefined
map<T>(callback: (value: V, key: K) => T)
random(): V | undefined
reduce<T>(callback: (
accumulator: T,
value: V,
key: K,
) => T
, initialValue?: T
): T
set(key: K, value: V)
some(callback: (value: V, key: K) => boolean)
startSweeper(options: CollectionSweeper<K, V>): number
stopSweeper(): void