From 9cd249342b4d392d9e24f17810dbe4442e3a5f11 Mon Sep 17 00:00:00 2001 From: Schuyler Cebulskie Date: Mon, 12 Sep 2016 21:40:15 -0400 Subject: [PATCH] Teensy reorganisation --- src/util/Collection.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) 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;