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

return type of findDeep should be optional #81

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

return type of findDeep should be optional #81

casamia918 opened this issue Dec 19, 2020 · 3 comments
Labels
bug Something isn't working types

Comments

@casamia918
Copy link
Contributor

casamia918 commented Dec 19, 2020

// findDeep.d.ts

export default function findDeep(
  obj: any,
  callback?: (
    value: any,
    key: string | number,
    parentValue: any,
    context: IIterateeContext
  ) => void | boolean,
  options?: {
    pathFormat?: "string" | "array"; // = "string";
    checkCircular?: boolean; // = false;
    childrenPath?: Path[];
    includeRoot?: boolean;
    leavesOnly?: boolean; // = false;
    rootIsChildren?: boolean;
  }
): IDeepEntry;

In findDeep, return type is defined as IDeepEntry. But it should be optional, when no value is found.

At now, I only use findDeep method. So, I don't know how many methods should be modified in this library.

So, I just leave this comment, not PR

Thanks for create this library.

@YuriGor
Copy link
Owner

YuriGor commented Dec 19, 2020

Hi, thank you!
Feel free to create as much small PRs as you want whenever you found something wrong in types.
I am not familiar with typescript, so it would be great to have fix suggestions from someone who is using it.

@YuriGor YuriGor added bug Something isn't working types labels Dec 19, 2020
@casamia918
Copy link
Contributor Author

#85

@YuriGor
Copy link
Owner

YuriGor commented Dec 25, 2020

Thank you for PR, merged and will be published soon.

@YuriGor YuriGor closed this as completed Dec 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working types
Projects
None yet
Development

No branches or pull requests

2 participants