mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-11-12 13:38:32 +00:00
18 lines
569 B
TypeScript
18 lines
569 B
TypeScript
import path from 'path';
|
|
import { readSvgDirectory } from '@lucide/helpers';
|
|
import { type Path } from '../types.ts';
|
|
|
|
async function getAliases(iconDirectory: Path) {
|
|
const iconJsons = await readSvgDirectory(iconDirectory, '.json');
|
|
const aliasesEntries = await Promise.all(
|
|
iconJsons.map(async (jsonFile) => {
|
|
const file = await import(path.join(iconDirectory, jsonFile), { with: { type: 'json' } });
|
|
return [path.basename(jsonFile, '.json'), file.default];
|
|
}),
|
|
);
|
|
|
|
return Object.fromEntries(aliasesEntries);
|
|
}
|
|
|
|
export default getAliases;
|