2
0
mirror of https://github.com/iconify/iconify.git synced 2024-10-24 17:41:58 +00:00
iconify/packages/utils/src/loader/loader.ts

22 lines
441 B
TypeScript
Raw Normal View History

import { getCustomIcon } from './custom';
import type { IconifyLoaderOptions } from './types';
export async function loadIcon(
collection: string,
icon: string,
options?: IconifyLoaderOptions
): Promise<string | undefined> {
const custom = options?.customCollections?.[collection];
if (custom) {
const result = await getCustomIcon(custom, collection, icon, options);
if (result) {
return result;
}
}
2022-02-27 16:58:24 +00:00
return undefined;
}