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:
parent
f5d1318b97
commit
76eac0f450
@ -19,6 +19,18 @@ var assets = {
|
|||||||
// there is no asset equivalent for these
|
// there is no asset equivalent for these
|
||||||
var ignoreMissing = ['2002', '2003', '2005'];
|
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
|
// basic utility to organize async code
|
||||||
// see: http://webreflection.blogspot.co.uk/2012/03/tweet-sized-queue-system.html
|
// 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
|
// or: http://webreflection.blogspot.co.uk/2012/06/working-with-queues.html
|
||||||
@ -189,6 +201,7 @@ Queue([
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (q.nonStandard.length) {
|
if (q.nonStandard.length) {
|
||||||
|
q.nonStandard = unique(q.nonStandard);
|
||||||
console.warn('[WARNING] assets contain ' + q.nonStandard.length + ' non standard emoji:');
|
console.warn('[WARNING] assets contain ' + q.nonStandard.length + ' non standard emoji:');
|
||||||
// console.log(q.nonStandard.join(', '));
|
// 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
Loading…
Reference in New Issue
Block a user