Skip to content

Conversation

@nallwhy
Copy link
Contributor

@nallwhy nallwhy commented Jun 19, 2016

As predicates of findIndex / findLastIndex are transformed by _.iteratee, they can take Object as a predicates.

And findIndex / findLastIndex can't return __Chain. I changed it to __ChainSingle.

http://underscorejs.org/#iteratee
http://underscorejs.org/#findIndex

@dt-bot
Copy link
Member

dt-bot commented Jun 19, 2016

underscore/underscore.d.ts

to authors (@borisyankov @jbaldwin @ccurrens). Could you review this PR?
👍 or 👎?

Checklist

  • pass the Travis CI test?

@nallwhy nallwhy changed the title Update definitions of findIndex/findLastIndex [UnderScore] Update definitions of findIndex/findLastIndex Jun 19, 2016
@nallwhy
Copy link
Contributor Author

nallwhy commented Jun 19, 2016

As there are many other methods that transform their predicates through _.iteratee, I'm gonna check them later.

predicate: _.ListIterator<T, boolean>,
context?: any): number;

findIndex<T, U extends {}>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

U extends {} means the same thing as just U. it is rather confusing to use this for some declarations and not others. so i would recommend removing it.

@mhegazy mhegazy added the Revision needed This PR needs code changes before it can be merged. label Jun 20, 2016
@nallwhy nallwhy force-pushed the underscore-find_index branch from e1f8f28 to 464602f Compare June 21, 2016 05:29
@nallwhy
Copy link
Contributor Author

nallwhy commented Jun 21, 2016

@mhegazy I fixed it. Thank you!

@mhegazy mhegazy merged commit f9ff331 into DefinitelyTyped:master Jun 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Revision needed This PR needs code changes before it can be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants