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

findDeep return types problem #84

Closed
casamia918 opened this issue Dec 24, 2020 · 3 comments
Closed

findDeep return types problem #84

casamia918 opened this issue Dec 24, 2020 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed nobodycares types

Comments

@casamia918
Copy link
Contributor

export interface IDeepEntry {
  value: any;
  key?: string | number;
  path?: Path;
  parent?: IDeepEntry;
  /**
   * contains matched childrenPath path of this parent node, chosen from childrenPath array, if it was specified.
   */
  childrenPath?: Path;
}

For now, IDeepEntry interface is defined as above.
But it has no context field. Which should be IIterateeContext
Also, the type of parent field is defined as IDeepEntry. But when I call findDeep, type of returnedObj.parent is not IDeepEntry (it is parent.value obj)

@casamia918
Copy link
Contributor Author

#85

@YuriGor
Copy link
Owner

YuriGor commented Dec 25, 2020

Actually there is a real issue with types here, findDeep return type should not be IDeepEntry, but a separate type.

@YuriGor YuriGor reopened this Dec 25, 2020
@YuriGor YuriGor added bug Something isn't working types labels Dec 25, 2020
@YuriGor YuriGor added the help wanted Extra attention is needed label Apr 21, 2021
@YuriGor
Copy link
Owner

YuriGor commented Apr 21, 2021

I have no time and very low motivation for this issue, because I am not using TS.
For the same reason it's difficult for me to develop TS-related stuff.
So if someone from TS world have free time to take a look at this issue - PR is very welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed nobodycares types
Projects
None yet
Development

No branches or pull requests

2 participants