()
| 88 | * Get the available icons from the icons directory. |
| 89 | */ |
| 90 | export function getIcons() { |
| 91 | const iconFiles = getAllFiles(resolve(packagesDir, 'icons/src/icons')) |
| 92 | const icons = {} |
| 93 | iconFiles.forEach((filePath) => { |
| 94 | const extension = extname(filePath) |
| 95 | if (extension !== '.ts') return |
| 96 | const file = basename(filePath, extension) |
| 97 | const name = toCamelCase(file) |
| 98 | let data = fs.readFileSync(filePath, 'utf8') |
| 99 | data = data.replace('export default `', '').replace('</svg>`', '</svg>') |
| 100 | icons[name] = data |
| 101 | }) |
| 102 | return icons |
| 103 | } |
| 104 | |
| 105 | /** |
| 106 | * Get all the plugin directories in the themes package at provided path |
no test coverage detected