mirror of
https://github.com/danbulant/discord.js
synced 2026-06-19 22:51:32 +00:00
Webpack build for branch master: 25bb602d5a
This commit is contained in:
parent
9b42283906
commit
01dd65bc04
2 changed files with 11 additions and 3 deletions
|
|
@ -883,6 +883,15 @@ class Collection extends Map {
|
|||
return accumulator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an identical shallow copy of this collection.
|
||||
* @returns {Collection}
|
||||
* @example const newColl = someColl.clone();
|
||||
*/
|
||||
clone() {
|
||||
return new this.constructor(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Combines this collection with others into a new collection. None of the source collections are modified.
|
||||
* @param {...Collection} collections Collections to merge
|
||||
|
|
@ -890,8 +899,7 @@ class Collection extends Map {
|
|||
* @example const newColl = someColl.concat(someOtherColl, anotherColl, ohBoyAColl);
|
||||
*/
|
||||
concat(...collections) {
|
||||
const newColl = new this.constructor();
|
||||
for (const [key, val] of this) newColl.set(key, val);
|
||||
const newColl = this.clone();
|
||||
for (const coll of collections) {
|
||||
for (const [key, val] of coll) newColl.set(key, val);
|
||||
}
|
||||
|
|
|
|||
2
discord.master.min.js
vendored
2
discord.master.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue