1
0
mirror of https://github.com/twitter/twemoji.git synced 2024-11-16 11:18:37 +00:00

trying to bring in regenerate

This commit is contained in:
Andrea Giammarchi 2015-06-12 19:10:22 +02:00
parent f5ca4f51f9
commit 990a73c73d
5 changed files with 14 additions and 6 deletions

View File

@ -217,6 +217,14 @@ Queue([
console.log('generating a RegExp for available assets');
var sensitive = [];
var regular = [];
var regenerate = require('regenerate');
var regenerated = function (arr) {
return regenerate.apply(null, arr.map(function (emoji) {
return JSON.parse('"' + emoji + '"').split('').reduce(function (p, c) {
return p + c.codePointAt(0);
}, 0);
})).toRegExp().toString().slice(1, -1);
};
q.emojiSource.forEach(function (codePoint) {
var u;
if (q.ignore.indexOf(codePoint) < 0) {
@ -231,8 +239,8 @@ Queue([
// create a RegExp with properly ordered matches
q.re = '((?:' +
regular.join('|') + ')|(?:(?:' +
sensitive.join('|') +
regenerated(regular) + ')|(?:(?:' +
regenerated(sensitive) +
')([\\uFE0E\\uFE0F]?)))';
q.next();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
twemoji.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long