mirror of
https://github.com/danbulant/discord.js
synced 2026-06-24 01:01:53 +00:00
Webpack build: a0b245bfe1
This commit is contained in:
parent
e05523b360
commit
6146da8ec7
2 changed files with 17 additions and 1 deletions
|
|
@ -801,6 +801,22 @@ class Collection extends Map {
|
|||
}
|
||||
return returns;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the collections have identical key-value pairings.
|
||||
* This is different to checking for equality using equal-signs, because
|
||||
* the collections may be different objects, but functionally identical.
|
||||
* @param {Collection} collection Collection to compare with.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
equals(collection) {
|
||||
if (this === collection) return true;
|
||||
if (this.size !== collection.size) return false;
|
||||
return !this.find((value, key) => {
|
||||
const testVal = collection.get(key);
|
||||
return testVal !== value || (testVal === undefined && !collection.has(key));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Collection;
|
||||
|
|
|
|||
2
discord.indev.min.js
vendored
2
discord.indev.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue