Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UnderScore] Update definitions of findIndex/findLastIndex #9711

Merged
merged 1 commit into from
Jun 21, 2016

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.

@@ -1017,6 +1002,11 @@ interface UnderscoreStatic {
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
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.

None yet

3 participants