mirror of
https://github.com/StepanovPlaton/AboutMe.git
synced 2026-07-28 19:35:51 +04:00
18 lines
496 B
JavaScript
18 lines
496 B
JavaScript
import { readFileSync } from "fs";
|
|
import { join } from "path";
|
|
|
|
const inventoryPath = join(import.meta.dirname, "../src/generated/icon-inventory.json");
|
|
|
|
export function loadIconInventory() {
|
|
return JSON.parse(readFileSync(inventoryPath, "utf8"));
|
|
}
|
|
|
|
export function toAstroIconInclude(inventory) {
|
|
/** @type {Record<string, string[]>} */
|
|
const include = {};
|
|
for (const [prefix, icons] of Object.entries(inventory)) {
|
|
include[prefix] = icons;
|
|
}
|
|
return include;
|
|
}
|