mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-08-29 12:18:23 +02:00
* Add directory * Add lab check script * Delete duplicated icons * Fix the lab page * Adjust paths * update lockfile * update lockfile * fix(lab/planet): replace with guideline-compliant design * Add install step * Add second install step * Adjust lab in site * try this * Fix workflow * Add cspell * Format code * Temporary delete icons for copilot review * Place back lab icons * Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Update lock file * Revert svg changes * Fix list * Rename filenames * Format tsconfig --------- Co-authored-by: Karsa <contact@karsa.org> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
26 lines
737 B
TypeScript
26 lines
737 B
TypeScript
import { eventHandler, setResponseHeader } from 'h3';
|
|
import iconMetaData from '../../../data/lab/iconMetaData';
|
|
import iconPopularity from '../../../data/lab/iconPopularity';
|
|
import iconNodes from '../../../data/lab/iconNodes';
|
|
|
|
export default eventHandler((event) => {
|
|
setResponseHeader(event, 'Access-Control-Allow-Origin', '*');
|
|
|
|
return Object.fromEntries(
|
|
Object.entries(iconMetaData).map(([iconName, iconData]) => {
|
|
// Remove $schema from the response
|
|
delete iconData['$schema'];
|
|
|
|
return [
|
|
iconName,
|
|
{
|
|
name: iconName,
|
|
iconNode: iconNodes[iconName],
|
|
popularity: iconPopularity[iconName]?.count ?? 0,
|
|
...iconData,
|
|
},
|
|
];
|
|
}),
|
|
);
|
|
});
|