-
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Describe the bug
The docs state that a callback can be passed to contains, but that's not the case, and the types in fact reflect this.
Relevant code:
contains(keyOrItem: T | keyof T | undefined, value?: any): boolean {
if (arguments.length === 1) {
if (keyOrItem === undefined)
return false
return collection.items.includes(keyOrItem as T)
}
return collection.items.some(item => item[keyOrItem as keyof T] === value)
},One solution is to edit the docs and remove references to the callback function. A better solution might be to implement this (see, for example, how collect.js does it)
Reproduction
https://I-dont-believe-its-needed.com
System Info
Not neededUsed Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guide.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- The provided reproduction is a minimal reproducible of the bug.
mjsarfatti
Metadata
Metadata
Assignees
Labels
No labels