Sticker Creator

This commit is contained in:
Ken Powers 2019-12-17 15:25:57 -05:00 committed by Scott Nonnenberg
parent 2df1ba6e61
commit 11d47a8eb9
123 changed files with 11287 additions and 1714 deletions

View file

@ -4,6 +4,7 @@ import emojiRegex from 'emoji-regex';
import {
compact,
flatMap,
get,
groupBy,
isNumber,
keyBy,
@ -71,8 +72,16 @@ const data = (untypedData as Array<EmojiData>).filter(
emoji => emoji.has_img_apple
);
// @ts-ignore
const ROOT_PATH = get(
// tslint:disable-next-line no-typeof-undefined
typeof window !== 'undefined' ? window : null,
'ROOT_PATH',
''
);
const makeImagePath = (src: string) => {
return `node_modules/emoji-datasource-apple/img/apple/64/${src}`;
return `${ROOT_PATH}node_modules/emoji-datasource-apple/img/apple/64/${src}`;
};
const imageQueue = new PQueue({ concurrency: 10 });