Represents a class to hold key-value pairs using Collection. This is a extension of [Map] to add Array-like functions and a update builder.

Hierarchy

Constructors

Properties

[toStringTag]: string
constructor: typeof Collection
size: number
[species]: MapConstructor

Accessors

  • get empty(): boolean
  • Returns if this [[Collection]] is empty or not

    Returns boolean

Methods

  • Returns an iterable of entries in the map.

    Returns IterableIterator<[string, VoiceConnection]>

  • Returns void

  • Parameters

    • key: string

    Returns boolean

  • Returns an iterable of key, value pairs for every entry in the map.

    Returns IterableIterator<[string, VoiceConnection]>

  • Use a predicate function to filter out anything and return a new Array

    Returns

    A new Array of the values that returned true in the predicate function

    Type Parameters

    Parameters

    • predicate: Predicate<ThisArg, VoiceConnection, number, string, boolean>

      The predicate function to filter out

    • Optional thisArg: ThisArg

      An additional this context if needed

    Returns VoiceConnection[]

  • Use a predicate function to filter out keys and return a new Array of the keys that resolved true in the predicate function. Use Collection#filter to filter out any values from this [[Collection]].

    Returns

    A new Array of the values that returned true in the predicate function

    Type Parameters

    Parameters

    • predicate: Predicate<ThisArg, VoiceConnection, number, string, boolean>

      The predicate function to filter out

    • Optional thisArg: ThisArg

      An additional this context if needed

    Returns string[]

  • Find a value in the collection from it's predicate function

    Returns

    The value found or null if not found

    Type Parameters

    Parameters

    • predicate: Predicate<ThisArg, VoiceConnection, number, string, boolean>

      The predicate function

    • Optional thisArg: ThisArg

      An additional this context if needed

    Returns null | VoiceConnection

  • Finds a key in the collection from it's predicate function

    Returns

    The key found or null if not found

    Type Parameters

    Parameters

    • predicate: MinimalPredicate<ThisArg, VoiceConnection, boolean>

      The predicate function

    • Optional thisArg: ThisArg

      An additional this context if needed

    Returns null | string

  • Returns the first element in the collection

    Returns undefined | VoiceConnection

  • Returns an Array of the values from the correspondant amount

    Parameters

    • amount: number

      The amount to fetch from

    Returns VoiceConnection[]

  • Returns the first key in the collection

    Returns undefined | string

  • Returns an Array of the keys from the correspondant amount

    Parameters

    • amount: number

      The amount to fetch from

    Returns string[]

  • Parameters

    • key: string

    Returns boolean

  • Returns an iterable of keys in the map

    Returns IterableIterator<string>

  • Returns the last element in the collection

    Returns undefined | VoiceConnection

  • Returns an Array of the values from the correspondant amount

    Parameters

    • amount: number

      The amount to fetch from

    Returns VoiceConnection[]

  • Returns the last element in the collection

    Returns undefined | string

  • Returns an Array of the values from the correspondant amount

    Parameters

    • amount: number

      The amount to fetch from

    Returns string[]

  • Use a predicate function to map anything into a new array

    Returns

    A new Array of the values from that function

    Type Parameters

    Parameters

    • predicate: Predicate<ThisArg, VoiceConnection, number, string, S>

      The predicate function to map out and return a new array

    • Optional thisArg: ThisArg

      An additional this context if needed

    Returns S[]

  • Returns a random value from the collection

    Returns

    A random value or null if the collection is empty

    Returns null | VoiceConnection

  • Gets the first item in the collection and removes it (if provided)

    Parameters

    • Optional remove: boolean

      If we should remove it or not

    Returns undefined | VoiceConnection

  • Similar to [Array.some], this function tests whether atleast 1 item in the predicate function passes the test in the values cache.

    Returns

    A boolean value if 1 item of the cache is truthy

    Parameters

    Returns boolean

  • Similar to [Array.some], this functions tests whether atleast 1 key in the predicate function passes the test in the key cache.

    Returns

    A boolean value if 1 item of the cache is truthy

    Parameters

    • func: ((item: string) => boolean)

      The function to use to filter out

        • (item: string): boolean
        • Parameters

          • item: string

          Returns boolean

    Returns boolean

  • Similar to [Array.sort], which basically sorts the values of this Collection to return a value

    Returns

    The value

    Parameters

    • compareFn: ((a: string, b: string) => number)

      The compare function

        • (a: string, b: string): number
        • Parameters

          • a: string
          • b: string

          Returns number

    Returns string[]

  • Returns all of the keys as an Array

    Returns string[]

  • Gets the last item in the collection and removes it(if provided)

    Parameters

    • remove: boolean

      If we should remove it or not

    Returns undefined | VoiceConnection