From dcb901e1c2c48d706b0e661cb2730be2e792722f Mon Sep 17 00:00:00 2001 From: Aaron Lidman Date: Mon, 25 Nov 2013 16:39:39 -0800 Subject: [PATCH] Added countThreshold to limit presets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Didn’t realize the presets would be so large, here’s a way of throttling them based on the count property if we need to. --- build.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.js b/build.js index 7bbcbdbd9..838462aca 100644 --- a/build.js +++ b/build.js @@ -90,7 +90,8 @@ function generateFields() { } function suggestionsToPresets(presets) { - var existing = {}; + var existing = {}, + countThreshold = 0; for (var preset in presets) { existing[presets[preset].name] = { @@ -112,7 +113,7 @@ function suggestionsToPresets(presets) { tags.name = name; - if (!existing[name]) addPreset(item, tags, name, count); + if (!existing[name] && count > countThreshold) addPreset(item, tags, name, count); } } }