Open
Description
Which package is this bug report for?
collection
Issue description
I doubt this matters too much, but here it is anyway.
Steps to reproduce:
- Call any method which has the
this
return type upon the Collection. - The method will return a Collection which is no longer of the
ReadonlyCollection
type... - ...thus, you can call methods such as
.set()
and.delete()
on the Collection.
Code sample
const testColl: ReadonlyCollection<string, number> = new Collection<string, number>([
['id', 123]
]);
testColl.tap(() => {}).set('unexpected', 0);
testColl.each(() => {}).delete('id');
console.log(testColl); // Collection(1) [Map] { 'unexpected' => 0 }
Versions
- @discordjs/collection 2.1.1
- discord.js 14.16.2
- typescript 5.3.3
- NodeJS 20.14.0
- Windows 22H2
Issue priority
Low (slightly annoying)
Which partials do you have configured?
Not applicable
Which gateway intents are you subscribing to?
Not applicable
I have tested this issue on a development release
No response