Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
aria: ${attr['aria-hidden']},
path: ${o.path.replace('fill-rule', 'fillRule')},
}`;
elems.push(` '${o.symbol}': ${icon},`);
}
const template = fs.readFileSync(path.join(__dirname, 'template.tsx'), 'utf8');
const constant = `const OCTICONS: {[T in OcticonSymbol]: IconInfo} = {
${elems.join('\n')}
};
export type OcticonSymbol =
${symbols.map(s => `'${s}'`).join(' |\n ')};
export const OCTICONS_VERSION = '${require('octicons/package.json').version}';
`;
fs.writeFileSync('index.tsx', template + constant, 'utf8');