1
0
mirror of https://github.com/twitter/twemoji.git synced 2024-06-15 03:35:16 +00:00

fix: remove duplicates in q.nonStandard

This commit is contained in:
Masayoshi Sekimura 2014-11-07 18:48:44 -08:00
parent f5d1318b97
commit 76eac0f450
4 changed files with 16 additions and 3 deletions

View File

@ -19,6 +19,18 @@ var assets = {
// there is no asset equivalent for these
var ignoreMissing = ['2002', '2003', '2005'];
function unique(src) {
var dst = [], seen = {};
for (var i = 0; i < src.length; i++) {
if (!seen.hasOwnProperty(src[i])) {
dst.push(src[i]);
seen[src[i]]++;
}
}
return dst;
}
// basic utility to organize async code
// see: http://webreflection.blogspot.co.uk/2012/03/tweet-sized-queue-system.html
// or: http://webreflection.blogspot.co.uk/2012/06/working-with-queues.html
@ -189,6 +201,7 @@ Queue([
});
if (q.nonStandard.length) {
q.nonStandard = unique(q.nonStandard);
console.warn('[WARNING] assets contain ' + q.nonStandard.length + ' non standard emoji:');
// console.log(q.nonStandard.join(', '));
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long