mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-11-14 13:58:21 +00:00
31 lines
949 B
TypeScript
31 lines
949 B
TypeScript
import * as iconDetails from '../.vitepress/data/iconDetails/index.ts';
|
|
|
|
export default {
|
|
async load() {
|
|
return {
|
|
icons: Object.entries(iconDetails)
|
|
.map(
|
|
([
|
|
,
|
|
{ name, iconNode, popularity, createdRelease, awaitingRelease, aliases = [], fromFork },
|
|
]) => ({
|
|
name,
|
|
iconNode,
|
|
popularity: popularity?.count ?? 0,
|
|
aliases: aliases
|
|
.map((alias) => (typeof alias === 'string' ? alias : alias?.name))
|
|
.filter((alias): alias is string => Boolean(alias)),
|
|
createdRelease,
|
|
awaitingRelease,
|
|
fromFork,
|
|
}),
|
|
// We hide icons that are not released yet, we make exceptions for preview environments
|
|
)
|
|
.filter(
|
|
({ awaitingRelease }) =>
|
|
!awaitingRelease || process.env.VITE_SHOW_AWAITING_RELEASE === 'true',
|
|
),
|
|
};
|
|
},
|
|
};
|