import type { TIconType } from "../config/types"; /** * Получает исходный код иконки * @param path{String=} Путь или идентификатор иконки * @param type{String=} Тип иконки ('asset' | 'material') * @returns {String} */ export const getIconHref = (path: string = "", type: TIconType = "asset"): string => { if (type === "material") { return path; } const namespace = "icon-"; const prefix = `#${namespace}`; return path.startsWith(prefix) ? path : prefix + path.replace(namespace, ""); };