diff --git a/src/util/Collection.js b/src/util/Collection.js index a9c715948..83e5d8e4c 100644 --- a/src/util/Collection.js +++ b/src/util/Collection.js @@ -81,19 +81,6 @@ class Collection extends Map { return arr[Math.floor(Math.random() * arr.length)]; } - /** - * If the items in this collection have a delete method (e.g. messages), invoke - * the delete method. Returns an array of promises - * @returns {Promise[]} - */ - deleteAll() { - const returns = []; - for (const item of this.values()) { - if (item.delete) returns.push(item.delete()); - } - return returns; - } - /** * Returns an array of items where `item[prop] === value` of the collection * @param {string} prop The property to test against @@ -262,6 +249,19 @@ class Collection extends Map { for (const [key, val] of this) currentVal = fn(currentVal, val, key, this); return currentVal; } + + /** + * If the items in this collection have a delete method (e.g. messages), invoke + * the delete method. Returns an array of promises + * @returns {Promise[]} + */ + deleteAll() { + const returns = []; + for (const item of this.values()) { + if (item.delete) returns.push(item.delete()); + } + return returns; + } } module.exports = Collection;