Skip to content
This repository has been archived by the owner on Jan 8, 2022. It is now read-only.

map() like function on Collections that uses function argument as key instead. #47

Open
gd0st opened this issue Sep 15, 2021 · 1 comment

Comments

@gd0st
Copy link

gd0st commented Sep 15, 2021

Hi,

Currently .filter() is a custom implementation that returns a filtered map with the ID being they key. .map() returns an array, consistent with Javascript documentation. Is it possible to implement a function that allows for the Collection to return a map that can return a map with a different key as for instance such as channel.name -> channel etc.

I wrote and got a reply in the wrong repo about this feature request here discordjs/discord.js#6645

@almostSouji
Copy link
Member

I looked into it again, and if you don't want to transform the key there is https://discord.js.org/#/docs/collection/main/class/Collection?scrollTo=mapValues

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

No branches or pull requests

3 participants