import * as fs from 'node:fs/promises' console.info('Reading icons from "./src/project-view/assets/icons.svg"...') const icons = await fs.readFile('./src/project-view/assets/icons.svg', { encoding: 'utf-8' }) const iconNames = icons.match(/(?<= ` | '${name}'`).join('\n')} export { iconNames } const iconNamesSet = new Set(iconNames) /** Check if string is one of the valid icon names for SvgIcon. */ export function isIconName(value: string): value is Icon { return iconNamesSet.has(value) } `, ) console.info('Done.')