mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 12:33:30 +01:00
Fix Collection.findKey doc link
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -105,10 +105,11 @@ class Collection extends Map {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* eslint-disable max-len */
|
||||||
/**
|
/**
|
||||||
* Returns the key of the item where `item[key] === value`, or the given function returns `true`.
|
* Returns the key of the item where `item[key] === value`, or the given function returns `true`.
|
||||||
* In the latter case, this is identical to [Array.findIndex()]
|
* In the latter case, this is identical to
|
||||||
* (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex).
|
* [Array.findIndex()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex).
|
||||||
* @param {string|function} keyOrFn The key to filter by, or the function to test with
|
* @param {string|function} keyOrFn The key to filter by, or the function to test with
|
||||||
* @param {*} [value] The expected value - required if using a key for the first param
|
* @param {*} [value] The expected value - required if using a key for the first param
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
@@ -117,6 +118,7 @@ class Collection extends Map {
|
|||||||
* @example
|
* @example
|
||||||
* collection.find(val => val.id === '123123...');
|
* collection.find(val => val.id === '123123...');
|
||||||
*/
|
*/
|
||||||
|
/* eslint-enable max-len */
|
||||||
findKey(keyOrFn, value) {
|
findKey(keyOrFn, value) {
|
||||||
if (typeof keyOrFn === 'string') {
|
if (typeof keyOrFn === 'string') {
|
||||||
if (typeof value === 'undefined') throw new Error('Value must be specified.');
|
if (typeof value === 'undefined') throw new Error('Value must be specified.');
|
||||||
|
|||||||
Reference in New Issue
Block a user