Skip to content

Commit

Permalink
Fix Collection.findKey doc link
Browse files Browse the repository at this point in the history
  • Loading branch information
Gawdl3y committed Sep 12, 2016
1 parent 9560586 commit 7457985
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/docs.json

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/util/Collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
* In the latter case, this is identical to [Array.findIndex()]
* (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex).
* In the latter case, this is identical to
* [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 {*} [value] The expected value - required if using a key for the first param
* @returns {*}
Expand All @@ -117,6 +118,7 @@ class Collection extends Map {
* @example
* collection.find(val => val.id === '123123...');
*/
/* eslint-enable max-len */
findKey(keyOrFn, value) {
if (typeof keyOrFn === 'string') {
if (typeof value === 'undefined') throw new Error('Value must be specified.');
Expand Down

0 comments on commit 7457985

Please sign in to comment.