import { getEmojis } from "../vim-jpのemoji情報をscrapbox_json_dataに変換/mod.ts"; import { getTags } from "./utils.ts"; const customEmojis = await getEmojis(); const pages = customEmojis.map(({ name, ...rest }) =>{ const href = ("src" in rest) ? rest.src : customEmojis.find(emoji => emoji.name === rest.alias)?.src; return { title: name, lines: [ name, ...(href ? [`[${href}]`] : []), '', ...(("alias" in rest) ? [`[${rest.alias}]`] : []), ...getTags(name).map((tag) => `#${tag.replaceAll(" ", "_")}`), ], }; }); await Deno.writeTextFile('vim-jp-emojis.json', JSON.stringify({ pages }));