Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/natico/src/util/Collection.ts>Collection

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

Constructors

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

Methods

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
some(callback: (value: V, key: K) => boolean)