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

Missing / Incorrect Definitions for Chainable first / last #24

Open
sfrooster opened this issue Aug 18, 2016 · 3 comments
Open

Missing / Incorrect Definitions for Chainable first / last #24

sfrooster opened this issue Aug 18, 2016 · 3 comments

Comments

@sfrooster
Copy link
Contributor

Was attempting to do something like the following:
let eventName = _.chain("X.Y:Z").split(":").first().split(".").last().value();

and receiving an error on "first".

Adding the following:
interface LoDashExplicitArrayWrapper<T> { first(): LoDashExplicitWrapper<T>; }

fixed it. This seems like a valid addition because there is a near similar definition for "last" which looks like:
interface LoDashExplicitArrayWrapper<T> { last(): T; }

The difference between the two being LoDashExplicitWrapper vs T.

So I changed last to also return LoDashExplicitWrapper and now the above works.

@demurgos
Copy link
Member

demurgos commented Sep 2, 2016

Thank you for this report: I agree that this is a missing declaration.
Since you were able to solve this issue, could you send a PR ?

@sfrooster
Copy link
Contributor Author

#25

@blakeembrey
Copy link
Member

Would one of you like to own this definition? /cc @types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants