From e0b629eb34b30e2d414740e24e6d8318b6b388e3 Mon Sep 17 00:00:00 2001 From: Dale Harvey Date: Thu, 1 Mar 2012 02:09:50 +0000 Subject: [PATCH] dont keep show duplicate fonts --- upmock.node.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/upmock.node.js b/upmock.node.js index 47a0946..d05fc6f 100644 --- a/upmock.node.js +++ b/upmock.node.js @@ -83,7 +83,9 @@ app.get('/fonts/', function(_err, res) { return {'id': x.family, 'family':x.family, 'source':'google'}; }); - var result = t1.concat(t2).sort(function(a, b) { + var result = _.uniq(t1.concat(t2), false, function(x) { + return x.family; + }).sort(function(a, b) { var nameA = a.family.toLowerCase(); var nameB = b.family.toLowerCase(); if (nameA < nameB) {