18 lines
507 B
TypeScript
18 lines
507 B
TypeScript
import {createIcons, icons} from "lucide";
|
|
|
|
import {toLucideIconsPascalCase} from "../../common/StringUtils.js";
|
|
|
|
let hasAlreadyReplacedIcons = false;
|
|
|
|
export function replaceIcons(once: boolean): void {
|
|
if (!once || !hasAlreadyReplacedIcons) {
|
|
console.log('Create icons...');
|
|
createIcons({icons});
|
|
hasAlreadyReplacedIcons = true;
|
|
}
|
|
}
|
|
|
|
export function isLucideIcon(iconName: string): boolean {
|
|
return Object.keys(icons).indexOf(toLucideIconsPascalCase(iconName)) >= 0;
|
|
}
|