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

rejectBy type signature is not correct #33

Open
arthur5005 opened this issue Nov 26, 2024 · 1 comment
Open

rejectBy type signature is not correct #33

arthur5005 opened this issue Nov 26, 2024 · 1 comment

Comments

@arthur5005
Copy link

arthur5005 commented Nov 26, 2024

Currently rejectBy templates the value you're trying to rejectBy instead of key

export declare function rejectBy<T>([byPath, value, array]: [string, T | T[] | undefined, T[]]): T[];

Should probably match filterBy

export declare function filterBy<T extends object, K extends keyof T>([byPath, value, array,]: [K, T[K] | T[] | undefined, T[]]): T[];

Also, they should probably define an overload so that the docs are still valid (which optionally allow for 2 params instead of 3)

@arthur5005 arthur5005 changed the title filterBy type signature is not correct rejectBy type signature is not correct Nov 26, 2024
@NullVoxPopuli
Copy link
Owner

PR and tests welcome! <3

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

2 participants