From 56352220afe29359f734f1ed76422dfbaf6e7aea Mon Sep 17 00:00:00 2001 From: Schuyler Cebulskie Date: Tue, 30 Aug 2016 04:47:11 -0400 Subject: [PATCH] Make Collection.find and findAll use .values() (#567) * Make Collection.find and findAll use .values() * Make Collection.deleteAll use .values() --- src/util/Collection.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/Collection.js b/src/util/Collection.js index 3f706728d..f33053a33 100644 --- a/src/util/Collection.js +++ b/src/util/Collection.js @@ -51,7 +51,7 @@ class Collection extends Map { */ deleteAll() { const returns = []; - for (const item of this.array()) { + for (const item of this.values()) { if (item.delete) { returns.push(item.delete()); } @@ -78,7 +78,7 @@ class Collection extends Map { */ findAll(key, value) { const results = []; - for (const item of this.array()) { + for (const item of this.values()) { if (item[key] === value) { results.push(item); } @@ -95,7 +95,7 @@ class Collection extends Map { * collection.get('id', '123123...'); */ find(key, value) { - for (const item of this.array()) { + for (const item of this.values()) { if (item[key] === value) { return item; }