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

add after and before function to collection #10219

Closed
fiftyy opened this issue Apr 17, 2024 · 2 comments
Closed

add after and before function to collection #10219

fiftyy opened this issue Apr 17, 2024 · 2 comments

Comments

@fiftyy
Copy link

fiftyy commented Apr 17, 2024

Which application or package is this feature request for?

collection

Feature

Hello, maybe it would be cool to get items before/after key.

like here:
https://discord.js.org/docs/packages/discord.js/main/FetchMessagesOptions:Interface#after
https://discord.js.org/docs/packages/discord.js/main/FetchMessagesOptions:Interface#before

Ideal solution or implementation

Collection#after(key: K): Should only return messages after the key
Collection#before(key: K): Should only return messages before the key

Alternative solutions or implementations

No response

Other context

No response

@Jiralite
Copy link
Member

The key can be a number, a string, a big integer, an object, an array, a function...

What do you expect Collection#after() to do if you receive a collection keyed by functions?

I believe this should be left for users to compare themselves—they will have a better understanding of the data inside a collection they receive.

@fiftyy
Copy link
Author

fiftyy commented Apr 17, 2024

The key can be a number, a string, a big integer, an object, an array, a function...

What do you expect Collection#after() to do if you receive a collection keyed by functions?

I believe this should be left for users to compare themselves—they will have a better understanding of the data inside a collection they receive.

Yes, as i have written. Didn't think about the functions and so on...

So i need create my own logic. but i have some problems. currently while doing this. I would like to describe my problem, but i think it doesnt fits into this issue. I already opened a post on discord.

@fiftyy fiftyy closed this as completed Apr 17, 2024
@Jiralite Jiralite closed this as not planned Won't fix, can't repro, duplicate, stale Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants