2
0
mirror of https://github.com/iconify/iconify.git synced 2024-11-09 14:50:56 +00:00

chore: add try catch to custom loader in utils

This commit is contained in:
Vjacheslav Trushkin 2023-08-12 18:59:21 +03:00
parent 8b2af7135a
commit a7f77a2ac5

View File

@ -22,11 +22,15 @@ export async function getCustomIcon(
debug(`${collection}:${icon}`); debug(`${collection}:${icon}`);
if (typeof custom === 'function') { try {
result = await custom(icon); if (typeof custom === 'function') {
} else { result = await custom(icon);
const inline = custom[icon]; } else {
result = typeof inline === 'function' ? await inline() : inline; const inline = custom[icon];
result = typeof inline === 'function' ? await inline() : inline;
}
} catch {
return;
} }
if (result) { if (result) {