mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-16 23:55:20 +00:00
a2d967e98e
* fist test * Use a font * Cleanup * Use right fallbacks for fonts * Lint * Cleanup and comment * Add visual test
27 lines
659 B
TypeScript
27 lines
659 B
TypeScript
import fs from 'fs';
|
|
import emojisRaws from 'emoji-assets/emoji.json';
|
|
|
|
interface EmojiData {
|
|
code_points: {
|
|
base: string;
|
|
fully_qualified: string;
|
|
};
|
|
}
|
|
|
|
const emojis = emojisRaws as Record<string, EmojiData>;
|
|
const output: Record<string, string> = {};
|
|
|
|
Object.entries(emojis).forEach(([key, value]) => {
|
|
const emoji = value.code_points?.fully_qualified;
|
|
if (emoji && key !== emoji) {
|
|
output[key] = emoji;
|
|
} else if (!emoji) {
|
|
console.log('No emoji for', key);
|
|
}
|
|
});
|
|
|
|
fs.writeFileSync(
|
|
'index.ts',
|
|
`export const emojiCodepoints: Record<string, string> = ${JSON.stringify(output, null, 4)};`,
|
|
);
|